Changeset c993e45 in mainline
- Timestamp:
- 2007-02-11T22:48:43Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bea09de6
- Parents:
- bd1deed
- Location:
- kernel
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
rbd1deed rc993e45 246 246 247 247 ifeq ($(CONFIG_EXPERIMENTAL),y) 248 GENERIC_SOURCES += generic/src/lib/objc.c 248 GENERIC_SOURCES += generic/src/lib/objc_ext.c \ 249 generic/src/lib/objc.c 249 250 EXTRA_OBJECTS = $(LIBDIR)/libobjc.a 250 251 EXTRA_FLAGS += -x objective-c -
kernel/generic/include/lib/objc.h
rbd1deed rc993e45 1 1 /* 2 * Copyright (c) 200 6Martin Decky2 * Copyright (c) 2007 Martin Decky 3 3 * All rights reserved. 4 4 * … … 36 36 #define KERN_OBJC_H_ 37 37 38 #include <arch/types.h> 39 #include <arch/arg.h> 38 extern id class_create_instance(Class _class); 39 extern id object_dispose(id object); 40 40 41 extern void *stderr; 41 @interface base_t { 42 Class isa; 43 } 42 44 43 extern void __assert_fail(const char *assertion, const char *file, unsigned int line, const char *function);44 extern void abort(void);45 + (id) new; 46 - (id) free; 45 47 46 extern void *fopen(const char *path, const char *mode); 47 extern size_t fread(void *ptr, size_t size, size_t nmemb, void *stream); 48 extern size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream); 49 extern int fflush(void *stream); 50 extern int feof(void *stream); 51 extern int fclose(void *stream); 52 53 extern int vfprintf(void *stream, const char *format, va_list ap); 54 extern int sscanf(const char *str, const char *format, ...); 55 extern const unsigned short **__ctype_b_loc(void); 56 extern long int __strtol_internal(const char *__nptr, char **__endptr, int __base, int __group); 57 58 extern void *memset(void *s, int c, size_t n); 59 extern void *calloc(size_t nmemb, size_t size); 48 @end 60 49 61 50 #endif 62 63 /** @}64 */ -
kernel/generic/include/mm/as.h
rbd1deed rc993e45 54 54 #include <lib/elf.h> 55 55 56 #ifdef __OBJC__ 57 #include <lib/objc.h> 58 #endif 59 56 60 /** 57 61 * Defined to be true if user address space and kernel address space shadow each … … 82 86 83 87 #ifdef __OBJC__ 84 @interface as_t {88 @interface as_t : base_t { 85 89 @public 86 90 /** Protected by asidlock. */ … … 110 114 as_arch_t arch; 111 115 } 116 112 117 + (pte_t *) page_table_create: (int) flags; 113 118 + (void) page_table_destroy: (pte_t *) page_table; 114 119 - (void) page_table_lock: (bool) _lock; 115 120 - (void) page_table_unlock: (bool) unlock; 121 116 122 @end 117 123 -
kernel/generic/src/lib/objc_ext.c
rbd1deed rc993e45 40 40 */ 41 41 42 #include <lib/objc .h>42 #include <lib/objc_ext.h> 43 43 #include <panic.h> 44 44 #include <arch/memstr.h> -
kernel/generic/src/mm/as.c
rbd1deed rc993e45 88 88 */ 89 89 as_operations_t *as_operations = NULL; 90 #endif91 90 92 91 /** … … 94 93 */ 95 94 static slab_cache_t *as_slab; 95 #endif 96 96 97 97 /** … … 116 116 static void sh_info_remove_reference(share_info_t *sh_info); 117 117 118 #ifndef __OBJC__ 118 119 static int as_constructor(void *obj, int flags) 119 120 { … … 135 136 return as_destructor_arch(as); 136 137 } 138 #endif 137 139 138 140 /** Initialize address space subsystem. */ … … 140 142 { 141 143 as_arch_init(); 142 144 145 #ifndef __OBJC__ 143 146 as_slab = slab_cache_create("as_slab", sizeof(as_t), 0, 144 147 as_constructor, as_destructor, SLAB_CACHE_MAGDEFERRED); 148 #endif 145 149 146 150 AS_KERNEL = as_create(FLAG_AS_KERNEL); … … 158 162 as_t *as; 159 163 164 #ifdef __OBJC__ 165 as = [as_t new]; 166 link_initialize(&as->inactive_as_with_asid_link); 167 mutex_initialize(&as->lock); 168 (void) as_constructor_arch(as, flags); 169 #else 160 170 as = (as_t *) slab_alloc(as_slab, 0); 171 #endif 161 172 (void) as_create_arch(as, 0); 162 173 … … 229 240 230 241 interrupts_restore(ipl); 231 242 243 #ifdef __OBJC__ 244 [as free]; 245 #else 232 246 slab_free(as_slab, as); 247 #endif 233 248 } 234 249
Note:
See TracChangeset
for help on using the changeset viewer.