Changeset 7f1c620 in mainline for generic/include
- Timestamp:
- 2006-07-04T17:17:56Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- Location:
- generic/include
- Files:
-
- 44 edited
-
adt/bitmap.h (modified) (1 diff)
-
adt/btree.h (modified) (1 diff)
-
adt/hash_table.h (modified) (3 diffs)
-
adt/list.h (modified) (1 diff)
-
bitops.h (modified) (2 diffs)
-
byteorder.h (modified) (2 diffs)
-
config.h (modified) (2 diffs)
-
console/chardev.h (modified) (2 diffs)
-
console/console.h (modified) (1 diff)
-
console/kconsole.h (modified) (1 diff)
-
context.h (modified) (1 diff)
-
cpu.h (modified) (2 diffs)
-
ddi/ddi.h (modified) (1 diff)
-
debug.h (modified) (2 diffs)
-
elf.h (modified) (5 diffs)
-
func.h (modified) (1 diff)
-
ipc/ipc.h (modified) (4 diffs)
-
ipc/ipcrsc.h (modified) (1 diff)
-
ipc/irq.h (modified) (1 diff)
-
ipc/sysipc.h (modified) (1 diff)
-
macros.h (modified) (1 diff)
-
memstr.h (modified) (1 diff)
-
mm/as.h (modified) (5 diffs)
-
mm/buddy.h (modified) (2 diffs)
-
mm/frame.h (modified) (4 diffs)
-
mm/page.h (modified) (2 diffs)
-
mm/slab.h (modified) (1 diff)
-
mm/tlb.h (modified) (3 diffs)
-
proc/task.h (modified) (1 diff)
-
proc/thread.h (modified) (3 diffs)
-
security/cap.h (modified) (1 diff)
-
sort.h (modified) (1 diff)
-
stackarg.h (modified) (1 diff)
-
symtab.h (modified) (1 diff)
-
synch/condvar.h (modified) (1 diff)
-
synch/futex.h (modified) (4 diffs)
-
synch/mutex.h (modified) (1 diff)
-
synch/rwlock.h (modified) (1 diff)
-
synch/semaphore.h (modified) (1 diff)
-
synch/waitq.h (modified) (1 diff)
-
syscall/syscall.h (modified) (1 diff)
-
sysinfo/sysinfo.h (modified) (4 diffs)
-
time/delay.h (modified) (1 diff)
-
time/timeout.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
generic/include/adt/bitmap.h
r991779c5 r7f1c620 42 42 43 43 typedef struct { 44 __u8*map;44 uint8_t *map; 45 45 count_t bits; 46 46 } bitmap_t; 47 47 48 extern void bitmap_initialize(bitmap_t *bitmap, __u8*map, count_t bits);48 extern void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, count_t bits); 49 49 extern void bitmap_set_range(bitmap_t *bitmap, index_t start, count_t bits); 50 50 extern void bitmap_clear_range(bitmap_t *bitmap, index_t start, count_t bits); -
generic/include/adt/btree.h
r991779c5 r7f1c620 43 43 #define BTREE_MAX_KEYS (BTREE_M - 1) 44 44 45 typedef __u64btree_key_t;45 typedef uint64_t btree_key_t; 46 46 47 47 /** B-tree node structure. */ -
generic/include/adt/hash_table.h
r991779c5 r7f1c620 56 56 * @return Index into hash table. 57 57 */ 58 index_t (* hash)( __nativekey[]);58 index_t (* hash)(unative_t key[]); 59 59 60 60 /** Hash table item comparison function. … … 64 64 * @return true if the keys match, false otherwise. 65 65 */ 66 bool (*compare)( __nativekey[], count_t keys, link_t *item);66 bool (*compare)(unative_t key[], count_t keys, link_t *item); 67 67 68 68 /** Hash table item removal callback. … … 76 76 77 77 extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op); 78 extern void hash_table_insert(hash_table_t *h, __nativekey[], link_t *item);79 extern link_t *hash_table_find(hash_table_t *h, __nativekey[]);80 extern void hash_table_remove(hash_table_t *h, __nativekey[], count_t keys);78 extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item); 79 extern link_t *hash_table_find(hash_table_t *h, unative_t key[]); 80 extern void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys); 81 81 82 82 #endif -
generic/include/adt/list.h
r991779c5 r7f1c620 176 176 } 177 177 178 #define list_get_instance(link,type,member) (type *)((( __u8*)(link))-((__u8*)&(((type *)NULL)->member)))178 #define list_get_instance(link,type,member) (type *)(((uint8_t*)(link))-((uint8_t*)&(((type *)NULL)->member))) 179 179 180 180 extern bool list_member(const link_t *link, const link_t *head); -
generic/include/bitops.h
r991779c5 r7f1c620 43 43 * If number is zero, it returns 0 44 44 */ 45 static inline int fnzb32( __u32arg)45 static inline int fnzb32(uint32_t arg) 46 46 { 47 47 int n = 0; … … 55 55 } 56 56 57 static inline int fnzb64( __u64arg)57 static inline int fnzb64(uint64_t arg) 58 58 { 59 59 int n = 0; 60 60 61 61 if (arg >> 32) { arg >>= 32;n += 32;} 62 return n + fnzb32(( __u32) arg);62 return n + fnzb32((uint32_t) arg); 63 63 } 64 64 -
generic/include/byteorder.h
r991779c5 r7f1c620 36 36 #define __BYTEORDER_H__ 37 37 38 static inline __u64 __u64_byteorder_swap(__u64n)38 static inline uint64_t uint64_t_byteorder_swap(uint64_t n) 39 39 { 40 40 return ((n & 0xff) << 56) | … … 48 48 } 49 49 50 static inline __u32 __u32_byteorder_swap(__u32n)50 static inline uint32_t uint32_t_byteorder_swap(uint32_t n) 51 51 { 52 52 return ((n & 0xff) << 24) | -
generic/include/config.h
r991779c5 r7f1c620 47 47 48 48 typedef struct { 49 __addressaddr;49 uintptr_t addr; 50 50 size_t size; 51 51 } init_task_t; … … 60 60 volatile count_t cpu_active; /**< Number of processors that are up and running. */ 61 61 62 __addressbase;62 uintptr_t base; 63 63 size_t memory_size; /**< Size of detected memory in bytes. */ 64 64 size_t kernel_size; /**< Size of memory in bytes taken by kernel and stack */ -
generic/include/console/chardev.h
r991779c5 r7f1c620 60 60 waitq_t wq; 61 61 SPINLOCK_DECLARE(lock); /**< Protects everything below. */ 62 __u8buffer[CHARDEV_BUFLEN];62 uint8_t buffer[CHARDEV_BUFLEN]; 63 63 count_t counter; 64 64 chardev_operations_t *op; /**< Implementation of chardev operations. */ … … 70 70 chardev_t *chardev, 71 71 chardev_operations_t *op); 72 extern void chardev_push_character(chardev_t *chardev, __u8ch);72 extern void chardev_push_character(chardev_t *chardev, uint8_t ch); 73 73 74 74 #endif /* __CHARDEV_H__ */ -
generic/include/console/console.h
r991779c5 r7f1c620 42 42 extern chardev_t *stdout; 43 43 44 extern __u8getc(chardev_t *chardev);45 __u8_getc(chardev_t *chardev);44 extern uint8_t getc(chardev_t *chardev); 45 uint8_t _getc(chardev_t *chardev); 46 46 extern count_t gets(chardev_t *chardev, char *buf, size_t buflen); 47 47 extern void putchar(char c); -
generic/include/console/kconsole.h
r991779c5 r7f1c620 55 55 void *buffer; /**< Buffer where to store data. */ 56 56 size_t len; /**< Size of the buffer. */ 57 __nativeintval; /**< Integer value */57 unative_t intval; /**< Integer value */ 58 58 cmd_arg_type_t vartype; /**< Resulting type of variable arg */ 59 59 }; -
generic/include/context.h
r991779c5 r7f1c620 43 43 #ifndef context_set 44 44 #define context_set(c, _pc, stack, size) \ 45 (c)->pc = ( __address) (_pc); \46 (c)->sp = (( __address) (stack)) + (size) - SP_DELTA;45 (c)->pc = (uintptr_t) (_pc); \ 46 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; 47 47 #endif /* context_set */ 48 48 -
generic/include/cpu.h
r991779c5 r7f1c620 81 81 int tlb_active; 82 82 83 __u16frequency_mhz;84 __u32delay_loop_const;83 uint16_t frequency_mhz; 84 uint32_t delay_loop_const; 85 85 86 86 cpu_arch_t arch; … … 91 91 * Stack used by scheduler when there is no running thread. 92 92 */ 93 __u8*stack;93 uint8_t *stack; 94 94 }; 95 95 -
generic/include/ddi/ddi.h
r991779c5 r7f1c620 40 40 #include <typedefs.h> 41 41 42 __native sys_physmem_map(__native phys_base, __native virt_base, __nativepages,43 __nativeflags);44 extern __nativesys_iospace_enable(ddi_ioarg_t *uspace_io_arg);45 extern __nativesys_preempt_control(int enable);42 unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base, unative_t pages, 43 unative_t flags); 44 extern unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg); 45 extern unative_t sys_preempt_control(int enable); 46 46 47 47 /* 48 48 * Interface to be implemented by all architectures. 49 49 */ 50 extern int ddi_iospace_enable_arch(task_t *task, __addressioaddr, size_t size);50 extern int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size); 51 51 52 52 #endif -
generic/include/debug.h
r991779c5 r7f1c620 39 39 #include <arch/debug.h> 40 40 41 #define CALLER (( __address)__builtin_return_address(0))41 #define CALLER ((uintptr_t)__builtin_return_address(0)) 42 42 43 43 #ifndef HERE 44 44 /** Current Instruction Pointer address */ 45 # define HERE (( __address*)0)45 # define HERE ((uintptr_t *)0) 46 46 #endif 47 47 … … 56 56 */ 57 57 #ifdef CONFIG_DEBUG 58 # define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%.*p\n", #expr, sizeof( __address) * 2, CALLER); }58 # define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%.*p\n", #expr, sizeof(uintptr_t) * 2, CALLER); } 59 59 #else 60 60 # define ASSERT(expr) -
generic/include/elf.h
r991779c5 r7f1c620 194 194 * in ELF header. 195 195 */ 196 typedef __u64elf_xword;197 typedef __s64elf_sxword;198 typedef __u32elf_word;199 typedef __s32elf_sword;200 typedef __u16elf_half;196 typedef uint64_t elf_xword; 197 typedef int64_t elf_sxword; 198 typedef uint32_t elf_word; 199 typedef int32_t elf_sword; 200 typedef uint16_t elf_half; 201 201 202 202 /** … … 205 205 * These types are specific for 32-bit format. 206 206 */ 207 typedef __u32elf32_addr;208 typedef __u32elf32_off;207 typedef uint32_t elf32_addr; 208 typedef uint32_t elf32_off; 209 209 210 210 /** … … 213 213 * These types are specific for 64-bit format. 214 214 */ 215 typedef __u64elf64_addr;216 typedef __u64elf64_off;215 typedef uint64_t elf64_addr; 216 typedef uint64_t elf64_off; 217 217 218 218 /** ELF header */ 219 219 struct elf32_header { 220 __u8e_ident[EI_NIDENT];220 uint8_t e_ident[EI_NIDENT]; 221 221 elf_half e_type; 222 222 elf_half e_machine; … … 234 234 }; 235 235 struct elf64_header { 236 __u8e_ident[EI_NIDENT];236 uint8_t e_ident[EI_NIDENT]; 237 237 elf_half e_type; 238 238 elf_half e_machine; … … 310 310 elf32_addr st_value; 311 311 elf_word st_size; 312 __u8st_info;313 __u8st_other;312 uint8_t st_info; 313 uint8_t st_other; 314 314 elf_half st_shndx; 315 315 }; 316 316 struct elf64_symbol { 317 317 elf_word st_name; 318 __u8st_info;319 __u8st_other;318 uint8_t st_info; 319 uint8_t st_other; 320 320 elf_half st_shndx; 321 321 elf64_addr st_value; -
generic/include/func.h
r991779c5 r7f1c620 47 47 extern int strncmp(const char *src, const char *dst, size_t len); 48 48 extern void strncpy(char *dest, const char *src, size_t len); 49 extern __nativeatoi(const char *text);49 extern unative_t atoi(const char *text); 50 50 51 51 #endif -
generic/include/ipc/ipc.h
r991779c5 r7f1c620 165 165 typedef struct phone_s phone_t; 166 166 typedef struct { 167 __nativeargs[IPC_CALL_LEN];167 unative_t args[IPC_CALL_LEN]; 168 168 phone_t *phone; 169 169 }ipc_data_t; … … 215 215 answerbox_t *callerbox; 216 216 217 __nativeprivate; /**< Private data to internal IPC */217 unative_t private; /**< Private data to internal IPC */ 218 218 219 219 ipc_data_t data; /**< Data passed from/to userspace */ … … 221 221 222 222 extern void ipc_init(void); 223 extern call_t * ipc_wait_for_call(answerbox_t *box, __u32usec, int flags);223 extern call_t * ipc_wait_for_call(answerbox_t *box, uint32_t usec, int flags); 224 224 extern void ipc_answer(answerbox_t *box, call_t *request); 225 225 extern int ipc_call(phone_t *phone, call_t *call); … … 235 235 void ipc_cleanup(void); 236 236 int ipc_phone_hangup(phone_t *phone); 237 extern void ipc_backsend_err(phone_t *phone, call_t *call, __nativeerr);237 extern void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err); 238 238 extern void ipc_print_task(task_id_t taskid); 239 239 -
generic/include/ipc/ipcrsc.h
r991779c5 r7f1c620 36 36 #define __IPCRSC_H__ 37 37 38 call_t * get_call( __nativecallid);38 call_t * get_call(unative_t callid); 39 39 int phone_alloc(void); 40 40 void phone_connect(int phoneid, answerbox_t *box); -
generic/include/ipc/irq.h
r991779c5 r7f1c620 80 80 extern int ipc_irq_register(answerbox_t *box, int irq, irq_code_t *ucode); 81 81 extern void ipc_irq_send_notif(int irq); 82 extern void ipc_irq_send_msg(int irq, __native a1, __native a2, __nativea3);82 extern void ipc_irq_send_msg(int irq, unative_t a1, unative_t a2, unative_t a3); 83 83 extern void ipc_irq_unregister(answerbox_t *box, int irq); 84 extern void irq_ipc_bind_arch( __nativeirq);84 extern void irq_ipc_bind_arch(unative_t irq); 85 85 extern void ipc_irq_cleanup(answerbox_t *box); 86 86 -
generic/include/ipc/sysipc.h
r991779c5 r7f1c620 40 40 #include <arch/types.h> 41 41 42 __native sys_ipc_call_sync_fast(__native phoneid, __nativemethod,43 __nativearg1, ipc_data_t *data);44 __native sys_ipc_call_sync(__nativephoneid, ipc_data_t *question,42 unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, 43 unative_t arg1, ipc_data_t *data); 44 unative_t sys_ipc_call_sync(unative_t phoneid, ipc_data_t *question, 45 45 ipc_data_t *reply); 46 __native sys_ipc_call_async_fast(__native phoneid, __nativemethod,47 __native arg1, __nativearg2);48 __native sys_ipc_call_async(__nativephoneid, ipc_data_t *data);49 __native sys_ipc_answer_fast(__native callid, __nativeretval,50 __native arg1, __nativearg2);51 __native sys_ipc_answer(__nativecallid, ipc_data_t *data);52 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32usec, int nonblocking);53 __native sys_ipc_forward_fast(__native callid, __nativephoneid,54 __native method, __nativearg1);55 __nativesys_ipc_hangup(int phoneid);56 __nativesys_ipc_register_irq(int irq, irq_code_t *ucode);57 __nativesys_ipc_unregister_irq(int irq);46 unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, 47 unative_t arg1, unative_t arg2); 48 unative_t sys_ipc_call_async(unative_t phoneid, ipc_data_t *data); 49 unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, 50 unative_t arg1, unative_t arg2); 51 unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data); 52 unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int nonblocking); 53 unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, 54 unative_t method, unative_t arg1); 55 unative_t sys_ipc_hangup(int phoneid); 56 unative_t sys_ipc_register_irq(int irq, irq_code_t *ucode); 57 unative_t sys_ipc_unregister_irq(int irq); 58 58 59 59 #endif -
generic/include/macros.h
r991779c5 r7f1c620 47 47 48 48 /** Return true if the interlvals overlap. */ 49 static inline int overlaps( __address s1, size_t sz1, __addresss2, size_t sz2)49 static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2) 50 50 { 51 __addresse1 = s1+sz1;52 __addresse2 = s2+sz2;51 uintptr_t e1 = s1+sz1; 52 uintptr_t e2 = s2+sz2; 53 53 54 54 return s1 < e2 && s2 < e1; -
generic/include/memstr.h
r991779c5 r7f1c620 44 44 */ 45 45 extern void *_memcpy(void *dst, const void *src, size_t cnt); 46 extern void _memsetb( __address dst, size_t cnt, __u8x);47 extern void _memsetw( __address dst, size_t cnt, __u16x);46 extern void _memsetb(uintptr_t dst, size_t cnt, uint8_t x); 47 extern void _memsetw(uintptr_t dst, size_t cnt, uint16_t x); 48 48 49 49 #endif -
generic/include/mm/as.h
r991779c5 r7f1c620 124 124 /** Address space area backend structure. */ 125 125 typedef struct { 126 int (* page_fault)(as_area_t *area, __addressaddr, pf_access_t access);127 void (* frame_free)(as_area_t *area, __address page, __addressframe);126 int (* page_fault)(as_area_t *area, uintptr_t addr, pf_access_t access); 127 void (* frame_free)(as_area_t *area, uintptr_t page, uintptr_t frame); 128 128 void (* share)(as_area_t *area); 129 129 } mem_backend_t; … … 136 136 }; 137 137 struct { /**< phys_backend members */ 138 __addressbase;138 uintptr_t base; 139 139 count_t frames; 140 140 }; … … 152 152 int attributes; /**< Attributes related to the address space area itself. */ 153 153 count_t pages; /**< Size of this area in multiples of PAGE_SIZE. */ 154 __addressbase; /**< Base address of this area. */154 uintptr_t base; /**< Base address of this area. */ 155 155 btree_t used_space; /**< Map of used space. */ 156 156 share_info_t *sh_info; /**< If the address space area has been shared, this pointer will … … 173 173 extern void as_destroy(as_t *as); 174 174 extern void as_switch(as_t *old, as_t *new); 175 extern int as_page_fault( __addresspage, pf_access_t access, istate_t *istate);176 177 extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __addressbase, int attrs,175 extern int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate); 176 177 extern as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs, 178 178 mem_backend_t *backend, mem_backend_data_t *backend_data); 179 extern int as_area_destroy(as_t *as, __addressaddress);180 extern int as_area_resize(as_t *as, __addressaddress, size_t size, int flags);181 int as_area_share(as_t *src_as, __addresssrc_base, size_t acc_size,182 as_t *dst_as, __addressdst_base, int dst_flags_mask);179 extern int as_area_destroy(as_t *as, uintptr_t address); 180 extern int as_area_resize(as_t *as, uintptr_t address, size_t size, int flags); 181 int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size, 182 as_t *dst_as, uintptr_t dst_base, int dst_flags_mask); 183 183 184 184 extern int as_area_get_flags(as_area_t *area); 185 185 extern bool as_area_check_access(as_area_t *area, pf_access_t access); 186 extern size_t as_get_size( __addressbase);187 extern int used_space_insert(as_area_t *a, __addresspage, count_t count);188 extern int used_space_remove(as_area_t *a, __addresspage, count_t count);186 extern size_t as_get_size(uintptr_t base); 187 extern int used_space_insert(as_area_t *a, uintptr_t page, count_t count); 188 extern int used_space_remove(as_area_t *a, uintptr_t page, count_t count); 189 189 190 190 /* Interface to be implemented by architectures. */ … … 199 199 200 200 /* Address space area related syscalls. */ 201 extern __native sys_as_area_create(__addressaddress, size_t size, int flags);202 extern __native sys_as_area_resize(__addressaddress, size_t size, int flags);203 extern __native sys_as_area_destroy(__addressaddress);201 extern unative_t sys_as_area_create(uintptr_t address, size_t size, int flags); 202 extern unative_t sys_as_area_resize(uintptr_t address, size_t size, int flags); 203 extern unative_t sys_as_area_destroy(uintptr_t address); 204 204 205 205 #endif /* KERNEL */ -
generic/include/mm/buddy.h
r991779c5 r7f1c620 46 46 link_t *(* bisect)(buddy_system_t *, link_t *); /**< Bisect the block passed as argument and return pointer to the new right-side buddy. */ 47 47 link_t *(* coalesce)(buddy_system_t *, link_t *, link_t *); /**< Coalesce two buddies into a bigger block. */ 48 void (*set_order)(buddy_system_t *, link_t *, __u8); /**< Set order of block passed as argument. */49 __u8(*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */48 void (*set_order)(buddy_system_t *, link_t *, uint8_t); /**< Set order of block passed as argument. */ 49 uint8_t (*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */ 50 50 void (*mark_busy)(buddy_system_t *, link_t *); /**< Mark block as busy. */ 51 51 void (*mark_available)(buddy_system_t *, link_t *); /**< Mark block as available. */ 52 52 /** Find parent of block that has given order */ 53 link_t *(* find_block)(buddy_system_t *, link_t *, __u8);53 link_t *(* find_block)(buddy_system_t *, link_t *, uint8_t); 54 54 void (* print_id)(buddy_system_t *, link_t *); 55 55 }; 56 56 57 57 struct buddy_system { 58 __u8max_order; /**< Maximal order of block which can be stored by buddy system. */58 uint8_t max_order; /**< Maximal order of block which can be stored by buddy system. */ 59 59 link_t *order; 60 60 buddy_system_operations_t *op; … … 63 63 64 64 extern void buddy_system_create(buddy_system_t *b, 65 __u8max_order,65 uint8_t max_order, 66 66 buddy_system_operations_t *op, void *data); 67 extern link_t *buddy_system_alloc(buddy_system_t *b, __u8i);68 extern bool buddy_system_can_alloc(buddy_system_t *b, __u8order);67 extern link_t *buddy_system_alloc(buddy_system_t *b, uint8_t i); 68 extern bool buddy_system_can_alloc(buddy_system_t *b, uint8_t order); 69 69 extern void buddy_system_free(buddy_system_t *b, link_t *block); 70 70 extern void buddy_system_structure_print(buddy_system_t *b, size_t elem_size); -
generic/include/mm/frame.h
r991779c5 r7f1c620 66 66 #define FRAME_ERROR 2 /* frame_alloc return status */ 67 67 68 static inline __addressPFN2ADDR(pfn_t frame)68 static inline uintptr_t PFN2ADDR(pfn_t frame) 69 69 { 70 return ( __address)(frame << FRAME_WIDTH);70 return (uintptr_t)(frame << FRAME_WIDTH); 71 71 } 72 72 73 static inline pfn_t ADDR2PFN( __addressaddr)73 static inline pfn_t ADDR2PFN(uintptr_t addr) 74 74 { 75 75 return (pfn_t)(addr >> FRAME_WIDTH); … … 83 83 } 84 84 85 #define IS_BUDDY_ORDER_OK(index, order) ((~((( __native) -1) << (order)) & (index)) == 0)85 #define IS_BUDDY_ORDER_OK(index, order) ((~(((unative_t) -1) << (order)) & (index)) == 0) 86 86 #define IS_BUDDY_LEFT_BLOCK(zone, frame) (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) 87 87 #define IS_BUDDY_RIGHT_BLOCK(zone, frame) (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1) … … 92 92 93 93 extern void frame_init(void); 94 extern void * frame_alloc_generic( __u8order, int flags, int *pzone);95 extern void frame_free( __addressframe);94 extern void * frame_alloc_generic(uint8_t order, int flags, int *pzone); 95 extern void frame_free(uintptr_t frame); 96 96 extern void frame_reference_add(pfn_t pfn); 97 97 … … 100 100 void frame_set_parent(pfn_t frame, void *data, int hint); 101 101 void frame_mark_unavailable(pfn_t start, count_t count); 102 __addresszone_conf_size(count_t count);102 uintptr_t zone_conf_size(count_t count); 103 103 void zone_merge(int z1, int z2); 104 104 void zone_merge_all(void); -
generic/include/mm/page.h
r991779c5 r7f1c620 77 77 /** Operations to manipulate page mappings. */ 78 78 struct page_mapping_operations { 79 void (* mapping_insert)(as_t *as, __address page, __addressframe, int flags);80 void (* mapping_remove)(as_t *as, __addresspage);81 pte_t *(* mapping_find)(as_t *as, __addresspage);79 void (* mapping_insert)(as_t *as, uintptr_t page, uintptr_t frame, int flags); 80 void (* mapping_remove)(as_t *as, uintptr_t page); 81 pte_t *(* mapping_find)(as_t *as, uintptr_t page); 82 82 }; 83 83 typedef struct page_mapping_operations page_mapping_operations_t; … … 88 88 extern void page_table_lock(as_t *as, bool lock); 89 89 extern void page_table_unlock(as_t *as, bool unlock); 90 extern void page_mapping_insert(as_t *as, __address page, __addressframe, int flags);91 extern void page_mapping_remove(as_t *as, __addresspage);92 extern pte_t *page_mapping_find(as_t *as, __addresspage);90 extern void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags); 91 extern void page_mapping_remove(as_t *as, uintptr_t page); 92 extern pte_t *page_mapping_find(as_t *as, uintptr_t page); 93 93 extern pte_t *page_table_create(int flags); 94 94 extern void page_table_destroy(pte_t *page_table); 95 extern void map_structure( __addresss, size_t size);96 extern __address hw_map(__addressphysaddr, size_t size);95 extern void map_structure(uintptr_t s, size_t size); 96 extern uintptr_t hw_map(uintptr_t physaddr, size_t size); 97 97 98 98 #endif -
generic/include/mm/slab.h
r991779c5 r7f1c620 91 91 92 92 /* Computed values */ 93 __u8order; /**< Order of frames to be allocated */93 uint8_t order; /**< Order of frames to be allocated */ 94 94 int objects; /**< Number of objects that fit in */ 95 95 -
generic/include/mm/tlb.h
r991779c5 r7f1c620 59 59 tlb_invalidate_type_t type; /**< Message type. */ 60 60 asid_t asid; /**< Address space identifier. */ 61 __addresspage; /**< Page address. */61 uintptr_t page; /**< Page address. */ 62 62 count_t count; /**< Number of pages to invalidate. */ 63 63 }; … … 67 67 68 68 #ifdef CONFIG_SMP 69 extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, __addresspage, count_t count);69 extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count); 70 70 extern void tlb_shootdown_finalize(void); 71 71 extern void tlb_shootdown_ipi_recv(void); … … 84 84 extern void tlb_invalidate_all(void); 85 85 extern void tlb_invalidate_asid(asid_t asid); 86 extern void tlb_invalidate_pages(asid_t asid, __addresspage, count_t cnt);86 extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt); 87 87 #endif 88 88 -
generic/include/proc/task.h
r991779c5 r7f1c620 103 103 #endif 104 104 105 extern __nativesys_task_get_id(task_id_t *uspace_task_id);105 extern unative_t sys_task_get_id(task_id_t *uspace_task_id); 106 106 107 107 #endif -
generic/include/proc/thread.h
r991779c5 r7f1c620 143 143 task_t *task; /**< Containing task. */ 144 144 145 __u64ticks; /**< Ticks before preemption. */145 uint64_t ticks; /**< Ticks before preemption. */ 146 146 147 147 int priority; /**< Thread's priority. Implemented as index to CPU->rq */ 148 __u32tid; /**< Thread ID. */148 uint32_t tid; /**< Thread ID. */ 149 149 150 150 thread_arch_t arch; /**< Architecture-specific data. */ 151 151 152 __u8*kstack; /**< Thread's kernel stack. */152 uint8_t *kstack; /**< Thread's kernel stack. */ 153 153 }; 154 154 … … 172 172 #endif 173 173 174 extern void thread_sleep( __u32sec);175 extern void thread_usleep( __u32usec);174 extern void thread_sleep(uint32_t sec); 175 extern void thread_usleep(uint32_t usec); 176 176 177 177 #define thread_join(t) thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 178 extern int thread_join_timeout(thread_t *t, __u32usec, int flags);178 extern int thread_join_timeout(thread_t *t, uint32_t usec, int flags); 179 179 extern void thread_detach(thread_t *t); 180 180 … … 188 188 189 189 /** Thread syscall prototypes. */ 190 __nativesys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name);191 __nativesys_thread_exit(int uspace_status);190 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name); 191 unative_t sys_thread_exit(int uspace_status); 192 192 193 193 #endif -
generic/include/security/cap.h
r991779c5 r7f1c620 80 80 #define CAP_IRQ_REG (1<<4) 81 81 82 typedef __u32cap_t;82 typedef uint32_t cap_t; 83 83 84 84 extern void cap_set(task_t *t, cap_t caps); 85 85 extern cap_t cap_get(task_t *t); 86 86 87 extern __nativesys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps);88 extern __nativesys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps);87 extern unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps); 88 extern unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps); 89 89 90 90 #endif -
generic/include/sort.h
r991779c5 r7f1c620 48 48 */ 49 49 extern int int_cmp(void * a, void * b); 50 extern int __u32_cmp(void * a, void * b);51 extern int __u16_cmp(void * a, void * b);52 extern int __u8_cmp(void * a, void * b);50 extern int uint32_t_cmp(void * a, void * b); 51 extern int uint16_t_cmp(void * a, void * b); 52 extern int uint8_t_cmp(void * a, void * b); 53 53 54 54 #endif -
generic/include/stackarg.h
r991779c5 r7f1c620 46 46 typedef struct va_list { 47 47 int pos; 48 __u8*last;48 uint8_t *last; 49 49 } va_list; 50 50 51 51 #define va_start(ap, lst) \ 52 52 (ap).pos = sizeof(lst); \ 53 (ap).last = ( __u8*) &(lst)53 (ap).last = (uint8_t *) &(lst) 54 54 55 55 #define va_arg(ap, type) \ -
generic/include/symtab.h
r991779c5 r7f1c620 41 41 42 42 struct symtab_entry { 43 __u64address_le;43 uint64_t address_le; 44 44 char symbol_name[MAX_SYMBOL_NAME]; 45 45 }; 46 46 47 extern char * get_symtab_entry( __nativeaddr);48 extern __addressget_symbol_addr(const char *name);47 extern char * get_symtab_entry(unative_t addr); 48 extern uintptr_t get_symbol_addr(const char *name); 49 49 extern void symtab_print_search(const char *name); 50 50 extern int symtab_compl(char *name); -
generic/include/synch/condvar.h
r991779c5 r7f1c620 53 53 extern void condvar_signal(condvar_t *cv); 54 54 extern void condvar_broadcast(condvar_t *cv); 55 extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32usec, int flags);55 extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags); 56 56 57 57 #endif -
generic/include/synch/futex.h
r991779c5 r7f1c620 27 27 */ 28 28 29 /** @addtogroup sync29 /** @addtogroup sync 30 30 * @{ 31 31 */ … … 44 44 /** Kernel-side futex structure. */ 45 45 struct futex { 46 __addresspaddr; /**< Physical address of the status variable. */46 uintptr_t paddr; /**< Physical address of the status variable. */ 47 47 waitq_t wq; /**< Wait queue for threads waiting for futex availability. */ 48 48 link_t ht_link; /**< Futex hash table link. */ … … 51 51 52 52 extern void futex_init(void); 53 extern __native sys_futex_sleep_timeout(__address uaddr, __u32usec, int flags);54 extern __native sys_futex_wakeup(__addressuaddr);53 extern unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags); 54 extern unative_t sys_futex_wakeup(uintptr_t uaddr); 55 55 56 56 extern void futex_cleanup(void); … … 58 58 #endif 59 59 60 /** @}60 /** @} 61 61 */ 62 62 -
generic/include/synch/mutex.h
r991779c5 r7f1c620 55 55 56 56 extern void mutex_initialize(mutex_t *mtx); 57 extern int _mutex_lock_timeout(mutex_t *mtx, __u32usec, int flags);57 extern int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags); 58 58 extern void mutex_unlock(mutex_t *mtx); 59 59 -
generic/include/synch/rwlock.h
r991779c5 r7f1c620 70 70 extern void rwlock_read_unlock(rwlock_t *rwl); 71 71 extern void rwlock_write_unlock(rwlock_t *rwl); 72 extern int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32usec, int flags);73 extern int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32usec, int flags);72 extern int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 73 extern int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 74 74 75 75 #endif -
generic/include/synch/semaphore.h
r991779c5 r7f1c620 54 54 55 55 extern void semaphore_initialize(semaphore_t *s, int val); 56 extern int _semaphore_down_timeout(semaphore_t *s, __u32usec, int flags);56 extern int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags); 57 57 extern void semaphore_up(semaphore_t *s); 58 58 -
generic/include/synch/waitq.h
r991779c5 r7f1c620 62 62 63 63 extern void waitq_initialize(waitq_t *wq); 64 extern int waitq_sleep_timeout(waitq_t *wq, __u32usec, int flags);64 extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags); 65 65 extern ipl_t waitq_sleep_prepare(waitq_t *wq); 66 extern int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32usec, int flags);66 extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags); 67 67 extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl); 68 68 extern void waitq_wakeup(waitq_t *wq, bool all); -
generic/include/syscall/syscall.h
r991779c5 r7f1c620 74 74 #include <typedefs.h> 75 75 76 typedef __native(*syshandler_t)();76 typedef unative_t (*syshandler_t)(); 77 77 78 78 extern syshandler_t syscall_table[SYSCALL_END]; 79 extern __native syscall_handler(__native a1, __native a2, __nativea3,80 __native a4, __nativeid);81 extern __native sys_tls_set(__nativeaddr);79 extern unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3, 80 unative_t a4, unative_t id); 81 extern unative_t sys_tls_set(unative_t addr); 82 82 83 83 -
generic/include/sysinfo/sysinfo.h
r991779c5 r7f1c620 37 37 typedef union sysinfo_item_val 38 38 { 39 __nativeval;39 unative_t val; 40 40 void *fn; 41 41 }sysinfo_item_val_t; … … 46 46 union 47 47 { 48 __nativeval;48 unative_t val; 49 49 void *fn; 50 50 }val; … … 70 70 71 71 72 typedef __native(*sysinfo_val_fn_t)(sysinfo_item_t *root);73 typedef __native(*sysinfo_subinfo_fn_t)(const char *subname);72 typedef unative_t (*sysinfo_val_fn_t)(sysinfo_item_t *root); 73 typedef unative_t (*sysinfo_subinfo_fn_t)(const char *subname); 74 74 75 75 typedef struct sysinfo_rettype 76 76 { 77 __nativeval;78 __nativevalid;77 unative_t val; 78 unative_t valid; 79 79 }sysinfo_rettype_t; 80 80 81 void sysinfo_set_item_val(const char *name,sysinfo_item_t **root, __nativeval);81 void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,unative_t val); 82 82 void sysinfo_dump(sysinfo_item_t **root,int depth); 83 83 void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn); … … 86 86 sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); 87 87 88 __native sys_sysinfo_valid(__native ptr,__nativelen);89 __native sys_sysinfo_value(__native ptr,__nativelen);88 unative_t sys_sysinfo_valid(unative_t ptr,unative_t len); 89 unative_t sys_sysinfo_value(unative_t ptr,unative_t len); 90 90 91 91 -
generic/include/time/delay.h
r991779c5 r7f1c620 38 38 #include <arch/types.h> 39 39 40 extern void delay( __u32microseconds);40 extern void delay(uint32_t microseconds); 41 41 42 42 #endif -
generic/include/time/timeout.h
r991779c5 r7f1c620 41 41 #include <adt/list.h> 42 42 43 #define us2ticks(us) (( __u64)(((__u32) (us)/(1000000/HZ))))43 #define us2ticks(us) ((uint64_t)(((uint32_t) (us)/(1000000/HZ)))) 44 44 45 45 typedef void (* timeout_handler_t)(void *arg); … … 50 50 link_t link; /**< Link to the list of active timeouts on THE->cpu */ 51 51 52 __u64ticks; /**< Timeout will be activated in this amount of clock() ticks. */52 uint64_t ticks; /**< Timeout will be activated in this amount of clock() ticks. */ 53 53 54 54 timeout_handler_t handler; /**< Function that will be called on timeout activation. */ … … 61 61 extern void timeout_initialize(timeout_t *t); 62 62 extern void timeout_reinitialize(timeout_t *t); 63 extern void timeout_register(timeout_t *t, __u64usec, timeout_handler_t f, void *arg);63 extern void timeout_register(timeout_t *t, uint64_t usec, timeout_handler_t f, void *arg); 64 64 extern bool timeout_unregister(timeout_t *t); 65 65
Note:
See TracChangeset
for help on using the changeset viewer.
