blob: e9a58600d141447f39273698b6ca8afd8e2533a0 [file] [log] [blame]
Loganeb3d12b2010-12-16 06:20:18 +08001/*
2 * copyright 2010, the android open source project
3 *
4 * licensed under the apache license, version 2.0 (the "license");
5 * you may not use this file except in compliance with the license.
6 * you may obtain a copy of the license at
7 *
8 * http://www.apache.org/licenses/license-2.0
9 *
10 * unless required by applicable law or agreed to in writing, software
11 * distributed under the license is distributed on an "as is" basis,
12 * without warranties or conditions of any kind, either express or implied.
13 * see the license for the specific language governing permissions and
14 * limitations under the license.
15 */
16
17#ifndef BCC_CONTEXTMANAGER_H
18#define BCC_CONTEXTMANAGER_H
19
20#include <stddef.h>
21
22#include <unistd.h>
23
24
25#define BCC_CONTEXT_FIXED_ADDR (reinterpret_cast<char *>(0x7e000000))
Loganc5eec482010-12-16 06:24:46 +080026#define BCC_CONTEXT_SLOT_COUNT 8
Loganeb3d12b2010-12-16 06:20:18 +080027
28#define BCC_CONTEXT_CODE_SIZE (128 * 1024)
29#define BCC_CONTEXT_DATA_SIZE (128 * 1024)
30#define BCC_CONTEXT_SIZE (BCC_CONTEXT_CODE_SIZE + BCC_CONTEXT_DATA_SIZE)
31
32
33namespace bcc {
34
35 extern char *allocateContext();
36
37 extern char *allocateContext(char *addr, int imageFd, off_t imageOffset);
38
39 extern void deallocateContext(char *addr);
40
41} // namespace bcc
42
43
44#endif // BCC_CONTEXTMANAGER_H