1 /* 2 * Copyright 2007, Travis Geiselbrecht. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _KERNEL_COMMPAGE_H 6 #define _KERNEL_COMMPAGE_H 7 8 /*! Some systemwide commpage constants, used in the kernel and libroot */ 9 10 #ifndef _ASSEMBLER 11 # include <SupportDefs.h> 12 #endif 13 14 15 /* be careful what you put here, this file is included from assembly */ 16 #define COMMPAGE_ENTRY_MAGIC 0 17 #define COMMPAGE_ENTRY_VERSION 1 18 #define COMMPAGE_ENTRY_REAL_TIME_DATA 2 19 #define COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC 3 20 21 #define COMMPAGE_SIZE (0x8000) 22 #define COMMPAGE_TABLE_ENTRIES 64 23 24 #define COMMPAGE_SIGNATURE 'COMM' 25 #define COMMPAGE_VERSION 1 26 27 #define USER_COMMPAGE_ADDR ARCH_USER_COMMPAGE_ADDR 28 // set by the architecture specific implementation 29 30 #ifndef _ASSEMBLER 31 32 #define USER_COMMPAGE_TABLE ((void**)(USER_COMMPAGE_ADDR)) 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 status_t commpage_init(void); 39 void* allocate_commpage_entry(int entry, size_t size); 40 void* fill_commpage_entry(int entry, const void* copyFrom, size_t size); 41 42 status_t arch_commpage_init(void); 43 // implemented in the architecture specific part 44 45 #ifdef __cplusplus 46 } // extern "C" 47 #endif 48 49 #endif // ! _ASSEMBLER 50 51 #include <arch_commpage.h> 52 53 #endif /* _KERNEL_COMMPAGE_H */ 54