Changeset 98000fb in mainline for kernel/generic/include
- Timestamp:
- 2009-06-03T19:34:45Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 301ff30
- Parents:
- 69e68e3
- Location:
- kernel/generic/include
- Files:
-
- 23 edited
-
adt/bitmap.h (modified) (1 diff)
-
adt/btree.h (modified) (1 diff)
-
adt/fifo.h (modified) (2 diffs)
-
adt/hash_table.h (modified) (4 diffs)
-
arch.h (modified) (1 diff)
-
config.h (modified) (2 diffs)
-
console/chardev.h (modified) (1 diff)
-
console/console.h (modified) (1 diff)
-
console/kconsole.h (modified) (1 diff)
-
cpu.h (modified) (2 diffs)
-
ddi/irq.h (modified) (2 diffs)
-
ipc/event.h (modified) (1 diff)
-
mm/as.h (modified) (5 diffs)
-
mm/frame.h (modified) (6 diffs)
-
mm/slab.h (modified) (2 diffs)
-
mm/tlb.h (modified) (3 diffs)
-
proc/scheduler.h (modified) (1 diff)
-
sort.h (modified) (1 diff)
-
string.h (modified) (3 diffs)
-
symtab.h (modified) (1 diff)
-
synch/futex.h (modified) (1 diff)
-
synch/rwlock.h (modified) (1 diff)
-
synch/spinlock.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/bitmap.h
r69e68e3 r98000fb 42 42 typedef struct { 43 43 uint8_t *map; 44 count_t bits;44 size_t bits; 45 45 } bitmap_t; 46 46 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);47 extern void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, size_t bits); 48 extern void bitmap_set_range(bitmap_t *bitmap, size_t start, size_t bits); 49 extern void bitmap_clear_range(bitmap_t *bitmap, size_t start, size_t bits); 50 extern void bitmap_copy(bitmap_t *dst, bitmap_t *src, size_t bits); 51 51 52 static inline int bitmap_get(bitmap_t *bitmap, index_t bit)52 static inline int bitmap_get(bitmap_t *bitmap, size_t bit) 53 53 { 54 54 if(bit >= bitmap->bits) 55 55 return 0; 56 56 57 return !! ((bitmap->map)[bit/8] & (1 << (bit & 7))); 57 58 } -
kernel/generic/include/adt/btree.h
r69e68e3 r98000fb 47 47 typedef struct btree_node { 48 48 /** Number of keys. */ 49 count_t keys;49 size_t keys; 50 50 51 51 /** -
kernel/generic/include/adt/fifo.h
r69e68e3 r98000fb 60 60 struct { \ 61 61 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; \ 65 65 } name = { \ 66 66 .items = (itms), \ … … 81 81 struct { \ 82 82 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; \ 86 86 } name = { \ 87 87 .fifo = NULL, \ -
kernel/generic/include/adt/hash_table.h
r69e68e3 r98000fb 48 48 * @return Index into hash table. 49 49 */ 50 index_t (* hash)(unative_t key[]);50 size_t (* hash)(unative_t key[]); 51 51 52 52 /** Hash table item comparison function. … … 57 57 * @return true if the keys match, false otherwise. 58 58 */ 59 bool (*compare)(unative_t key[], count_t keys, link_t *item);59 bool (*compare)(unative_t key[], size_t keys, link_t *item); 60 60 61 61 /** Hash table item removal callback. … … 69 69 typedef struct { 70 70 link_t *entry; 71 count_t entries;72 count_t max_keys;71 size_t entries; 72 size_t max_keys; 73 73 hash_table_operations_t *op; 74 74 } hash_table_t; … … 77 77 list_get_instance((item), type, member) 78 78 79 extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys,79 extern void hash_table_create(hash_table_t *h, size_t m, size_t max_keys, 80 80 hash_table_operations_t *op); 81 81 extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item); 82 82 extern 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);83 extern void hash_table_remove(hash_table_t *h, unative_t key[], size_t keys); 84 84 85 85 #endif -
kernel/generic/include/arch.h
r69e68e3 r98000fb 57 57 */ 58 58 typedef struct { 59 count_t preemption_disabled; /**< Preemption disabled counter. */59 size_t preemption_disabled; /**< Preemption disabled counter. */ 60 60 thread_t *thread; /**< Current thread. */ 61 61 task_t *task; /**< Current task. */ -
kernel/generic/include/config.h
r69e68e3 r98000fb 51 51 52 52 typedef struct { 53 count_t cnt;53 size_t cnt; 54 54 init_task_t tasks[CONFIG_INIT_TASKS]; 55 55 } init_t; … … 66 66 67 67 typedef 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. */ 70 70 71 71 uintptr_t base; -
kernel/generic/include/console/chardev.h
r69e68e3 r98000fb 58 58 SPINLOCK_DECLARE(lock); 59 59 wchar_t buffer[INDEV_BUFLEN]; 60 count_t counter;60 size_t counter; 61 61 62 62 /** Implementation of indev operations. */ 63 63 indev_operations_t *op; 64 index_t index;64 size_t index; 65 65 void *data; 66 66 } indev_t; -
kernel/generic/include/console/console.h
r69e68e3 r98000fb 50 50 51 51 extern wchar_t getc(indev_t *indev); 52 extern count_t gets(indev_t *indev, char *buf, size_t buflen);52 extern size_t gets(indev_t *indev, char *buf, size_t buflen); 53 53 extern unative_t sys_klog(int fd, const void *buf, size_t size); 54 54 -
kernel/generic/include/console/kconsole.h
r69e68e3 r98000fb 78 78 int (* func)(cmd_arg_t *); 79 79 /** Number of arguments. */ 80 count_t argc;80 size_t argc; 81 81 /** Argument vector. */ 82 82 cmd_arg_t *argv; -
kernel/generic/include/cpu.h
r69e68e3 r98000fb 52 52 53 53 tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN]; 54 count_t tlb_messages_count;54 size_t tlb_messages_count; 55 55 56 56 context_t saved_context; … … 58 58 atomic_t nrdy; 59 59 runq_t rq[RQ_COUNT]; 60 volatile count_t needs_relink;60 volatile size_t needs_relink; 61 61 62 62 SPINLOCK_DECLARE(timeoutlock); 63 63 link_t timeout_active_head; 64 64 65 count_t missed_clock_ticks; /**< When system clock loses a tick, it is recorded here65 size_t missed_clock_ticks; /**< When system clock loses a tick, it is recorded here 66 66 so that clock() can react. This variable is 67 67 CPU-local and can be only accessed when interrupts -
kernel/generic/include/ddi/irq.h
r69e68e3 r98000fb 105 105 irq_code_t *code; 106 106 /** Counter. */ 107 count_t counter;107 size_t counter; 108 108 /** 109 109 * Link between IRQs that are notifying the same answerbox. The list is … … 163 163 extern hash_table_t irq_uspace_hash_table; 164 164 165 extern void irq_init( count_t, count_t);165 extern void irq_init(size_t, size_t); 166 166 extern void irq_initialize(irq_t *); 167 167 extern void irq_register(irq_t *); -
kernel/generic/include/ipc/event.h
r69e68e3 r98000fb 50 50 unative_t method; 51 51 /** Counter. */ 52 count_t counter;52 size_t counter; 53 53 } event_t; 54 54 -
kernel/generic/include/mm/as.h
r69e68e3 r98000fb 95 95 * Protected by asidlock. 96 96 */ 97 count_t cpu_refcount;97 size_t cpu_refcount; 98 98 /** 99 99 * Address space identifier. … … 133 133 mutex_t lock; 134 134 /** This structure can be deallocated if refcount drops to 0. */ 135 count_t refcount;135 size_t refcount; 136 136 /** 137 137 * B+tree containing complete map of anonymous pages of the shared area. … … 157 157 struct { /**< phys_backend members */ 158 158 uintptr_t base; 159 count_t frames;159 size_t frames; 160 160 }; 161 161 } mem_backend_data_t; … … 176 176 int attributes; 177 177 /** Size of this area in multiples of PAGE_SIZE. */ 178 count_t pages;178 size_t pages; 179 179 /** Base address of this area. */ 180 180 uintptr_t base; … … 226 226 extern bool as_area_check_access(as_area_t *area, pf_access_t access); 227 227 extern 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);228 extern int used_space_insert(as_area_t *a, uintptr_t page, size_t count); 229 extern int used_space_remove(as_area_t *a, uintptr_t page, size_t count); 230 230 231 231 -
kernel/generic/include/mm/frame.h
r69e68e3 r98000fb 81 81 82 82 typedef struct { 83 count_t refcount; /**< Tracking of shared frames */83 size_t refcount; /**< Tracking of shared frames */ 84 84 uint8_t buddy_order; /**< Buddy system block order */ 85 85 link_t buddy_link; /**< Link to the next free block inside … … 91 91 pfn_t base; /**< Frame_no of the first frame 92 92 in the frames array */ 93 count_t count; /**< Size of zone */94 count_t free_count; /**< Number of free frame_t93 size_t count; /**< Size of zone */ 94 size_t free_count; /**< Number of free frame_t 95 95 structures */ 96 count_t busy_count; /**< Number of busy frame_t96 size_t busy_count; /**< Number of busy frame_t 97 97 structures */ 98 98 zone_flags_t flags; /**< Type of the zone */ … … 109 109 typedef struct { 110 110 SPINLOCK_DECLARE(lock); 111 count_t count;111 size_t count; 112 112 zone_t info[ZONES_MAX]; 113 113 } zones_t; … … 125 125 } 126 126 127 static inline count_t SIZE2FRAMES(size_t size)127 static inline size_t SIZE2FRAMES(size_t size) 128 128 { 129 129 if (!size) 130 130 return 0; 131 return ( count_t) ((size - 1) >> FRAME_WIDTH) + 1;131 return (size_t) ((size - 1) >> FRAME_WIDTH) + 1; 132 132 } 133 133 134 static inline size_t FRAMES2SIZE( count_t frames)134 static inline size_t FRAMES2SIZE(size_t frames) 135 135 { 136 136 return (size_t) (frames << FRAME_WIDTH); … … 157 157 158 158 extern void frame_init(void); 159 extern void *frame_alloc_generic(uint8_t, frame_flags_t, count_t *);159 extern void *frame_alloc_generic(uint8_t, frame_flags_t, size_t *); 160 160 extern void frame_free(uintptr_t); 161 161 extern void frame_reference_add(pfn_t); 162 162 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);163 extern size_t find_zone(pfn_t frame, size_t count, size_t hint); 164 extern size_t zone_create(pfn_t, size_t, pfn_t, zone_flags_t); 165 extern void *frame_get_parent(pfn_t, size_t); 166 extern void frame_set_parent(pfn_t, void *, size_t); 167 extern void frame_mark_unavailable(pfn_t, size_t); 168 extern uintptr_t zone_conf_size(size_t); 169 extern bool zone_merge(size_t, size_t); 170 170 extern void zone_merge_all(void); 171 171 extern uint64_t zone_total_size(void); … … 175 175 */ 176 176 extern void zone_print_list(void); 177 extern void zone_print_one( count_t);177 extern void zone_print_one(size_t); 178 178 179 179 #endif -
kernel/generic/include/mm/slab.h
r69e68e3 r98000fb 73 73 typedef struct { 74 74 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 */ 77 77 void *objs[]; /**< Slots in magazine */ 78 78 } slab_magazine_t; … … 129 129 extern void * slab_alloc(slab_cache_t *, int); 130 130 extern void slab_free(slab_cache_t *, void *); 131 extern count_t slab_reclaim(int);131 extern size_t slab_reclaim(int); 132 132 133 133 /* slab subsytem initialization */ -
kernel/generic/include/mm/tlb.h
r69e68e3 r98000fb 62 62 asid_t asid; /**< Address space identifier. */ 63 63 uintptr_t page; /**< Page address. */ 64 count_t count; /**< Number of pages to invalidate. */64 size_t count; /**< Number of pages to invalidate. */ 65 65 } tlb_shootdown_msg_t; 66 66 … … 69 69 #ifdef CONFIG_SMP 70 70 extern 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); 72 72 extern void tlb_shootdown_finalize(void); 73 73 extern void tlb_shootdown_ipi_recv(void); … … 85 85 extern void tlb_invalidate_all(void); 86 86 extern void tlb_invalidate_asid(asid_t asid); 87 extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt);87 extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt); 88 88 #endif 89 89 -
kernel/generic/include/proc/scheduler.h
r69e68e3 r98000fb 48 48 SPINLOCK_DECLARE(lock); 49 49 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. */ 51 51 } runq_t; 52 52 -
kernel/generic/include/sort.h
r69e68e3 r98000fb 41 41 * sorting routines 42 42 */ 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));43 extern void bubblesort(void * data, size_t n, size_t e_size, int (* cmp) (void * a, void * b)); 44 extern void qsort(void * data, size_t n, size_t e_size, int (* cmp) (void * a, void * b)); 45 45 46 46 /* -
kernel/generic/include/string.h
r69e68e3 r98000fb 72 72 extern size_t wstr_size(const wchar_t *str); 73 73 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);74 extern size_t str_lsize(const char *str, size_t max_len); 75 extern size_t wstr_lsize(const wchar_t *str, size_t max_len); 76 76 77 extern count_t str_length(const char *str);78 extern count_t wstr_length(const wchar_t *wstr);77 extern size_t str_length(const char *str); 78 extern size_t wstr_length(const wchar_t *wstr); 79 79 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);80 extern size_t str_nlength(const char *str, size_t size); 81 extern size_t wstr_nlength(const wchar_t *str, size_t size); 82 82 83 83 extern bool ascii_check(wchar_t ch); … … 85 85 86 86 extern int str_cmp(const char *s1, const char *s2); 87 extern int str_lcmp(const char *s1, const char *s2, count_t max_len);87 extern int str_lcmp(const char *s1, const char *s2, size_t max_len); 88 88 89 89 extern void str_cpy(char *dest, size_t size, const char *src); … … 93 93 extern const char *str_chr(const char *str, wchar_t ch); 94 94 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);95 extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos); 96 extern bool wstr_remove(wchar_t *str, size_t pos); 97 97 98 98 #endif -
kernel/generic/include/symtab.h
r69e68e3 r98000fb 49 49 extern int symtab_addr_lookup(const char *name, uintptr_t *addr); 50 50 extern void symtab_print_search(const char *name); 51 extern int symtab_compl(char *input, count_t size);51 extern int symtab_compl(char *input, size_t size); 52 52 53 53 #ifdef CONFIG_SYMTAB -
kernel/generic/include/synch/futex.h
r69e68e3 r98000fb 50 50 link_t ht_link; 51 51 /** Number of tasks that reference this futex. */ 52 count_t refcount;52 size_t refcount; 53 53 } futex_t; 54 54 -
kernel/generic/include/synch/rwlock.h
r69e68e3 r98000fb 54 54 mutex_t exclusive; 55 55 /** Number of readers in critical section. */ 56 count_t readers_in;56 size_t readers_in; 57 57 } rwlock_t; 58 58 -
kernel/generic/include/synch/spinlock.h
r69e68e3 r98000fb 108 108 109 109 #define DEADLOCK_THRESHOLD 100000000 110 #define DEADLOCK_PROBE_INIT(pname) count_t pname = 0110 #define DEADLOCK_PROBE_INIT(pname) size_t pname = 0 111 111 #define DEADLOCK_PROBE(pname, value) \ 112 112 if ((pname)++ > (value)) { \
Note:
See TracChangeset
for help on using the changeset viewer.
