Logan | eb3d12b | 2010-12-16 06:20:18 +0800 | [diff] [blame] | 1 | /* |
| 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)) |
Logan | c5eec48 | 2010-12-16 06:24:46 +0800 | [diff] [blame] | 26 | #define BCC_CONTEXT_SLOT_COUNT 8 |
Logan | eb3d12b | 2010-12-16 06:20:18 +0800 | [diff] [blame] | 27 | |
| 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 | |
| 33 | namespace 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 |