Changeset c993e45 in mainline


Ignore:
Timestamp:
2007-02-11T22:48:43Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bea09de6
Parents:
bd1deed
Message:

small cleanup, more work coming

Location:
kernel
Files:
1 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rbd1deed rc993e45  
    246246
    247247ifeq ($(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
    249250        EXTRA_OBJECTS = $(LIBDIR)/libobjc.a
    250251        EXTRA_FLAGS += -x objective-c
  • kernel/generic/include/lib/objc.h

    rbd1deed rc993e45  
    11/*
    2  * Copyright (c) 2006 Martin Decky
     2 * Copyright (c) 2007 Martin Decky
    33 * All rights reserved.
    44 *
     
    3636#define KERN_OBJC_H_
    3737
    38 #include <arch/types.h>
    39 #include <arch/arg.h>
     38extern id class_create_instance(Class _class);
     39extern id object_dispose(id object);
    4040
    41 extern void *stderr;
     41@interface base_t {
     42    Class isa;
     43}
    4244
    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;
    4547
    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
    6049
    6150#endif
    62 
    63 /** @}
    64  */
  • kernel/generic/include/mm/as.h

    rbd1deed rc993e45  
    5454#include <lib/elf.h>
    5555
     56#ifdef __OBJC__
     57#include <lib/objc.h>
     58#endif
     59
    5660/**
    5761 * Defined to be true if user address space and kernel address space shadow each
     
    8286
    8387#ifdef __OBJC__
    84 @interface as_t {
     88@interface as_t : base_t {
    8589        @public
    8690                /** Protected by asidlock. */
     
    110114                as_arch_t arch;
    111115}
     116
    112117+ (pte_t *) page_table_create: (int) flags;
    113118+ (void) page_table_destroy: (pte_t *) page_table;
    114119- (void) page_table_lock: (bool) _lock;
    115120- (void) page_table_unlock: (bool) unlock;
     121
    116122@end
    117123
  • kernel/generic/src/lib/objc_ext.c

    rbd1deed rc993e45  
    4040 */
    4141
    42 #include <lib/objc.h>
     42#include <lib/objc_ext.h>
    4343#include <panic.h>
    4444#include <arch/memstr.h>
  • kernel/generic/src/mm/as.c

    rbd1deed rc993e45  
    8888 */
    8989as_operations_t *as_operations = NULL;
    90 #endif
    9190
    9291/**
     
    9493 */
    9594static slab_cache_t *as_slab;
     95#endif
    9696
    9797/**
     
    116116static void sh_info_remove_reference(share_info_t *sh_info);
    117117
     118#ifndef __OBJC__
    118119static int as_constructor(void *obj, int flags)
    119120{
     
    135136        return as_destructor_arch(as);
    136137}
     138#endif
    137139
    138140/** Initialize address space subsystem. */
     
    140142{
    141143        as_arch_init();
    142        
     144
     145#ifndef __OBJC__
    143146        as_slab = slab_cache_create("as_slab", sizeof(as_t), 0,
    144147            as_constructor, as_destructor, SLAB_CACHE_MAGDEFERRED);
     148#endif
    145149       
    146150        AS_KERNEL = as_create(FLAG_AS_KERNEL);
     
    158162        as_t *as;
    159163
     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
    160170        as = (as_t *) slab_alloc(as_slab, 0);
     171#endif
    161172        (void) as_create_arch(as, 0);
    162173       
     
    229240
    230241        interrupts_restore(ipl);
    231        
     242
     243#ifdef __OBJC__
     244        [as free];
     245#else
    232246        slab_free(as_slab, as);
     247#endif
    233248}
    234249
Note: See TracChangeset for help on using the changeset viewer.