Changeset da1bafb in mainline for kernel/generic/include/mm/slab.h


Ignore:
Timestamp:
2010-05-24T18:57:31Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/slab.h

    r666f492 rda1bafb  
    8484} slab_mag_cache_t;
    8585
    86 
    8786typedef struct {
    8887        const char *name;
     
    9493        size_t size;
    9594       
    96         int (*constructor)(void *obj, int kmflag);
    97         int (*destructor)(void *obj);
     95        int (*constructor)(void *obj, unsigned int kmflag);
     96        size_t (*destructor)(void *obj);
    9897       
    9998        /** Flags changing behaviour of cache */
    100         int flags;
     99        unsigned int flags;
    101100       
    102101        /* Computed values */
    103         uint8_t order;         /**< Order of frames to be allocated */
    104         unsigned int objects;  /**< Number of objects that fit in */
     102        uint8_t order;   /**< Order of frames to be allocated */
     103        size_t objects;  /**< Number of objects that fit in */
    105104       
    106105        /* Statistics */
     
    109108        atomic_t cached_objs;
    110109        /** How many magazines in magazines list */
    111         atomic_t magazine_counter; 
     110        atomic_t magazine_counter;
    112111       
    113112        /* Slabs */
     
    124123
    125124extern slab_cache_t *slab_cache_create(const char *, size_t, size_t,
    126     int (*)(void *, int), int (*)(void *), int);
     125    int (*)(void *, unsigned int), size_t (*)(void *), unsigned int);
    127126extern void slab_cache_destroy(slab_cache_t *);
    128127
    129 extern void * slab_alloc(slab_cache_t *, int);
     128extern void * slab_alloc(slab_cache_t *, unsigned int);
    130129extern void slab_free(slab_cache_t *, void *);
    131 extern size_t slab_reclaim(int);
     130extern size_t slab_reclaim(unsigned int);
    132131
    133132/* slab subsytem initialization */
     
    139138
    140139/* malloc support */
    141 extern void *malloc(unsigned int, int);
    142 extern void *realloc(void *, unsigned int, int);
     140extern void *malloc(size_t, unsigned int);
     141extern void *realloc(void *, size_t, unsigned int);
    143142extern void free(void *);
    144143
Note: See TracChangeset for help on using the changeset viewer.