Changeset 98000fb in mainline for kernel/generic/include


Ignore:
Timestamp:
2009-06-03T19:34:45Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
301ff30
Parents:
69e68e3
Message:

remove redundant index_t and count_t types (which were always quite ambiguous and not actually needed)

Location:
kernel/generic/include
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/bitmap.h

    r69e68e3 r98000fb  
    4242typedef struct {
    4343        uint8_t *map;
    44         count_t bits;
     44        size_t bits;
    4545} bitmap_t;
    4646
    47 extern void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, count_t bits);
    48 extern void bitmap_set_range(bitmap_t *bitmap, index_t start, count_t bits);
    49 extern void bitmap_clear_range(bitmap_t *bitmap, index_t start, count_t bits);
    50 extern void bitmap_copy(bitmap_t *dst, bitmap_t *src, count_t bits);
     47extern void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, size_t bits);
     48extern void bitmap_set_range(bitmap_t *bitmap, size_t start, size_t bits);
     49extern void bitmap_clear_range(bitmap_t *bitmap, size_t start, size_t bits);
     50extern void bitmap_copy(bitmap_t *dst, bitmap_t *src, size_t bits);
    5151
    52 static inline int bitmap_get(bitmap_t *bitmap,index_t bit)
     52static inline int bitmap_get(bitmap_t *bitmap, size_t bit)
    5353{
    5454        if(bit >= bitmap->bits)
    5555                return 0;
     56       
    5657        return !! ((bitmap->map)[bit/8] & (1 << (bit & 7)));
    5758}
  • kernel/generic/include/adt/btree.h

    r69e68e3 r98000fb  
    4747typedef struct btree_node {
    4848        /** Number of keys. */
    49         count_t keys;
     49        size_t keys;
    5050
    5151        /**
  • kernel/generic/include/adt/fifo.h

    r69e68e3 r98000fb  
    6060        struct {                                        \
    6161                t fifo[(itms)];                         \
    62                 count_t items;                          \
    63                 index_t head;                           \
    64                 index_t tail;                           \
     62                size_t items;                           \
     63                size_t head;                            \
     64                size_t tail;                            \
    6565        } name = {                                      \
    6666                .items = (itms),                        \
     
    8181        struct {                                        \
    8282                t *fifo;                                \
    83                 count_t items;                          \
    84                 index_t head;                           \
    85                 index_t tail;                           \
     83                size_t items;                           \
     84                size_t head;                            \
     85                size_t tail;                            \
    8686        } name = {                                      \
    8787                .fifo = NULL,                           \
  • kernel/generic/include/adt/hash_table.h

    r69e68e3 r98000fb  
    4848         * @return Index into hash table.
    4949         */
    50         index_t (* hash)(unative_t key[]);
     50        size_t (* hash)(unative_t key[]);
    5151       
    5252        /** Hash table item comparison function.
     
    5757         * @return true if the keys match, false otherwise.
    5858         */
    59         bool (*compare)(unative_t key[], count_t keys, link_t *item);
     59        bool (*compare)(unative_t key[], size_t keys, link_t *item);
    6060
    6161        /** Hash table item removal callback.
     
    6969typedef struct {
    7070        link_t *entry;
    71         count_t entries;
    72         count_t max_keys;
     71        size_t entries;
     72        size_t max_keys;
    7373        hash_table_operations_t *op;
    7474} hash_table_t;
     
    7777        list_get_instance((item), type, member)
    7878
    79 extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys,
     79extern void hash_table_create(hash_table_t *h, size_t m, size_t max_keys,
    8080    hash_table_operations_t *op);
    8181extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item);
    8282extern link_t *hash_table_find(hash_table_t *h, unative_t key[]);
    83 extern void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys);
     83extern void hash_table_remove(hash_table_t *h, unative_t key[], size_t keys);
    8484
    8585#endif
  • kernel/generic/include/arch.h

    r69e68e3 r98000fb  
    5757 */
    5858typedef struct {
    59         count_t preemption_disabled;    /**< Preemption disabled counter. */
     59        size_t preemption_disabled;     /**< Preemption disabled counter. */
    6060        thread_t *thread;               /**< Current thread. */
    6161        task_t *task;                   /**< Current task. */
  • kernel/generic/include/config.h

    r69e68e3 r98000fb  
    5151
    5252typedef struct {
    53         count_t cnt;
     53        size_t cnt;
    5454        init_task_t tasks[CONFIG_INIT_TASKS];
    5555} init_t;
     
    6666
    6767typedef struct {
    68         count_t cpu_count;            /**< Number of processors detected. */
    69         volatile count_t cpu_active;  /**< Number of processors that are up and running. */
     68        size_t cpu_count;            /**< Number of processors detected. */
     69        volatile size_t cpu_active;  /**< Number of processors that are up and running. */
    7070       
    7171        uintptr_t base;
  • kernel/generic/include/console/chardev.h

    r69e68e3 r98000fb  
    5858        SPINLOCK_DECLARE(lock);
    5959        wchar_t buffer[INDEV_BUFLEN];
    60         count_t counter;
     60        size_t counter;
    6161       
    6262        /** Implementation of indev operations. */
    6363        indev_operations_t *op;
    64         index_t index;
     64        size_t index;
    6565        void *data;
    6666} indev_t;
  • kernel/generic/include/console/console.h

    r69e68e3 r98000fb  
    5050
    5151extern wchar_t getc(indev_t *indev);
    52 extern count_t gets(indev_t *indev, char *buf, size_t buflen);
     52extern size_t gets(indev_t *indev, char *buf, size_t buflen);
    5353extern unative_t sys_klog(int fd, const void *buf, size_t size);
    5454
  • kernel/generic/include/console/kconsole.h

    r69e68e3 r98000fb  
    7878        int (* func)(cmd_arg_t *);
    7979        /** Number of arguments. */
    80         count_t argc;
     80        size_t argc;
    8181        /** Argument vector. */
    8282        cmd_arg_t *argv;
  • kernel/generic/include/cpu.h

    r69e68e3 r98000fb  
    5252
    5353        tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN];
    54         count_t tlb_messages_count;
     54        size_t tlb_messages_count;
    5555       
    5656        context_t saved_context;
     
    5858        atomic_t nrdy;
    5959        runq_t rq[RQ_COUNT];
    60         volatile count_t needs_relink;
     60        volatile size_t needs_relink;
    6161
    6262        SPINLOCK_DECLARE(timeoutlock);
    6363        link_t timeout_active_head;
    6464
    65         count_t missed_clock_ticks;     /**< When system clock loses a tick, it is recorded here
     65        size_t missed_clock_ticks;      /**< When system clock loses a tick, it is recorded here
    6666                                             so that clock() can react. This variable is
    6767                                             CPU-local and can be only accessed when interrupts
  • kernel/generic/include/ddi/irq.h

    r69e68e3 r98000fb  
    105105        irq_code_t *code;
    106106        /** Counter. */
    107         count_t counter;
     107        size_t counter;
    108108        /**
    109109         * Link between IRQs that are notifying the same answerbox. The list is
     
    163163extern hash_table_t irq_uspace_hash_table;
    164164
    165 extern void irq_init(count_t, count_t);
     165extern void irq_init(size_t, size_t);
    166166extern void irq_initialize(irq_t *);
    167167extern void irq_register(irq_t *);
  • kernel/generic/include/ipc/event.h

    r69e68e3 r98000fb  
    5050        unative_t method;
    5151        /** Counter. */
    52         count_t counter;
     52        size_t counter;
    5353} event_t;
    5454
  • kernel/generic/include/mm/as.h

    r69e68e3 r98000fb  
    9595         * Protected by asidlock.
    9696         */
    97         count_t cpu_refcount;
     97        size_t cpu_refcount;
    9898        /**
    9999         * Address space identifier.
     
    133133        mutex_t lock;           
    134134        /** This structure can be deallocated if refcount drops to 0. */
    135         count_t refcount;
     135        size_t refcount;
    136136        /**
    137137         * B+tree containing complete map of anonymous pages of the shared area.
     
    157157        struct {        /**< phys_backend members */
    158158                uintptr_t base;
    159                 count_t frames;
     159                size_t frames;
    160160        };
    161161} mem_backend_data_t;
     
    176176        int attributes;
    177177        /** Size of this area in multiples of PAGE_SIZE. */
    178         count_t pages;
     178        size_t pages;
    179179        /** Base address of this area. */
    180180        uintptr_t base;
     
    226226extern bool as_area_check_access(as_area_t *area, pf_access_t access);
    227227extern size_t as_area_get_size(uintptr_t base);
    228 extern int used_space_insert(as_area_t *a, uintptr_t page, count_t count);
    229 extern int used_space_remove(as_area_t *a, uintptr_t page, count_t count);
     228extern int used_space_insert(as_area_t *a, uintptr_t page, size_t count);
     229extern int used_space_remove(as_area_t *a, uintptr_t page, size_t count);
    230230
    231231
  • kernel/generic/include/mm/frame.h

    r69e68e3 r98000fb  
    8181
    8282typedef struct {
    83         count_t refcount;     /**< Tracking of shared frames */
     83        size_t refcount;     /**< Tracking of shared frames */
    8484        uint8_t buddy_order;  /**< Buddy system block order */
    8585        link_t buddy_link;    /**< Link to the next free block inside
     
    9191        pfn_t base;                    /**< Frame_no of the first frame
    9292                                        in the frames array */
    93         count_t count;                 /**< Size of zone */
    94         count_t free_count;            /**< Number of free frame_t
     93        size_t count;                 /**< Size of zone */
     94        size_t free_count;            /**< Number of free frame_t
    9595                                        structures */
    96         count_t busy_count;            /**< Number of busy frame_t
     96        size_t busy_count;            /**< Number of busy frame_t
    9797                                        structures */
    9898        zone_flags_t flags;            /**< Type of the zone */
     
    109109typedef struct {
    110110        SPINLOCK_DECLARE(lock);
    111         count_t count;
     111        size_t count;
    112112        zone_t info[ZONES_MAX];
    113113} zones_t;
     
    125125}
    126126
    127 static inline count_t SIZE2FRAMES(size_t size)
     127static inline size_t SIZE2FRAMES(size_t size)
    128128{
    129129        if (!size)
    130130                return 0;
    131         return (count_t) ((size - 1) >> FRAME_WIDTH) + 1;
     131        return (size_t) ((size - 1) >> FRAME_WIDTH) + 1;
    132132}
    133133
    134 static inline size_t FRAMES2SIZE(count_t frames)
     134static inline size_t FRAMES2SIZE(size_t frames)
    135135{
    136136        return (size_t) (frames << FRAME_WIDTH);
     
    157157
    158158extern void frame_init(void);
    159 extern void *frame_alloc_generic(uint8_t, frame_flags_t, count_t *);
     159extern void *frame_alloc_generic(uint8_t, frame_flags_t, size_t *);
    160160extern void frame_free(uintptr_t);
    161161extern void frame_reference_add(pfn_t);
    162162
    163 extern count_t find_zone(pfn_t frame, count_t count, count_t hint);
    164 extern count_t zone_create(pfn_t, count_t, pfn_t, zone_flags_t);
    165 extern void *frame_get_parent(pfn_t, count_t);
    166 extern void frame_set_parent(pfn_t, void *, count_t);
    167 extern void frame_mark_unavailable(pfn_t, count_t);
    168 extern uintptr_t zone_conf_size(count_t);
    169 extern bool zone_merge(count_t, count_t);
     163extern size_t find_zone(pfn_t frame, size_t count, size_t hint);
     164extern size_t zone_create(pfn_t, size_t, pfn_t, zone_flags_t);
     165extern void *frame_get_parent(pfn_t, size_t);
     166extern void frame_set_parent(pfn_t, void *, size_t);
     167extern void frame_mark_unavailable(pfn_t, size_t);
     168extern uintptr_t zone_conf_size(size_t);
     169extern bool zone_merge(size_t, size_t);
    170170extern void zone_merge_all(void);
    171171extern uint64_t zone_total_size(void);
     
    175175 */
    176176extern void zone_print_list(void);
    177 extern void zone_print_one(count_t);
     177extern void zone_print_one(size_t);
    178178
    179179#endif
  • kernel/generic/include/mm/slab.h

    r69e68e3 r98000fb  
    7373typedef struct {
    7474        link_t link;
    75         count_t busy;  /**< Count of full slots in magazine */
    76         count_t size;  /**< Number of slots in magazine */
     75        size_t busy;  /**< Count of full slots in magazine */
     76        size_t size;  /**< Number of slots in magazine */
    7777        void *objs[];  /**< Slots in magazine */
    7878} slab_magazine_t;
     
    129129extern void * slab_alloc(slab_cache_t *, int);
    130130extern void slab_free(slab_cache_t *, void *);
    131 extern count_t slab_reclaim(int);
     131extern size_t slab_reclaim(int);
    132132
    133133/* slab subsytem initialization */
  • kernel/generic/include/mm/tlb.h

    r69e68e3 r98000fb  
    6262        asid_t asid;                    /**< Address space identifier. */
    6363        uintptr_t page;                 /**< Page address. */
    64         count_t count;                  /**< Number of pages to invalidate. */
     64        size_t count;                   /**< Number of pages to invalidate. */
    6565} tlb_shootdown_msg_t;
    6666
     
    6969#ifdef CONFIG_SMP
    7070extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
    71     uintptr_t page, count_t count);
     71    uintptr_t page, size_t count);
    7272extern void tlb_shootdown_finalize(void);
    7373extern void tlb_shootdown_ipi_recv(void);
     
    8585extern void tlb_invalidate_all(void);
    8686extern void tlb_invalidate_asid(asid_t asid);
    87 extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt);
     87extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt);
    8888#endif
    8989
  • kernel/generic/include/proc/scheduler.h

    r69e68e3 r98000fb  
    4848        SPINLOCK_DECLARE(lock);
    4949        link_t rq_head;         /**< List of ready threads. */
    50         count_t n;              /**< Number of threads in rq_ready. */
     50        size_t n;               /**< Number of threads in rq_ready. */
    5151} runq_t;
    5252
  • kernel/generic/include/sort.h

    r69e68e3 r98000fb  
    4141 * sorting routines
    4242 */
    43 extern void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b));
    44 extern void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b));
     43extern void bubblesort(void * data, size_t n, size_t e_size, int (* cmp) (void * a, void * b));
     44extern void qsort(void * data, size_t n, size_t e_size, int (* cmp) (void * a, void * b));
    4545
    4646/*
  • kernel/generic/include/string.h

    r69e68e3 r98000fb  
    7272extern size_t wstr_size(const wchar_t *str);
    7373
    74 extern size_t str_lsize(const char *str, count_t max_len);
    75 extern size_t wstr_lsize(const wchar_t *str, count_t max_len);
     74extern size_t str_lsize(const char *str, size_t max_len);
     75extern size_t wstr_lsize(const wchar_t *str, size_t max_len);
    7676
    77 extern count_t str_length(const char *str);
    78 extern count_t wstr_length(const wchar_t *wstr);
     77extern size_t str_length(const char *str);
     78extern size_t wstr_length(const wchar_t *wstr);
    7979
    80 extern count_t str_nlength(const char *str, size_t size);
    81 extern count_t wstr_nlength(const wchar_t *str, size_t size);
     80extern size_t str_nlength(const char *str, size_t size);
     81extern size_t wstr_nlength(const wchar_t *str, size_t size);
    8282
    8383extern bool ascii_check(wchar_t ch);
     
    8585
    8686extern int str_cmp(const char *s1, const char *s2);
    87 extern int str_lcmp(const char *s1, const char *s2, count_t max_len);
     87extern int str_lcmp(const char *s1, const char *s2, size_t max_len);
    8888
    8989extern void str_cpy(char *dest, size_t size, const char *src);
     
    9393extern const char *str_chr(const char *str, wchar_t ch);
    9494
    95 extern bool wstr_linsert(wchar_t *str, wchar_t ch, count_t pos, count_t max_pos);
    96 extern bool wstr_remove(wchar_t *str, count_t pos);
     95extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos);
     96extern bool wstr_remove(wchar_t *str, size_t pos);
    9797
    9898#endif
  • kernel/generic/include/symtab.h

    r69e68e3 r98000fb  
    4949extern int symtab_addr_lookup(const char *name, uintptr_t *addr);
    5050extern void symtab_print_search(const char *name);
    51 extern int symtab_compl(char *input, count_t size);
     51extern int symtab_compl(char *input, size_t size);
    5252
    5353#ifdef CONFIG_SYMTAB
  • kernel/generic/include/synch/futex.h

    r69e68e3 r98000fb  
    5050        link_t ht_link;
    5151        /** Number of tasks that reference this futex. */
    52         count_t refcount;
     52        size_t refcount;
    5353} futex_t;
    5454
  • kernel/generic/include/synch/rwlock.h

    r69e68e3 r98000fb  
    5454        mutex_t exclusive;
    5555        /** Number of readers in critical section. */
    56         count_t readers_in;
     56        size_t readers_in;
    5757} rwlock_t;
    5858
  • kernel/generic/include/synch/spinlock.h

    r69e68e3 r98000fb  
    108108
    109109#define DEADLOCK_THRESHOLD              100000000
    110 #define DEADLOCK_PROBE_INIT(pname)      count_t pname = 0
     110#define DEADLOCK_PROBE_INIT(pname)      size_t pname = 0
    111111#define DEADLOCK_PROBE(pname, value)                                    \
    112112        if ((pname)++ > (value)) {                                      \
Note: See TracChangeset for help on using the changeset viewer.