Changeset af863d0 in mainline
- Timestamp:
- 2008-07-31T10:42:38Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e0e8c9
- Parents:
- 2a513972
- Location:
- kernel
- Files:
-
- 4 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r2a513972 raf863d0 318 318 endif 319 319 320 ## Experimental features321 #322 323 ifeq ($(CONFIG_EXPERIMENTAL),y)324 GENERIC_SOURCES += generic/src/lib/objc_ext.c \325 generic/src/lib/objc.c326 EXTRA_OBJECTS = $(LIBDIR)/libobjc.a327 EXTRA_FLAGS += -x objective-c328 endif329 330 320 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) 331 321 ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) -
kernel/arch/ia32/src/mm/as.c
r2a513972 raf863d0 40 40 void as_arch_init(void) 41 41 { 42 #ifndef __OBJC__43 42 as_operations = &as_pt_operations; 44 #endif45 43 } 46 44 -
kernel/genarch/include/mm/page_pt.h
r2a513972 raf863d0 117 117 #define PTE_EXECUTABLE(p) PTE_EXECUTABLE_ARCH((p)) 118 118 119 #ifndef __OBJC__120 119 extern as_operations_t as_pt_operations; 121 #endif122 120 extern page_mapping_operations_t pt_mapping_operations; 123 121 -
kernel/genarch/src/mm/as_pt.c
r2a513972 raf863d0 53 53 static void pt_unlock(as_t *as, bool unlock); 54 54 55 #ifdef __OBJC__56 @implementation as_t57 58 + (pte_t *) page_table_create: (int) flags59 {60 return ptl0_create(flags);61 }62 63 + (void) page_table_destroy: (pte_t *) page_table64 {65 ptl0_destroy(page_table);66 }67 68 - (void) page_table_lock: (bool) _lock69 {70 pt_lock(self, _lock);71 }72 73 - (void) page_table_unlock: (bool) unlock74 {75 pt_unlock(self, unlock);76 }77 78 @end79 #else80 55 as_operations_t as_pt_operations = { 81 56 .page_table_create = ptl0_create, … … 84 59 .page_table_unlock = pt_unlock 85 60 }; 86 #endif87 61 88 62 /** Create PTL0. -
kernel/generic/include/mm/as.h
r2a513972 raf863d0 54 54 #include <lib/elf.h> 55 55 56 #ifdef __OBJC__57 #include <lib/objc.h>58 #endif59 60 56 /** 61 57 * Defined to be true if user address space and kernel address space shadow each … … 85 81 #define AS_PF_DEFER 2 86 82 87 #ifdef __OBJC__88 @interface as_t : base_t {89 @public90 /** Protected by asidlock. */91 link_t inactive_as_with_asid_link;92 /**93 * Number of processors on wich is this address space active.94 * Protected by asidlock.95 */96 count_t cpu_refcount;97 /**98 * Address space identifier.99 * Constant on architectures that do not support ASIDs.100 * Protected by asidlock.101 */102 asid_t asid;103 104 /** Number of references (i.e tasks that reference this as). */105 atomic_t refcount;106 107 mutex_t lock;108 109 /** B+tree of address space areas. */110 btree_t as_area_btree;111 112 /** Non-generic content. */113 as_genarch_t genarch;114 115 /** Architecture specific content. */116 as_arch_t arch;117 }118 119 + (pte_t *) page_table_create: (int) flags;120 + (void) page_table_destroy: (pte_t *) page_table;121 - (void) page_table_lock: (bool) _lock;122 - (void) page_table_unlock: (bool) unlock;123 124 @end125 126 #else127 128 83 /** Address space structure. 129 84 * … … 169 124 void (* page_table_unlock)(as_t *as, bool unlock); 170 125 } as_operations_t; 171 #endif172 126 173 127 /** … … 250 204 extern as_t *AS_KERNEL; 251 205 252 #ifndef __OBJC__253 206 extern as_operations_t *as_operations; 254 #endif255 256 207 extern link_t inactive_as_with_asid_head; 257 208 -
kernel/generic/src/mm/as.c
r2a513972 raf863d0 83 83 #endif /* CONFIG_VIRT_IDX_DCACHE */ 84 84 85 #ifndef __OBJC__86 85 /** 87 86 * Each architecture decides what functions will be used to carry out … … 94 93 */ 95 94 static slab_cache_t *as_slab; 96 #endif97 95 98 96 /** … … 120 118 static void sh_info_remove_reference(share_info_t *sh_info); 121 119 122 #ifndef __OBJC__123 120 static int as_constructor(void *obj, int flags) 124 121 { … … 140 137 return as_destructor_arch(as); 141 138 } 142 #endif143 139 144 140 /** Initialize address space subsystem. */ … … 147 143 as_arch_init(); 148 144 149 #ifndef __OBJC__150 145 as_slab = slab_cache_create("as_slab", sizeof(as_t), 0, 151 146 as_constructor, as_destructor, SLAB_CACHE_MAGDEFERRED); 152 #endif153 147 154 148 AS_KERNEL = as_create(FLAG_AS_KERNEL); … … 166 160 as_t *as; 167 161 168 #ifdef __OBJC__169 as = [as_t new];170 link_initialize(&as->inactive_as_with_asid_link);171 mutex_initialize(&as->lock, MUTEX_PASSIVE);172 (void) as_constructor_arch(as, flags);173 #else174 162 as = (as_t *) slab_alloc(as_slab, 0); 175 #endif176 163 (void) as_create_arch(as, 0); 177 164 … … 264 251 interrupts_restore(ipl); 265 252 266 #ifdef __OBJC__267 [as free];268 #else269 253 slab_free(as_slab, as); 270 #endif271 254 } 272 255 … … 1164 1147 pte_t *page_table_create(int flags) 1165 1148 { 1166 #ifdef __OBJC__1167 return [as_t page_table_create: flags];1168 #else1169 1149 ASSERT(as_operations); 1170 1150 ASSERT(as_operations->page_table_create); 1171 1151 1172 1152 return as_operations->page_table_create(flags); 1173 #endif1174 1153 } 1175 1154 … … 1182 1161 void page_table_destroy(pte_t *page_table) 1183 1162 { 1184 #ifdef __OBJC__1185 return [as_t page_table_destroy: page_table];1186 #else1187 1163 ASSERT(as_operations); 1188 1164 ASSERT(as_operations->page_table_destroy); 1189 1165 1190 1166 as_operations->page_table_destroy(page_table); 1191 #endif1192 1167 } 1193 1168 … … 1206 1181 void page_table_lock(as_t *as, bool lock) 1207 1182 { 1208 #ifdef __OBJC__1209 [as page_table_lock: lock];1210 #else1211 1183 ASSERT(as_operations); 1212 1184 ASSERT(as_operations->page_table_lock); 1213 1185 1214 1186 as_operations->page_table_lock(as, lock); 1215 #endif1216 1187 } 1217 1188 … … 1223 1194 void page_table_unlock(as_t *as, bool unlock) 1224 1195 { 1225 #ifdef __OBJC__1226 [as page_table_unlock: unlock];1227 #else1228 1196 ASSERT(as_operations); 1229 1197 ASSERT(as_operations->page_table_unlock); 1230 1198 1231 1199 as_operations->page_table_unlock(as, unlock); 1232 #endif1233 1200 } 1234 1201 -
kernel/kernel.config
r2a513972 raf863d0 168 168 # Compile kernel tests 169 169 ! CONFIG_TEST (y/n) 170 171 172 ## Experimental features173 174 # Enable experimental features175 ! CONFIG_EXPERIMENTAL (n/y)
Note:
See TracChangeset
for help on using the changeset viewer.