Changeset 7f1c620 in mainline for generic/src
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- Location:
- generic/src
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/adt/bitmap.c
r991779c5 r7f1c620 56 56 * @param bits Number of bits stored in bitmap. 57 57 */ 58 void bitmap_initialize(bitmap_t *bitmap, __u8*map, count_t bits)58 void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, count_t bits) 59 59 { 60 60 bitmap->map = map; -
generic/src/adt/hash_table.c
r991779c5 r7f1c620 65 65 panic("cannot allocate memory for hash table\n"); 66 66 } 67 memsetb(( __address) h->entry, m * sizeof(link_t), 0);67 memsetb((uintptr_t) h->entry, m * sizeof(link_t), 0); 68 68 69 69 for (i = 0; i < m; i++) … … 81 81 * @param item Item to be inserted into the hash table. 82 82 */ 83 void hash_table_insert(hash_table_t *h, __nativekey[], link_t *item)83 void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item) 84 84 { 85 85 index_t chain; … … 101 101 * @return Matching item on success, NULL if there is no such item. 102 102 */ 103 link_t *hash_table_find(hash_table_t *h, __nativekey[])103 link_t *hash_table_find(hash_table_t *h, unative_t key[]) 104 104 { 105 105 link_t *cur; … … 131 131 * @param keys Number of keys in the key array. 132 132 */ 133 void hash_table_remove(hash_table_t *h, __nativekey[], count_t keys)133 void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys) 134 134 { 135 135 index_t chain; -
generic/src/console/chardev.c
r991779c5 r7f1c620 60 60 * @param ch Character being pushed. 61 61 */ 62 void chardev_push_character(chardev_t *chardev, __u8ch)62 void chardev_push_character(chardev_t *chardev, uint8_t ch) 63 63 { 64 64 spinlock_lock(&chardev->lock); -
generic/src/console/cmd.c
r991779c5 r7f1c620 480 480 int cmd_call0(cmd_arg_t *argv) 481 481 { 482 __addresssymaddr;482 uintptr_t symaddr; 483 483 char *symbol; 484 __native(*f)(void);484 unative_t (*f)(void); 485 485 #ifdef ia64 486 486 struct { 487 __nativef;488 __nativegp;487 unative_t f; 488 unative_t gp; 489 489 }fptr; 490 490 #endif … … 493 493 if (!symaddr) 494 494 printf("Symbol %s not found.\n", argv->buffer); 495 else if (symaddr == ( __address) -1) {495 else if (symaddr == (uintptr_t) -1) { 496 496 symtab_print_search(argv->buffer); 497 497 printf("Duplicate symbol, be more specific.\n"); 498 498 } else { 499 499 symbol = get_symtab_entry(symaddr); 500 printf("Calling f(): %.*p: %s\n", sizeof( __address) * 2, symaddr, symbol);500 printf("Calling f(): %.*p: %s\n", sizeof(uintptr_t) * 2, symaddr, symbol); 501 501 #ifdef ia64 502 502 fptr.f = symaddr; 503 fptr.gp = (( __native*)cmd_call2)[1];504 f = ( __native(*)(void)) &fptr;503 fptr.gp = ((unative_t *)cmd_call2)[1]; 504 f = (unative_t (*)(void)) &fptr; 505 505 #else 506 f = ( __native(*)(void)) symaddr;506 f = (unative_t (*)(void)) symaddr; 507 507 #endif 508 508 printf("Result: %#zx\n", f()); … … 515 515 int cmd_call1(cmd_arg_t *argv) 516 516 { 517 __addresssymaddr;517 uintptr_t symaddr; 518 518 char *symbol; 519 __native (*f)(__native,...);520 __nativearg1 = argv[1].intval;519 unative_t (*f)(unative_t,...); 520 unative_t arg1 = argv[1].intval; 521 521 #ifdef ia64 522 522 struct { 523 __nativef;524 __nativegp;523 unative_t f; 524 unative_t gp; 525 525 }fptr; 526 526 #endif … … 529 529 if (!symaddr) 530 530 printf("Symbol %s not found.\n", argv->buffer); 531 else if (symaddr == ( __address) -1) {531 else if (symaddr == (uintptr_t) -1) { 532 532 symtab_print_search(argv->buffer); 533 533 printf("Duplicate symbol, be more specific.\n"); … … 535 535 symbol = get_symtab_entry(symaddr); 536 536 537 printf("Calling f(%#zx): %.*p: %s\n", arg1, sizeof( __address) * 2, symaddr, symbol);537 printf("Calling f(%#zx): %.*p: %s\n", arg1, sizeof(uintptr_t) * 2, symaddr, symbol); 538 538 #ifdef ia64 539 539 fptr.f = symaddr; 540 fptr.gp = (( __native*)cmd_call2)[1];541 f = ( __native (*)(__native,...)) &fptr;540 fptr.gp = ((unative_t *)cmd_call2)[1]; 541 f = (unative_t (*)(unative_t,...)) &fptr; 542 542 #else 543 f = ( __native (*)(__native,...)) symaddr;543 f = (unative_t (*)(unative_t,...)) symaddr; 544 544 #endif 545 545 printf("Result: %#zx\n", f(arg1)); … … 552 552 int cmd_call2(cmd_arg_t *argv) 553 553 { 554 __addresssymaddr;554 uintptr_t symaddr; 555 555 char *symbol; 556 __native (*f)(__native,__native,...);557 __nativearg1 = argv[1].intval;558 __nativearg2 = argv[2].intval;556 unative_t (*f)(unative_t,unative_t,...); 557 unative_t arg1 = argv[1].intval; 558 unative_t arg2 = argv[2].intval; 559 559 #ifdef ia64 560 560 struct { 561 __nativef;562 __nativegp;561 unative_t f; 562 unative_t gp; 563 563 }fptr; 564 564 #endif … … 567 567 if (!symaddr) 568 568 printf("Symbol %s not found.\n", argv->buffer); 569 else if (symaddr == ( __address) -1) {569 else if (symaddr == (uintptr_t) -1) { 570 570 symtab_print_search(argv->buffer); 571 571 printf("Duplicate symbol, be more specific.\n"); … … 573 573 symbol = get_symtab_entry(symaddr); 574 574 printf("Calling f(0x%zx,0x%zx): %.*p: %s\n", 575 arg1, arg2, sizeof( __address) * 2, symaddr, symbol);575 arg1, arg2, sizeof(uintptr_t) * 2, symaddr, symbol); 576 576 #ifdef ia64 577 577 fptr.f = symaddr; 578 fptr.gp = (( __native*)cmd_call2)[1];579 f = ( __native (*)(__native,__native,...)) &fptr;578 fptr.gp = ((unative_t *)cmd_call2)[1]; 579 f = (unative_t (*)(unative_t,unative_t,...)) &fptr; 580 580 #else 581 f = ( __native (*)(__native,__native,...)) symaddr;581 f = (unative_t (*)(unative_t,unative_t,...)) symaddr; 582 582 #endif 583 583 printf("Result: %#zx\n", f(arg1, arg2)); … … 590 590 int cmd_call3(cmd_arg_t *argv) 591 591 { 592 __addresssymaddr;592 uintptr_t symaddr; 593 593 char *symbol; 594 __native (*f)(__native,__native,__native,...);595 __nativearg1 = argv[1].intval;596 __nativearg2 = argv[2].intval;597 __nativearg3 = argv[3].intval;594 unative_t (*f)(unative_t,unative_t,unative_t,...); 595 unative_t arg1 = argv[1].intval; 596 unative_t arg2 = argv[2].intval; 597 unative_t arg3 = argv[3].intval; 598 598 #ifdef ia64 599 599 struct { 600 __nativef;601 __nativegp;600 unative_t f; 601 unative_t gp; 602 602 }fptr; 603 603 #endif … … 606 606 if (!symaddr) 607 607 printf("Symbol %s not found.\n", argv->buffer); 608 else if (symaddr == ( __address) -1) {608 else if (symaddr == (uintptr_t) -1) { 609 609 symtab_print_search(argv->buffer); 610 610 printf("Duplicate symbol, be more specific.\n"); … … 612 612 symbol = get_symtab_entry(symaddr); 613 613 printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n", 614 arg1, arg2, arg3, sizeof( __address) * 2, symaddr, symbol);614 arg1, arg2, arg3, sizeof(uintptr_t) * 2, symaddr, symbol); 615 615 #ifdef ia64 616 616 fptr.f = symaddr; 617 fptr.gp = (( __native*)cmd_call2)[1];618 f = ( __native (*)(__native,__native,__native,...)) &fptr;617 fptr.gp = ((unative_t *)cmd_call2)[1]; 618 f = (unative_t (*)(unative_t,unative_t,unative_t,...)) &fptr; 619 619 #else 620 f = ( __native (*)(__native,__native,__native,...)) symaddr;620 f = (unative_t (*)(unative_t,unative_t,unative_t,...)) symaddr; 621 621 #endif 622 622 printf("Result: %#zx\n", f(arg1, arg2, arg3)); … … 660 660 int cmd_set4(cmd_arg_t *argv) 661 661 { 662 __u32*addr ;663 __u32arg1 = argv[1].intval;662 uint32_t *addr ; 663 uint32_t arg1 = argv[1].intval; 664 664 bool pointer = false; 665 665 666 666 if (((char *)argv->buffer)[0] == '*') { 667 addr = ( __u32*) get_symbol_addr(argv->buffer+1);667 addr = (uint32_t *) get_symbol_addr(argv->buffer+1); 668 668 pointer = true; 669 669 } else if (((char *)argv->buffer)[0] >= '0' && 670 670 ((char *)argv->buffer)[0] <= '9') 671 addr = ( __u32*)atoi((char *)argv->buffer);671 addr = (uint32_t *)atoi((char *)argv->buffer); 672 672 else 673 addr = ( __u32*)get_symbol_addr(argv->buffer);673 addr = (uint32_t *)get_symbol_addr(argv->buffer); 674 674 675 675 if (!addr) 676 676 printf("Symbol %s not found.\n", argv->buffer); 677 else if (addr == ( __u32*) -1) {677 else if (addr == (uint32_t *) -1) { 678 678 symtab_print_search(argv->buffer); 679 679 printf("Duplicate symbol, be more specific.\n"); 680 680 } else { 681 681 if (pointer) 682 addr = ( __u32 *)(*(__native*)addr);683 printf("Writing 0x%x -> %.*p\n", arg1, sizeof( __address) * 2, addr);682 addr = (uint32_t *)(*(unative_t *)addr); 683 printf("Writing 0x%x -> %.*p\n", arg1, sizeof(uintptr_t) * 2, addr); 684 684 *addr = arg1; 685 685 -
generic/src/console/console.c
r991779c5 r7f1c620 77 77 * @return Character read. 78 78 */ 79 __u8_getc(chardev_t *chardev)79 uint8_t _getc(chardev_t *chardev) 80 80 { 81 __u8ch;81 uint8_t ch; 82 82 ipl_t ipl; 83 83 … … 151 151 152 152 /** Get character from device & echo it to screen */ 153 __u8getc(chardev_t *chardev)153 uint8_t getc(chardev_t *chardev) 154 154 { 155 __u8ch;155 uint8_t ch; 156 156 157 157 ch = _getc(chardev); -
generic/src/console/kconsole.c
r991779c5 r7f1c620 432 432 } 433 433 434 static int parse_int_arg(char *text, size_t len, __native*result)434 static int parse_int_arg(char *text, size_t len, unative_t *result) 435 435 { 436 436 char symname[MAX_SYMBOL_NAME]; 437 __addresssymaddr;437 uintptr_t symaddr; 438 438 bool isaddr = false; 439 439 bool isptr = false; … … 454 454 return -1; 455 455 } 456 if (symaddr == ( __address) -1) {456 if (symaddr == (uintptr_t) -1) { 457 457 printf("Duplicate symbol %s.\n",symname); 458 458 symtab_print_search(symname); … … 460 460 } 461 461 if (isaddr) 462 *result = ( __native)symaddr;462 *result = (unative_t)symaddr; 463 463 else if (isptr) 464 *result = **(( __native**)symaddr);464 *result = **((unative_t **)symaddr); 465 465 else 466 *result = *(( __native*)symaddr);466 *result = *((unative_t *)symaddr); 467 467 } else { /* It's a number - convert it */ 468 468 *result = atoi(text); 469 469 if (isptr) 470 *result = *(( __native*)*result);470 *result = *((unative_t *)*result); 471 471 } 472 472 … … 555 555 min((end-start), cmd->argv[i].len)); 556 556 buf[min((end - start), cmd->argv[i].len - 1)] = '\0'; 557 cmd->argv[i].intval = ( __native) buf;557 cmd->argv[i].intval = (unative_t) buf; 558 558 cmd->argv[i].vartype = ARG_TYPE_STRING; 559 559 } else if (!parse_int_arg(cmdline+start, end-start+1, -
generic/src/console/klog.c
r991779c5 r7f1c620 64 64 klog = (char *)PA2KA(faddr); 65 65 66 sysinfo_set_item_val("klog.faddr", NULL, ( __native)faddr);66 sysinfo_set_item_val("klog.faddr", NULL, (unative_t)faddr); 67 67 sysinfo_set_item_val("klog.pages", NULL, 1 << KLOG_ORDER); 68 68 -
generic/src/cpu/cpu.c
r991779c5 r7f1c620 69 69 70 70 /* initialize everything */ 71 memsetb(( __address) cpus, sizeof(cpu_t) * config.cpu_count, 0);71 memsetb((uintptr_t) cpus, sizeof(cpu_t) * config.cpu_count, 0); 72 72 73 73 for (i=0; i < config.cpu_count; i++) { 74 cpus[i].stack = ( __u8*) frame_alloc(STACK_FRAMES, FRAME_KA | FRAME_ATOMIC);74 cpus[i].stack = (uint8_t *) frame_alloc(STACK_FRAMES, FRAME_KA | FRAME_ATOMIC); 75 75 76 76 cpus[i].id = i; -
generic/src/ddi/ddi.c
r991779c5 r7f1c620 63 63 * there was a problem in creating address space area. 64 64 */ 65 static int ddi_physmem_map( __address pf, __addressvp, count_t pages, int flags)65 static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags) 66 66 { 67 67 ipl_t ipl; … … 111 111 * ENOENT if there is no task matching the specified ID. 112 112 */ 113 static int ddi_iospace_enable(task_id_t id, __addressioaddr, size_t size)113 static int ddi_iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size) 114 114 { 115 115 ipl_t ipl; … … 159 159 * @return 0 on success, otherwise it returns error code found in errno.h 160 160 */ 161 __native sys_physmem_map(__native phys_base, __native virt_base, __nativepages,162 __nativeflags)163 { 164 return ( __native) ddi_physmem_map(ALIGN_DOWN((__address) phys_base, FRAME_SIZE),165 ALIGN_DOWN(( __address) virt_base, PAGE_SIZE), (count_t) pages,161 unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base, unative_t pages, 162 unative_t flags) 163 { 164 return (unative_t) ddi_physmem_map(ALIGN_DOWN((uintptr_t) phys_base, FRAME_SIZE), 165 ALIGN_DOWN((uintptr_t) virt_base, PAGE_SIZE), (count_t) pages, 166 166 (int) flags); 167 167 } … … 173 173 * @return 0 on success, otherwise it returns error code found in errno.h 174 174 */ 175 __nativesys_iospace_enable(ddi_ioarg_t *uspace_io_arg)175 unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg) 176 176 { 177 177 ddi_ioarg_t arg; … … 180 180 rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t)); 181 181 if (rc != 0) 182 return ( __native) rc;182 return (unative_t) rc; 183 183 184 return ( __native) ddi_iospace_enable((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);184 return (unative_t) ddi_iospace_enable((task_id_t) arg.task_id, (uintptr_t) arg.ioaddr, (size_t) arg.size); 185 185 } 186 186 … … 193 193 * @return Zero on success or EPERM if callers capabilities are not sufficient. 194 194 */ 195 __nativesys_preempt_control(int enable)195 unative_t sys_preempt_control(int enable) 196 196 { 197 197 if (! cap_get(TASK) & CAP_PREEMPT_CONTROL) -
generic/src/debug/symtab.c
r991779c5 r7f1c620 51 51 * @return Pointer to respective symbol string on success, NULL otherwise. 52 52 */ 53 char * get_symtab_entry( __nativeaddr)53 char * get_symtab_entry(unative_t addr) 54 54 { 55 55 count_t i; 56 56 57 57 for (i=1;symbol_table[i].address_le;++i) { 58 if (addr < __u64_le2host(symbol_table[i].address_le))58 if (addr < uint64_t_le2host(symbol_table[i].address_le)) 59 59 break; 60 60 } 61 if (addr >= __u64_le2host(symbol_table[i-1].address_le))61 if (addr >= uint64_t_le2host(symbol_table[i-1].address_le)) 62 62 return symbol_table[i-1].symbol_name; 63 63 return NULL; … … 109 109 * @return 0 - Not found, -1 - Duplicate symbol, other - address of symbol 110 110 */ 111 __addressget_symbol_addr(const char *name)111 uintptr_t get_symbol_addr(const char *name) 112 112 { 113 113 count_t found = 0; 114 __addressaddr = NULL;114 uintptr_t addr = NULL; 115 115 char *hint; 116 116 int i; … … 119 119 while ((hint=symtab_search_one(name, &i))) { 120 120 if (!strlen(hint)) { 121 addr = __u64_le2host(symbol_table[i].address_le);121 addr = uint64_t_le2host(symbol_table[i].address_le); 122 122 found++; 123 123 } … … 125 125 } 126 126 if (found > 1) 127 return (( __address) -1);127 return ((uintptr_t) -1); 128 128 return addr; 129 129 } … … 133 133 { 134 134 int i; 135 __addressaddr;135 uintptr_t addr; 136 136 char *realname; 137 137 … … 139 139 i = 0; 140 140 while (symtab_search_one(name, &i)) { 141 addr = __u64_le2host(symbol_table[i].address_le);141 addr = uint64_t_le2host(symbol_table[i].address_le); 142 142 realname = symbol_table[i].symbol_name; 143 printf("%.*p: %s\n", sizeof( __address) * 2, addr, realname);143 printf("%.*p: %s\n", sizeof(uintptr_t) * 2, addr, realname); 144 144 i++; 145 145 } -
generic/src/interrupt/interrupt.c
r991779c5 r7f1c620 110 110 printf("Exc Description Handler\n"); 111 111 for (i=0; i < IVT_ITEMS; i++) { 112 symbol = get_symtab_entry(( __native)exc_table[i].f);112 symbol = get_symtab_entry((unative_t)exc_table[i].f); 113 113 if (!symbol) 114 114 symbol = "not found"; 115 115 printf("%d %s %.*p(%s)\n", i + IVT_FIRST, exc_table[i].name, 116 sizeof( __address) * 2, exc_table[i].f,symbol);116 sizeof(uintptr_t) * 2, exc_table[i].f,symbol); 117 117 if (!((i+1) % 20)) { 118 118 printf("Press any key to continue."); -
generic/src/ipc/ipc.c
r991779c5 r7f1c620 62 62 static void _ipc_call_init(call_t *call) 63 63 { 64 memsetb(( __address)call, sizeof(*call), 0);64 memsetb((uintptr_t)call, sizeof(*call), 0); 65 65 call->callerbox = &TASK->answerbox; 66 66 call->sender = TASK; … … 186 186 * message and sending it as a normal answer. 187 187 */ 188 void ipc_backsend_err(phone_t *phone, call_t *call, __nativeerr)188 void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err) 189 189 { 190 190 call->data.phone = phone; … … 309 309 * - to distinguish between call and answer, look at call->flags 310 310 */ 311 call_t * ipc_wait_for_call(answerbox_t *box, __u32usec, int flags)311 call_t * ipc_wait_for_call(answerbox_t *box, uint32_t usec, int flags) 312 312 { 313 313 call_t *request; -
generic/src/ipc/ipcrsc.c
r991779c5 r7f1c620 139 139 * @return NULL on not found, otherwise pointer to call structure 140 140 */ 141 call_t * get_call( __nativecallid)141 call_t * get_call(unative_t callid) 142 142 { 143 143 link_t *lst; … … 148 148 lst != &TASK->answerbox.dispatched_calls; lst = lst->next) { 149 149 call = list_get_instance(lst, call_t, link); 150 if (( __native)call == callid) {150 if ((unative_t)call == callid) { 151 151 result = call; 152 152 break; -
generic/src/ipc/irq.c
r991779c5 r7f1c620 73 73 { 74 74 int i; 75 __nativedstval = 0;75 unative_t dstval = 0; 76 76 77 77 if (!code) … … 81 81 switch (code->cmds[i].cmd) { 82 82 case CMD_MEM_READ_1: 83 dstval = *(( __u8*)code->cmds[i].addr);83 dstval = *((uint8_t *)code->cmds[i].addr); 84 84 break; 85 85 case CMD_MEM_READ_2: 86 dstval = *(( __u16*)code->cmds[i].addr);86 dstval = *((uint16_t *)code->cmds[i].addr); 87 87 break; 88 88 case CMD_MEM_READ_4: 89 dstval = *(( __u32*)code->cmds[i].addr);89 dstval = *((uint32_t *)code->cmds[i].addr); 90 90 break; 91 91 case CMD_MEM_READ_8: 92 dstval = *(( __u64*)code->cmds[i].addr);92 dstval = *((uint64_t *)code->cmds[i].addr); 93 93 break; 94 94 case CMD_MEM_WRITE_1: 95 *(( __u8*)code->cmds[i].addr) = code->cmds[i].value;95 *((uint8_t *)code->cmds[i].addr) = code->cmds[i].value; 96 96 break; 97 97 case CMD_MEM_WRITE_2: 98 *(( __u16*)code->cmds[i].addr) = code->cmds[i].value;98 *((uint16_t *)code->cmds[i].addr) = code->cmds[i].value; 99 99 break; 100 100 case CMD_MEM_WRITE_4: 101 *(( __u32*)code->cmds[i].addr) = code->cmds[i].value;101 *((uint32_t *)code->cmds[i].addr) = code->cmds[i].value; 102 102 break; 103 103 case CMD_MEM_WRITE_8: 104 *(( __u64*)code->cmds[i].addr) = code->cmds[i].value;104 *((uint64_t *)code->cmds[i].addr) = code->cmds[i].value; 105 105 break; 106 106 #if defined(ia32) || defined(amd64) … … 235 235 * 236 236 */ 237 void ipc_irq_send_msg(int irq, __native a1, __native a2, __nativea3)237 void ipc_irq_send_msg(int irq, unative_t a1, unative_t a2, unative_t a3) 238 238 { 239 239 call_t *call; -
generic/src/ipc/sysipc.c
r991779c5 r7f1c620 57 57 58 58 /** Return true if the method is a system method */ 59 static inline int is_system_method( __nativemethod)59 static inline int is_system_method(unative_t method) 60 60 { 61 61 if (method <= IPC_M_LAST_SYSTEM) … … 69 69 * it is useless 70 70 */ 71 static inline int is_forwardable( __nativemethod)71 static inline int is_forwardable(unative_t method) 72 72 { 73 73 if (method == IPC_M_PHONE_HUNGUP || method == IPC_M_AS_AREA_SEND \ … … 132 132 phone_connect(phoneid,&answer->sender->answerbox); 133 133 /* Set 'phone identification' as arg3 of response */ 134 IPC_SET_ARG3(answer->data, ( __native)&TASK->phones[phoneid]);134 IPC_SET_ARG3(answer->data, (unative_t)&TASK->phones[phoneid]); 135 135 } 136 136 } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) { … … 192 192 return ELIMIT; 193 193 /* Set arg3 for server */ 194 IPC_SET_ARG3(call->data, ( __native)&TASK->phones[newphid]);194 IPC_SET_ARG3(call->data, (unative_t)&TASK->phones[newphid]); 195 195 call->flags |= IPC_CALL_CONN_ME_TO; 196 196 call->private = newphid; … … 254 254 -2 on 'Too many async request, handle answers first 255 255 */ 256 __native sys_ipc_call_sync_fast(__native phoneid, __nativemethod,257 __nativearg1, ipc_data_t *data)256 unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, 257 unative_t arg1, ipc_data_t *data) 258 258 { 259 259 call_t call; … … 278 278 279 279 /** Synchronous IPC call allowing to send whole message */ 280 __native sys_ipc_call_sync(__nativephoneid, ipc_data_t *question,280 unative_t sys_ipc_call_sync(unative_t phoneid, ipc_data_t *question, 281 281 ipc_data_t *reply) 282 282 { … … 289 289 rc = copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args)); 290 290 if (rc != 0) 291 return ( __native) rc;291 return (unative_t) rc; 292 292 293 293 GET_CHECK_PHONE(phone, phoneid, return ENOENT); … … 324 324 -2 on 'Too many async request, handle answers first 325 325 */ 326 __native sys_ipc_call_async_fast(__native phoneid, __nativemethod,327 __native arg1, __nativearg2)326 unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, 327 unative_t arg1, unative_t arg2) 328 328 { 329 329 call_t *call; … … 347 347 ipc_backsend_err(phone, call, res); 348 348 349 return ( __native) call;349 return (unative_t) call; 350 350 } 351 351 … … 354 354 * @return The same as sys_ipc_call_async 355 355 */ 356 __native sys_ipc_call_async(__nativephoneid, ipc_data_t *data)356 unative_t sys_ipc_call_async(unative_t phoneid, ipc_data_t *data) 357 357 { 358 358 call_t *call; … … 370 370 if (rc != 0) { 371 371 ipc_call_free(call); 372 return ( __native) rc;372 return (unative_t) rc; 373 373 } 374 374 if (!(res=request_preprocess(call))) … … 377 377 ipc_backsend_err(phone, call, res); 378 378 379 return ( __native) call;379 return (unative_t) call; 380 380 } 381 381 … … 387 387 * arg3 is not rewritten for certain system IPC 388 388 */ 389 __native sys_ipc_forward_fast(__native callid, __nativephoneid,390 __native method, __nativearg1)389 unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, 390 unative_t method, unative_t arg1) 391 391 { 392 392 call_t *call; … … 429 429 430 430 /** Send IPC answer */ 431 __native sys_ipc_answer_fast(__native callid, __nativeretval,432 __native arg1, __nativearg2)431 unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, 432 unative_t arg1, unative_t arg2) 433 433 { 434 434 call_t *call; … … 460 460 461 461 /** Send IPC answer */ 462 __native sys_ipc_answer(__nativecallid, ipc_data_t *data)462 unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data) 463 463 { 464 464 call_t *call; … … 494 494 * 495 495 */ 496 __nativesys_ipc_hangup(int phoneid)496 unative_t sys_ipc_hangup(int phoneid) 497 497 { 498 498 phone_t *phone; … … 514 514 * @return Callid, if callid & 1, then the call is answer 515 515 */ 516 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32usec, int flags)516 unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags) 517 517 { 518 518 call_t *call; … … 533 533 ipc_call_free(call); 534 534 535 return (( __native)call) | IPC_CALLID_NOTIFICATION;535 return ((unative_t)call) | IPC_CALLID_NOTIFICATION; 536 536 } 537 537 … … 551 551 ipc_call_free(call); 552 552 553 return (( __native)call) | IPC_CALLID_ANSWERED;553 return ((unative_t)call) | IPC_CALLID_ANSWERED; 554 554 } 555 555 … … 562 562 return 0; 563 563 } 564 return ( __native)call;564 return (unative_t)call; 565 565 } 566 566 567 567 /** Connect irq handler to task */ 568 __nativesys_ipc_register_irq(int irq, irq_code_t *ucode)568 unative_t sys_ipc_register_irq(int irq, irq_code_t *ucode) 569 569 { 570 570 if (!(cap_get(TASK) & CAP_IRQ_REG)) … … 572 572 573 573 if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL) 574 return ( __native) ELIMIT;574 return (unative_t) ELIMIT; 575 575 576 576 irq_ipc_bind_arch(irq); … … 580 580 581 581 /* Disconnect irq handler from task */ 582 __nativesys_ipc_unregister_irq(int irq)582 unative_t sys_ipc_unregister_irq(int irq) 583 583 { 584 584 if (!(cap_get(TASK) & CAP_IRQ_REG)) … … 586 586 587 587 if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL) 588 return ( __native) ELIMIT;588 return (unative_t) ELIMIT; 589 589 590 590 ipc_irq_unregister(&TASK->answerbox, irq); -
generic/src/lib/elf.c
r991779c5 r7f1c620 97 97 /* Walk through all segment headers and process them. */ 98 98 for (i = 0; i < header->e_phnum; i++) { 99 rc = segment_header(&((elf_segment_header_t *)((( __u8*) header) + header->e_phoff))[i], header, as);99 rc = segment_header(&((elf_segment_header_t *)(((uint8_t *) header) + header->e_phoff))[i], header, as); 100 100 if (rc != EE_OK) 101 101 return rc; … … 104 104 /* Inspect all section headers and proccess them. */ 105 105 for (i = 0; i < header->e_shnum; i++) { 106 rc = section_header(&((elf_section_header_t *)((( __u8*) header) + header->e_shoff))[i], header, as);106 rc = section_header(&((elf_section_header_t *)(((uint8_t *) header) + header->e_shoff))[i], header, as); 107 107 if (rc != EE_OK) 108 108 return rc; -
generic/src/lib/func.c
r991779c5 r7f1c620 149 149 } 150 150 151 /** Convert ascii representation to __native151 /** Convert ascii representation to unative_t 152 152 * 153 153 * Supports 0x for hexa & 0 for octal notation. … … 157 157 * @return Converted number or 0 if no valid number ofund 158 158 */ 159 __nativeatoi(const char *text)159 unative_t atoi(const char *text) 160 160 { 161 161 int base = 10; 162 __nativeresult = 0;162 unative_t result = 0; 163 163 164 164 if (text[0] == '0' && text[1] == 'x') { -
generic/src/lib/memstr.c
r991779c5 r7f1c620 62 62 int i, j; 63 63 64 if (ALIGN_UP(( __address) src, sizeof(__native)) != (__address) src ||65 ALIGN_UP(( __address) dst, sizeof(__native)) != (__address) dst) {64 if (ALIGN_UP((uintptr_t) src, sizeof(unative_t)) != (uintptr_t) src || 65 ALIGN_UP((uintptr_t) dst, sizeof(unative_t)) != (uintptr_t) dst) { 66 66 for (i = 0; i < cnt; i++) 67 (( __u8 *) dst)[i] = ((__u8*) src)[i];67 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i]; 68 68 } else { 69 69 70 for (i = 0; i < cnt/sizeof( __native); i++)71 (( __native *) dst)[i] = ((__native*) src)[i];70 for (i = 0; i < cnt/sizeof(unative_t); i++) 71 ((unative_t *) dst)[i] = ((unative_t *) src)[i]; 72 72 73 for (j = 0; j < cnt%sizeof( __native); j++)74 (( __u8 *)(((__native *) dst) + i))[j] = ((__u8 *)(((__native*) src) + i))[j];73 for (j = 0; j < cnt%sizeof(unative_t); j++) 74 ((uint8_t *)(((unative_t *) dst) + i))[j] = ((uint8_t *)(((unative_t *) src) + i))[j]; 75 75 } 76 76 … … 88 88 * 89 89 */ 90 void _memsetb( __address dst, size_t cnt, __u8x)90 void _memsetb(uintptr_t dst, size_t cnt, uint8_t x) 91 91 { 92 92 int i; 93 __u8 *p = (__u8*) dst;93 uint8_t *p = (uint8_t *) dst; 94 94 95 95 for(i=0; i<cnt; i++) … … 107 107 * 108 108 */ 109 void _memsetw( __address dst, size_t cnt, __u16x)109 void _memsetw(uintptr_t dst, size_t cnt, uint16_t x) 110 110 { 111 111 int i; 112 __u16 *p = (__u16*) dst;112 uint16_t *p = (uint16_t *) dst; 113 113 114 114 for(i=0; i<cnt; i++) -
generic/src/lib/sort.c
r991779c5 r7f1c620 64 64 void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) 65 65 { 66 __u8buf_tmp[EBUFSIZE];67 __u8buf_pivot[EBUFSIZE];66 uint8_t buf_tmp[EBUFSIZE]; 67 uint8_t buf_pivot[EBUFSIZE]; 68 68 void * tmp = buf_tmp; 69 69 void * pivot = buf_pivot; … … 133 133 void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) 134 134 { 135 __u8buf_slot[EBUFSIZE];135 uint8_t buf_slot[EBUFSIZE]; 136 136 void * slot = buf_slot; 137 137 … … 185 185 } 186 186 187 int __u8_cmp(void * a, void * b)188 { 189 return (* ( __u8 *) a > * (__u8 *)b) ? 1 : (*(__u8 *)a < * (__u8*)b) ? -1 : 0;190 } 191 192 int __u16_cmp(void * a, void * b)193 { 194 return (* ( __u16 *) a > * (__u16 *)b) ? 1 : (*(__u16 *)a < * (__u16*)b) ? -1 : 0;195 } 196 197 int __u32_cmp(void * a, void * b)198 { 199 return (* ( __u32 *) a > * (__u32 *)b) ? 1 : (*(__u32 *)a < * (__u32*)b) ? -1 : 0;187 int uint8_t_cmp(void * a, void * b) 188 { 189 return (* (uint8_t *) a > * (uint8_t *)b) ? 1 : (*(uint8_t *)a < * (uint8_t *)b) ? -1 : 0; 190 } 191 192 int uint16_t_cmp(void * a, void * b) 193 { 194 return (* (uint16_t *) a > * (uint16_t *)b) ? 1 : (*(uint16_t *)a < * (uint16_t *)b) ? -1 : 0; 195 } 196 197 int uint32_t_cmp(void * a, void * b) 198 { 199 return (* (uint32_t *) a > * (uint32_t *)b) ? 1 : (*(uint32_t *)a < * (uint32_t *)b) ? -1 : 0; 200 200 } 201 201 -
generic/src/main/main.c
r991779c5 r7f1c620 102 102 * appropriate sizes and addresses. 103 103 */ 104 __addresshardcoded_load_address = 0; /**< Virtual address of where the kernel is loaded. */104 uintptr_t hardcoded_load_address = 0; /**< Virtual address of where the kernel is loaded. */ 105 105 size_t hardcoded_ktext_size = 0; /**< Size of the kernel code in bytes. */ 106 106 size_t hardcoded_kdata_size = 0; /**< Size of the kernel data in bytes. */ … … 133 133 void main_bsp(void) 134 134 { 135 __addressstackaddr;135 uintptr_t stackaddr; 136 136 137 137 config.cpu_count = 1; … … 203 203 204 204 version_print(); 205 printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof( __address) * 2, config.base, hardcoded_ktext_size >> 10, hardcoded_kdata_size >> 10);205 printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2, config.base, hardcoded_ktext_size >> 10, hardcoded_kdata_size >> 10); 206 206 207 207 arch_pre_smp_init(); … … 224 224 225 225 for (i = 0; i < init.cnt; i++) 226 printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof( __address) * 2, init.tasks[i].addr, i, init.tasks[i].size);226 printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof(uintptr_t) * 2, init.tasks[i].addr, i, init.tasks[i].size); 227 227 228 228 ipc_init(); … … 298 298 * switch to this cpu's private stack prior to waking kmp up. 299 299 */ 300 context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), ( __address) CPU->stack, CPU_STACK_SIZE);300 context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), (uintptr_t) CPU->stack, CPU_STACK_SIZE); 301 301 context_restore(&CPU->saved_context); 302 302 /* not reached */ -
generic/src/mm/as.c
r991779c5 r7f1c620 98 98 99 99 static int area_flags_to_page_flags(int aflags); 100 static as_area_t *find_area_and_lock(as_t *as, __addressva);101 static bool check_area_conflicts(as_t *as, __addressva, size_t size, as_area_t *avoid_area);100 static as_area_t *find_area_and_lock(as_t *as, uintptr_t va); 101 static bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area); 102 102 static void sh_info_remove_reference(share_info_t *sh_info); 103 103 … … 200 200 * @return Address space area on success or NULL on failure. 201 201 */ 202 as_area_t *as_area_create(as_t *as, int flags, size_t size, __addressbase, int attrs,202 as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs, 203 203 mem_backend_t *backend, mem_backend_data_t *backend_data) 204 204 { … … 239 239 a->backend_data = *backend_data; 240 240 else 241 memsetb(( __address) &a->backend_data, sizeof(a->backend_data), 0);241 memsetb((uintptr_t) &a->backend_data, sizeof(a->backend_data), 0); 242 242 243 243 btree_create(&a->used_space); … … 260 260 * @return Zero on success or a value from @ref errno.h otherwise. 261 261 */ 262 int as_area_resize(as_t *as, __addressaddress, size_t size, int flags)262 int as_area_resize(as_t *as, uintptr_t address, size_t size, int flags) 263 263 { 264 264 as_area_t *area; … … 313 313 if (pages < area->pages) { 314 314 bool cond; 315 __addressstart_free = area->base + pages*PAGE_SIZE;315 uintptr_t start_free = area->base + pages*PAGE_SIZE; 316 316 317 317 /* … … 338 338 node = list_get_instance(area->used_space.leaf_head.prev, btree_node_t, leaf_link); 339 339 if ((cond = (bool) node->keys)) { 340 __addressb = node->key[node->keys - 1];340 uintptr_t b = node->key[node->keys - 1]; 341 341 count_t c = (count_t) node->value[node->keys - 1]; 342 342 int i = 0; … … 419 419 * @return Zero on success or a value from @ref errno.h on failure. 420 420 */ 421 int as_area_destroy(as_t *as, __addressaddress)421 int as_area_destroy(as_t *as, uintptr_t address) 422 422 { 423 423 as_area_t *area; 424 __addressbase;424 uintptr_t base; 425 425 link_t *cur; 426 426 ipl_t ipl; … … 452 452 node = list_get_instance(cur, btree_node_t, leaf_link); 453 453 for (i = 0; i < node->keys; i++) { 454 __addressb = node->key[i];454 uintptr_t b = node->key[i]; 455 455 count_t j; 456 456 pte_t *pte; … … 519 519 * to share non-anonymous address space area is detected. 520 520 */ 521 int as_area_share(as_t *src_as, __addresssrc_base, size_t acc_size,522 as_t *dst_as, __addressdst_base, int dst_flags_mask)521 int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size, 522 as_t *dst_as, uintptr_t dst_base, int dst_flags_mask) 523 523 { 524 524 ipl_t ipl; … … 666 666 * fault was caused by copy_to_uspace() or copy_from_uspace(). 667 667 */ 668 int as_page_fault( __addresspage, pf_access_t access, istate_t *istate)668 int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate) 669 669 { 670 670 pte_t *pte; … … 745 745 if (THREAD->in_copy_from_uspace) { 746 746 THREAD->in_copy_from_uspace = false; 747 istate_set_retaddr(istate, ( __address) &memcpy_from_uspace_failover_address);747 istate_set_retaddr(istate, (uintptr_t) &memcpy_from_uspace_failover_address); 748 748 } else if (THREAD->in_copy_to_uspace) { 749 749 THREAD->in_copy_to_uspace = false; 750 istate_set_retaddr(istate, ( __address) &memcpy_to_uspace_failover_address);750 istate_set_retaddr(istate, (uintptr_t) &memcpy_to_uspace_failover_address); 751 751 } else { 752 752 return AS_PF_FAULT; … … 943 943 * @return Locked address space area containing va on success or NULL on failure. 944 944 */ 945 as_area_t *find_area_and_lock(as_t *as, __addressva)945 as_area_t *find_area_and_lock(as_t *as, uintptr_t va) 946 946 { 947 947 as_area_t *a; … … 999 999 * @return True if there is no conflict, false otherwise. 1000 1000 */ 1001 bool check_area_conflicts(as_t *as, __addressva, size_t size, as_area_t *avoid_area)1001 bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area) 1002 1002 { 1003 1003 as_area_t *a; … … 1072 1072 1073 1073 /** Return size of the address space area with given base. */ 1074 size_t as_get_size( __addressbase)1074 size_t as_get_size(uintptr_t base) 1075 1075 { 1076 1076 ipl_t ipl; … … 1100 1100 * @return 0 on failure and 1 on success. 1101 1101 */ 1102 int used_space_insert(as_area_t *a, __addresspage, count_t count)1102 int used_space_insert(as_area_t *a, uintptr_t page, count_t count) 1103 1103 { 1104 1104 btree_node_t *leaf, *node; … … 1124 1124 node = btree_leaf_node_left_neighbour(&a->used_space, leaf); 1125 1125 if (node) { 1126 __addressleft_pg = node->key[node->keys - 1], right_pg = leaf->key[0];1126 uintptr_t left_pg = node->key[node->keys - 1], right_pg = leaf->key[0]; 1127 1127 count_t left_cnt = (count_t) node->value[node->keys - 1], right_cnt = (count_t) leaf->value[0]; 1128 1128 … … 1167 1167 } 1168 1168 } else if (page < leaf->key[0]) { 1169 __addressright_pg = leaf->key[0];1169 uintptr_t right_pg = leaf->key[0]; 1170 1170 count_t right_cnt = (count_t) leaf->value[0]; 1171 1171 … … 1198 1198 node = btree_leaf_node_right_neighbour(&a->used_space, leaf); 1199 1199 if (node) { 1200 __addressleft_pg = leaf->key[leaf->keys - 1], right_pg = node->key[0];1200 uintptr_t left_pg = leaf->key[leaf->keys - 1], right_pg = node->key[0]; 1201 1201 count_t left_cnt = (count_t) leaf->value[leaf->keys - 1], right_cnt = (count_t) node->value[0]; 1202 1202 … … 1241 1241 } 1242 1242 } else if (page >= leaf->key[leaf->keys - 1]) { 1243 __addressleft_pg = leaf->key[leaf->keys - 1];1243 uintptr_t left_pg = leaf->key[leaf->keys - 1]; 1244 1244 count_t left_cnt = (count_t) leaf->value[leaf->keys - 1]; 1245 1245 … … 1273 1273 for (i = 1; i < leaf->keys; i++) { 1274 1274 if (page < leaf->key[i]) { 1275 __addressleft_pg = leaf->key[i - 1], right_pg = leaf->key[i];1275 uintptr_t left_pg = leaf->key[i - 1], right_pg = leaf->key[i]; 1276 1276 count_t left_cnt = (count_t) leaf->value[i - 1], right_cnt = (count_t) leaf->value[i]; 1277 1277 … … 1327 1327 * @return 0 on failure and 1 on success. 1328 1328 */ 1329 int used_space_remove(as_area_t *a, __addresspage, count_t count)1329 int used_space_remove(as_area_t *a, uintptr_t page, count_t count) 1330 1330 { 1331 1331 btree_node_t *leaf, *node; … … 1364 1364 node = btree_leaf_node_left_neighbour(&a->used_space, leaf); 1365 1365 if (node && page < leaf->key[0]) { 1366 __addressleft_pg = node->key[node->keys - 1];1366 uintptr_t left_pg = node->key[node->keys - 1]; 1367 1367 count_t left_cnt = (count_t) node->value[node->keys - 1]; 1368 1368 … … 1397 1397 1398 1398 if (page > leaf->key[leaf->keys - 1]) { 1399 __addressleft_pg = leaf->key[leaf->keys - 1];1399 uintptr_t left_pg = leaf->key[leaf->keys - 1]; 1400 1400 count_t left_cnt = (count_t) leaf->value[leaf->keys - 1]; 1401 1401 … … 1433 1433 for (i = 1; i < leaf->keys - 1; i++) { 1434 1434 if (page < leaf->key[i]) { 1435 __addressleft_pg = leaf->key[i - 1];1435 uintptr_t left_pg = leaf->key[i - 1]; 1436 1436 count_t left_cnt = (count_t) leaf->value[i - 1]; 1437 1437 … … 1497 1497 node = list_get_instance(cur, btree_node_t, leaf_link); 1498 1498 for (i = 0; i < node->keys; i++) 1499 frame_free(( __address) node->value[i]);1499 frame_free((uintptr_t) node->value[i]); 1500 1500 } 1501 1501 … … 1514 1514 1515 1515 /** Wrapper for as_area_create(). */ 1516 __native sys_as_area_create(__addressaddress, size_t size, int flags)1516 unative_t sys_as_area_create(uintptr_t address, size_t size, int flags) 1517 1517 { 1518 1518 if (as_area_create(AS, flags | AS_AREA_CACHEABLE, size, address, AS_AREA_ATTR_NONE, &anon_backend, NULL)) 1519 return ( __native) address;1519 return (unative_t) address; 1520 1520 else 1521 return ( __native) -1;1521 return (unative_t) -1; 1522 1522 } 1523 1523 1524 1524 /** Wrapper for as_area_resize. */ 1525 __native sys_as_area_resize(__addressaddress, size_t size, int flags)1526 { 1527 return ( __native) as_area_resize(AS, address, size, 0);1525 unative_t sys_as_area_resize(uintptr_t address, size_t size, int flags) 1526 { 1527 return (unative_t) as_area_resize(AS, address, size, 0); 1528 1528 } 1529 1529 1530 1530 /** Wrapper for as_area_destroy. */ 1531 __native sys_as_area_destroy(__addressaddress)1532 { 1533 return ( __native) as_area_destroy(AS, address);1531 unative_t sys_as_area_destroy(uintptr_t address) 1532 { 1533 return (unative_t) as_area_destroy(AS, address); 1534 1534 } 1535 1535 -
generic/src/mm/backend_anon.c
r991779c5 r7f1c620 52 52 #include <arch.h> 53 53 54 static int anon_page_fault(as_area_t *area, __addressaddr, pf_access_t access);55 static void anon_frame_free(as_area_t *area, __address page, __addressframe);54 static int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access); 55 static void anon_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame); 56 56 static void anon_share(as_area_t *area); 57 57 … … 72 72 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). 73 73 */ 74 int anon_page_fault(as_area_t *area, __addressaddr, pf_access_t access)74 int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 75 75 { 76 __addressframe;76 uintptr_t frame; 77 77 78 78 if (!as_area_check_access(area, access)) … … 89 89 */ 90 90 mutex_lock(&area->sh_info->lock); 91 frame = ( __address) btree_search(&area->sh_info->pagemap,91 frame = (uintptr_t) btree_search(&area->sh_info->pagemap, 92 92 ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf); 93 93 if (!frame) { … … 106 106 } 107 107 if (allocate) { 108 frame = ( __address) frame_alloc(ONE_FRAME, 0);108 frame = (uintptr_t) frame_alloc(ONE_FRAME, 0); 109 109 memsetb(PA2KA(frame), FRAME_SIZE, 0); 110 110 … … 133 133 * the different causes 134 134 */ 135 frame = ( __address)frame_alloc(ONE_FRAME, 0);135 frame = (uintptr_t)frame_alloc(ONE_FRAME, 0); 136 136 memsetb(PA2KA(frame), FRAME_SIZE, 0); 137 137 } … … 157 157 * @param frame Frame to be released. 158 158 */ 159 void anon_frame_free(as_area_t *area, __address page, __addressframe)159 void anon_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame) 160 160 { 161 161 frame_free(frame); … … 185 185 node = list_get_instance(cur, btree_node_t, leaf_link); 186 186 for (i = 0; i < node->keys; i++) { 187 __addressbase = node->key[i];187 uintptr_t base = node->key[i]; 188 188 count_t count = (count_t) node->value[i]; 189 189 int j; -
generic/src/mm/backend_elf.c
r991779c5 r7f1c620 51 51 #include <arch.h> 52 52 53 static int elf_page_fault(as_area_t *area, __addressaddr, pf_access_t access);54 static void elf_frame_free(as_area_t *area, __address page, __addressframe);53 static int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access); 54 static void elf_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame); 55 55 static void elf_share(as_area_t *area); 56 56 … … 71 71 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). 72 72 */ 73 int elf_page_fault(as_area_t *area, __addressaddr, pf_access_t access)73 int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 74 74 { 75 75 elf_header_t *elf = area->backend_data.elf; 76 76 elf_segment_header_t *entry = area->backend_data.segment; 77 77 btree_node_t *leaf; 78 __addressbase, frame;78 uintptr_t base, frame; 79 79 index_t i; 80 80 … … 84 84 ASSERT((addr >= entry->p_vaddr) && (addr < entry->p_vaddr + entry->p_memsz)); 85 85 i = (addr - entry->p_vaddr) >> PAGE_WIDTH; 86 base = ( __address) (((void *) elf) + entry->p_offset);86 base = (uintptr_t) (((void *) elf) + entry->p_offset); 87 87 ASSERT(ALIGN_UP(base, FRAME_SIZE) == base); 88 88 … … 95 95 96 96 mutex_lock(&area->sh_info->lock); 97 frame = ( __address) btree_search(&area->sh_info->pagemap,97 frame = (uintptr_t) btree_search(&area->sh_info->pagemap, 98 98 ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf); 99 99 if (!frame) { … … 135 135 */ 136 136 if (entry->p_flags & PF_W) { 137 frame = ( __address)frame_alloc(ONE_FRAME, 0);137 frame = (uintptr_t)frame_alloc(ONE_FRAME, 0); 138 138 memcpy((void *) PA2KA(frame), (void *) (base + i*FRAME_SIZE), FRAME_SIZE); 139 139 … … 154 154 * and cleared. 155 155 */ 156 frame = ( __address)frame_alloc(ONE_FRAME, 0);156 frame = (uintptr_t)frame_alloc(ONE_FRAME, 0); 157 157 memsetb(PA2KA(frame), FRAME_SIZE, 0); 158 158 … … 171 171 */ 172 172 size = entry->p_filesz - (i<<PAGE_WIDTH); 173 frame = ( __address)frame_alloc(ONE_FRAME, 0);173 frame = (uintptr_t)frame_alloc(ONE_FRAME, 0); 174 174 memsetb(PA2KA(frame) + size, FRAME_SIZE - size, 0); 175 175 memcpy((void *) PA2KA(frame), (void *) (base + i*FRAME_SIZE), size); … … 202 202 * 203 203 */ 204 void elf_frame_free(as_area_t *area, __address page, __addressframe)204 void elf_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame) 205 205 { 206 206 elf_header_t *elf = area->backend_data.elf; 207 207 elf_segment_header_t *entry = area->backend_data.segment; 208 __addressbase;208 uintptr_t base; 209 209 index_t i; 210 210 211 211 ASSERT((page >= entry->p_vaddr) && (page < entry->p_vaddr + entry->p_memsz)); 212 212 i = (page - entry->p_vaddr) >> PAGE_WIDTH; 213 base = ( __address) (((void *) elf) + entry->p_offset);213 base = (uintptr_t) (((void *) elf) + entry->p_offset); 214 214 ASSERT(ALIGN_UP(base, FRAME_SIZE) == base); 215 215 … … 246 246 link_t *cur; 247 247 btree_node_t *leaf, *node; 248 __addressstart_anon = entry->p_vaddr + entry->p_filesz;248 uintptr_t start_anon = entry->p_vaddr + entry->p_filesz; 249 249 250 250 /* … … 270 270 271 271 for (i = 0; i < node->keys; i++) { 272 __addressbase = node->key[i];272 uintptr_t base = node->key[i]; 273 273 count_t count = (count_t) node->value[i]; 274 274 int j; -
generic/src/mm/backend_phys.c
r991779c5 r7f1c620 47 47 #include <align.h> 48 48 49 static int phys_page_fault(as_area_t *area, __addressaddr, pf_access_t access);49 static int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access); 50 50 static void phys_share(as_area_t *area); 51 51 … … 66 66 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced). 67 67 */ 68 int phys_page_fault(as_area_t *area, __addressaddr, pf_access_t access)68 int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 69 69 { 70 __addressbase = area->backend_data.base;70 uintptr_t base = area->backend_data.base; 71 71 72 72 if (!as_area_check_access(area, access)) -
generic/src/mm/buddy.c
r991779c5 r7f1c620 67 67 */ 68 68 void buddy_system_create(buddy_system_t *b, 69 __u8max_order,69 uint8_t max_order, 70 70 buddy_system_operations_t *op, 71 71 void *data) … … 102 102 * @return True if block can be allocated 103 103 */ 104 bool buddy_system_can_alloc(buddy_system_t *b, __u8i) {105 __u8k;104 bool buddy_system_can_alloc(buddy_system_t *b, uint8_t i) { 105 uint8_t k; 106 106 107 107 /* … … 131 131 { 132 132 link_t *left,*right, *tmp; 133 __u8order;133 uint8_t order; 134 134 135 135 left = b->op->find_block(b, block, BUDDY_SYSTEM_INNER_BLOCK); … … 168 168 * @return Block of data represented by link_t. 169 169 */ 170 link_t *buddy_system_alloc(buddy_system_t *b, __u8i)170 link_t *buddy_system_alloc(buddy_system_t *b, uint8_t i) 171 171 { 172 172 link_t *res, *hlp; … … 231 231 { 232 232 link_t *buddy, *hlp; 233 __u8i;233 uint8_t i; 234 234 235 235 /* -
generic/src/mm/frame.c
r991779c5 r7f1c620 70 70 typedef struct { 71 71 count_t refcount; /**< tracking of shared frames */ 72 __u8buddy_order; /**< buddy system block order */72 uint8_t buddy_order; /**< buddy system block order */ 73 73 link_t buddy_link; /**< link to the next free block inside one order */ 74 74 void *parent; /**< If allocated by slab, this points there */ … … 218 218 219 219 /** @return True if zone can allocate specified order */ 220 static int zone_can_alloc(zone_t *z, __u8order)220 static int zone_can_alloc(zone_t *z, uint8_t order) 221 221 { 222 222 return buddy_system_can_alloc(z->buddy_system, order); … … 231 231 * @param pzone Pointer to preferred zone or NULL, on return contains zone number 232 232 */ 233 static zone_t * find_free_zone_lock( __u8order, int *pzone)233 static zone_t * find_free_zone_lock(uint8_t order, int *pzone) 234 234 { 235 235 int i; … … 272 272 */ 273 273 static link_t *zone_buddy_find_block(buddy_system_t *b, link_t *child, 274 __u8order)274 uint8_t order) 275 275 { 276 276 frame_t * frame; … … 381 381 * @param order Order to set 382 382 */ 383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8order) {383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, uint8_t order) { 384 384 frame_t * frame; 385 385 frame = list_get_instance(block, frame_t, buddy_link); … … 394 394 * @return Order of block 395 395 */ 396 static __u8zone_buddy_get_order(buddy_system_t *b, link_t * block) {396 static uint8_t zone_buddy_get_order(buddy_system_t *b, link_t * block) { 397 397 frame_t * frame; 398 398 frame = list_get_instance(block, frame_t, buddy_link); … … 451 451 * 452 452 */ 453 static pfn_t zone_frame_alloc(zone_t *zone, __u8order)453 static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order) 454 454 { 455 455 pfn_t v; … … 484 484 { 485 485 frame_t *frame; 486 __u8order;486 uint8_t order; 487 487 488 488 frame = &zone->frames[frame_idx]; … … 538 538 static void _zone_merge(zone_t *z, zone_t *z1, zone_t *z2) 539 539 { 540 __u8max_order;540 uint8_t max_order; 541 541 int i, z2idx; 542 542 pfn_t frame_idx; … … 625 625 int i; 626 626 627 pfn = ADDR2PFN(( __address)KA2PA(oldzone));627 pfn = ADDR2PFN((uintptr_t)KA2PA(oldzone)); 628 628 cframes = SIZE2FRAMES(zone_conf_size(oldzone->count)); 629 629 … … 654 654 { 655 655 count_t i; 656 __u8order;656 uint8_t order; 657 657 frame_t *frame; 658 658 … … 690 690 zone_t *zone1, *zone2, *newzone; 691 691 int cframes; 692 __u8order;692 uint8_t order; 693 693 int i; 694 694 pfn_t pfn; … … 780 780 { 781 781 int i; 782 __u8max_order;782 uint8_t max_order; 783 783 784 784 spinlock_initialize(&z->lock, "zone_lock"); … … 818 818 * @return Size of zone configuration info (in bytes) 819 819 */ 820 __addresszone_conf_size(count_t count)820 uintptr_t zone_conf_size(count_t count) 821 821 { 822 822 int size = sizeof(zone_t) + count*sizeof(frame_t); … … 846 846 { 847 847 zone_t *z; 848 __addressaddr;848 uintptr_t addr; 849 849 count_t confcount; 850 850 int i; … … 932 932 * 933 933 */ 934 void * frame_alloc_generic( __u8order, int flags, int *pzone)934 void * frame_alloc_generic(uint8_t order, int flags, int *pzone) 935 935 { 936 936 ipl_t ipl; … … 991 991 * @param Frame Physical Address of of the frame to be freed. 992 992 */ 993 void frame_free( __addressframe)993 void frame_free(uintptr_t frame) 994 994 { 995 995 ipl_t ipl; … … 1100 1100 zone = zones.info[i]; 1101 1101 spinlock_lock(&zone->lock); 1102 printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof( __address) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count);1102 printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof(uintptr_t) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count); 1103 1103 spinlock_unlock(&zone->lock); 1104 1104 } … … 1132 1132 spinlock_lock(&zone->lock); 1133 1133 printf("Memory zone information\n"); 1134 printf("Zone base address: %#.*p\n", sizeof( __address) * 2, PFN2ADDR(zone->base));1134 printf("Zone base address: %#.*p\n", sizeof(uintptr_t) * 2, PFN2ADDR(zone->base)); 1135 1135 printf("Zone size: %zd frames (%zdK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10); 1136 1136 printf("Allocated space: %zd frames (%zdK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); -
generic/src/mm/page.c
r991779c5 r7f1c620 70 70 * @param size Size of the structure. 71 71 */ 72 void map_structure( __addresss, size_t size)72 void map_structure(uintptr_t s, size_t size) 73 73 { 74 74 int i, cnt, length; … … 94 94 * @param flags Flags to be used for mapping. 95 95 */ 96 void page_mapping_insert(as_t *as, __address page, __addressframe, int flags)96 void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags) 97 97 { 98 98 ASSERT(page_mapping_operations); … … 113 113 * @param page Virtual address of the page to be demapped. 114 114 */ 115 void page_mapping_remove(as_t *as, __addresspage)115 void page_mapping_remove(as_t *as, uintptr_t page) 116 116 { 117 117 ASSERT(page_mapping_operations); … … 132 132 * @return NULL if there is no such mapping; requested mapping otherwise. 133 133 */ 134 pte_t *page_mapping_find(as_t *as, __addresspage)134 pte_t *page_mapping_find(as_t *as, uintptr_t page) 135 135 { 136 136 ASSERT(page_mapping_operations); -
generic/src/mm/slab.c
r991779c5 r7f1c620 550 550 cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0); 551 551 for (i=0; i < config.cpu_count; i++) { 552 memsetb(( __address)&cache->mag_cache[i],552 memsetb((uintptr_t)&cache->mag_cache[i], 553 553 sizeof(cache->mag_cache[i]), 0); 554 554 spinlock_initialize(&cache->mag_cache[i].lock, … … 570 570 ipl_t ipl; 571 571 572 memsetb(( __address)cache, sizeof(*cache), 0);572 memsetb((uintptr_t)cache, sizeof(*cache), 0); 573 573 cache->name = name; 574 574 575 if (align < sizeof( __native))576 align = sizeof( __native);575 if (align < sizeof(unative_t)) 576 align = sizeof(unative_t); 577 577 size = ALIGN_UP(size, align); 578 578 … … 821 821 "slab_magazine", 822 822 sizeof(slab_magazine_t)+SLAB_MAG_SIZE*sizeof(void*), 823 sizeof( __address),823 sizeof(uintptr_t), 824 824 NULL, NULL, 825 825 SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); … … 828 828 "slab_cache", 829 829 sizeof(slab_cache_cache), 830 sizeof( __address),830 sizeof(uintptr_t), 831 831 NULL, NULL, 832 832 SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE); -
generic/src/mm/tlb.c
r991779c5 r7f1c620 79 79 * @param count Number of pages, if required by type. 80 80 */ 81 void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, __addresspage, count_t count)81 void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count) 82 82 { 83 83 int i; … … 142 142 tlb_invalidate_type_t type; 143 143 asid_t asid; 144 __addresspage;144 uintptr_t page; 145 145 count_t count; 146 146 int i; -
generic/src/printf/printf_core.c
r991779c5 r7f1c620 89 89 * @return string length without trailing zero. 90 90 */ 91 static __nativestrlen(const char *str)92 { 93 __nativecounter = 0;91 static unative_t strlen(const char *str) 92 { 93 unative_t counter = 0; 94 94 95 95 while (str[counter] != 0) { … … 147 147 * @return number of printed characters, negative value on fail 148 148 */ 149 static int print_char(char c, int width, __u64flags, struct printf_spec *ps)149 static int print_char(char c, int width, uint64_t flags, struct printf_spec *ps) 150 150 { 151 151 int counter = 0; … … 177 177 */ 178 178 179 static int print_string(char *s, int width, int precision, __u64flags, struct printf_spec *ps)179 static int print_string(char *s, int width, int precision, uint64_t flags, struct printf_spec *ps) 180 180 { 181 181 int counter = 0; … … 237 237 * 238 238 */ 239 static int print_number( __u64 num, int width, int precision, int base , __u64flags, struct printf_spec *ps)239 static int print_number(uint64_t num, int width, int precision, int base , uint64_t flags, struct printf_spec *ps) 240 240 { 241 241 char *digits = digits_small; … … 428 428 * - "l" Signed or usigned long int.@n 429 429 * - "ll" Signed or usigned long long int.@n 430 * - "z" __native(non-standard extension).@n430 * - "z" unative_t (non-standard extension).@n 431 431 * 432 432 * … … 467 467 qualifier_t qualifier; /* type of argument */ 468 468 int base; /**< base in which will be parameter (numbers only) printed */ 469 __u64number; /**< argument value */469 uint64_t number; /**< argument value */ 470 470 size_t size; /**< byte size of integer parameter */ 471 471 int width, precision; 472 __u64flags;472 uint64_t flags; 473 473 474 474 counter = 0; … … 563 563 } 564 564 break; 565 case 'z': /* __native*/565 case 'z': /* unative_t */ 566 566 qualifier = PrintfQualifierNative; 567 567 break; … … 645 645 case PrintfQualifierByte: 646 646 size = sizeof(unsigned char); 647 number = ( __u64)va_arg(ap, unsigned int);647 number = (uint64_t)va_arg(ap, unsigned int); 648 648 break; 649 649 case PrintfQualifierShort: 650 650 size = sizeof(unsigned short); 651 number = ( __u64)va_arg(ap, unsigned int);651 number = (uint64_t)va_arg(ap, unsigned int); 652 652 break; 653 653 case PrintfQualifierInt: 654 654 size = sizeof(unsigned int); 655 number = ( __u64)va_arg(ap, unsigned int);655 number = (uint64_t)va_arg(ap, unsigned int); 656 656 break; 657 657 case PrintfQualifierLong: 658 658 size = sizeof(unsigned long); 659 number = ( __u64)va_arg(ap, unsigned long);659 number = (uint64_t)va_arg(ap, unsigned long); 660 660 break; 661 661 case PrintfQualifierLongLong: 662 662 size = sizeof(unsigned long long); 663 number = ( __u64)va_arg(ap, unsigned long long);663 number = (uint64_t)va_arg(ap, unsigned long long); 664 664 break; 665 665 case PrintfQualifierPointer: 666 666 size = sizeof(void *); 667 number = ( __u64)(unsigned long)va_arg(ap, void *);667 number = (uint64_t)(unsigned long)va_arg(ap, void *); 668 668 break; 669 669 case PrintfQualifierNative: 670 size = sizeof( __native);671 number = ( __u64)va_arg(ap, __native);670 size = sizeof(unative_t); 671 number = (uint64_t)va_arg(ap, unative_t); 672 672 break; 673 673 default: /* Unknown qualifier */ … … 680 680 flags |= __PRINTF_FLAG_NEGATIVE; 681 681 682 if (size == sizeof( __u64)) {683 number = -(( __s64)number);682 if (size == sizeof(uint64_t)) { 683 number = -((int64_t)number); 684 684 } else { 685 685 number = ~number; … … 704 704 705 705 if (i > j) { 706 if ((retval = printf_putnchars(&fmt[j], ( __native)(i - j), ps)) < 0) { /* error */706 if ((retval = printf_putnchars(&fmt[j], (unative_t)(i - j), ps)) < 0) { /* error */ 707 707 counter = -counter; 708 708 goto out; -
generic/src/proc/scheduler.c
r991779c5 r7f1c620 350 350 */ 351 351 context_save(&CPU->saved_context); 352 context_set(&CPU->saved_context, FADDR(scheduler_separated_stack), ( __address) CPU->stack, CPU_STACK_SIZE);352 context_set(&CPU->saved_context, FADDR(scheduler_separated_stack), (uintptr_t) CPU->stack, CPU_STACK_SIZE); 353 353 context_restore(&CPU->saved_context); 354 354 /* not reached */ -
generic/src/proc/task.c
r991779c5 r7f1c620 241 241 * @return 0 on success or an error code from @ref errno.h. 242 242 */ 243 __nativesys_task_get_id(task_id_t *uspace_task_id)243 unative_t sys_task_get_id(task_id_t *uspace_task_id) 244 244 { 245 245 /* … … 247 247 * remains constant for the lifespan of the task. 248 248 */ 249 return ( __native) copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid));249 return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid)); 250 250 } 251 251 -
generic/src/proc/thread.c
r991779c5 r7f1c620 91 91 92 92 SPINLOCK_INITIALIZE(tidlock); 93 __u32last_tid = 0;93 uint32_t last_tid = 0; 94 94 95 95 static slab_cache_t *thread_slab; … … 255 255 256 256 spinlock_lock(&threads_lock); 257 btree_remove(&threads_btree, (btree_key_t) (( __address) t), NULL);257 btree_remove(&threads_btree, (btree_key_t) ((uintptr_t ) t), NULL); 258 258 spinlock_unlock(&threads_lock); 259 259 … … 300 300 301 301 /* Not needed, but good for debugging */ 302 memsetb(( __address)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);302 memsetb((uintptr_t)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0); 303 303 304 304 ipl = interrupts_disable(); … … 309 309 310 310 context_save(&t->saved_context); 311 context_set(&t->saved_context, FADDR(cushion), ( __address) t->kstack, THREAD_STACK_SIZE);311 context_set(&t->saved_context, FADDR(cushion), (uintptr_t) t->kstack, THREAD_STACK_SIZE); 312 312 313 313 the_initialize((the_t *) t->kstack); … … 369 369 */ 370 370 spinlock_lock(&threads_lock); 371 btree_insert(&threads_btree, (btree_key_t) (( __address) t), (void *) t, NULL);371 btree_insert(&threads_btree, (btree_key_t) ((uintptr_t) t), (void *) t, NULL); 372 372 spinlock_unlock(&threads_lock); 373 373 … … 412 412 * 413 413 */ 414 void thread_sleep( __u32sec)414 void thread_sleep(uint32_t sec) 415 415 { 416 416 thread_usleep(sec*1000000); … … 425 425 * @return An error code from errno.h or an error code from synch.h. 426 426 */ 427 int thread_join_timeout(thread_t *t, __u32usec, int flags)427 int thread_join_timeout(thread_t *t, uint32_t usec, int flags) 428 428 { 429 429 ipl_t ipl; … … 485 485 * 486 486 */ 487 void thread_usleep( __u32usec)487 void thread_usleep(uint32_t usec) 488 488 { 489 489 waitq_t wq; … … 565 565 btree_node_t *leaf; 566 566 567 return btree_search(&threads_btree, (btree_key_t) (( __address) t), &leaf) != NULL;567 return btree_search(&threads_btree, (btree_key_t) ((uintptr_t) t), &leaf) != NULL; 568 568 } 569 569 … … 571 571 * 572 572 */ 573 __nativesys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)573 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name) 574 574 { 575 575 thread_t *t; 576 576 char namebuf[THREAD_NAME_BUFLEN]; 577 577 uspace_arg_t *kernel_uarg; 578 __u32tid;578 uint32_t tid; 579 579 int rc; 580 580 581 581 rc = copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN); 582 582 if (rc != 0) 583 return ( __native) rc;583 return (unative_t) rc; 584 584 585 585 kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); … … 587 587 if (rc != 0) { 588 588 free(kernel_uarg); 589 return ( __native) rc;589 return (unative_t) rc; 590 590 } 591 591 … … 593 593 tid = t->tid; 594 594 thread_ready(t); 595 return ( __native) tid;595 return (unative_t) tid; 596 596 } else { 597 597 free(kernel_uarg); 598 598 } 599 599 600 return ( __native) ENOMEM;600 return (unative_t) ENOMEM; 601 601 } 602 602 … … 604 604 * 605 605 */ 606 __nativesys_thread_exit(int uspace_status)606 unative_t sys_thread_exit(int uspace_status) 607 607 { 608 608 thread_exit(); -
generic/src/security/cap.c
r991779c5 r7f1c620 95 95 * @return Zero on success or an error code from @ref errno.h. 96 96 */ 97 __nativesys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)97 unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps) 98 98 { 99 99 sysarg64_t taskid_arg; … … 103 103 104 104 if (!(cap_get(TASK) & CAP_CAP)) 105 return ( __native) EPERM;105 return (unative_t) EPERM; 106 106 107 107 rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t)); 108 108 if (rc != 0) 109 return ( __native) rc;109 return (unative_t) rc; 110 110 111 111 ipl = interrupts_disable(); … … 115 115 spinlock_unlock(&tasks_lock); 116 116 interrupts_restore(ipl); 117 return ( __native) ENOENT;117 return (unative_t) ENOENT; 118 118 } 119 119 … … 140 140 * @return Zero on success or an error code from @ref errno.h. 141 141 */ 142 __nativesys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps)142 unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps) 143 143 { 144 144 sysarg64_t taskid_arg; … … 149 149 rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t)); 150 150 if (rc != 0) 151 return ( __native) rc;151 return (unative_t) rc; 152 152 153 153 ipl = interrupts_disable(); … … 157 157 spinlock_unlock(&tasks_lock); 158 158 interrupts_restore(ipl); 159 return ( __native) ENOENT;159 return (unative_t) ENOENT; 160 160 } 161 161 … … 168 168 spinlock_unlock(&tasks_lock); 169 169 interrupts_restore(ipl); 170 return ( __native) EPERM;170 return (unative_t) EPERM; 171 171 } 172 172 -
generic/src/synch/condvar.c
r991779c5 r7f1c620 88 88 * @return See comment for waitq_sleep_timeout(). 89 89 */ 90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32usec, int flags)90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags) 91 91 { 92 92 int rc; -
generic/src/synch/futex.c
r991779c5 r7f1c620 59 59 static void futex_initialize(futex_t *futex); 60 60 61 static futex_t *futex_find( __addresspaddr);62 static index_t futex_ht_hash( __native*key);63 static bool futex_ht_compare( __native*key, count_t keys, link_t *item);61 static futex_t *futex_find(uintptr_t paddr); 62 static index_t futex_ht_hash(unative_t *key); 63 static bool futex_ht_compare(unative_t *key, count_t keys, link_t *item); 64 64 static void futex_ht_remove_callback(link_t *item); 65 65 … … 109 109 * If there is no physical mapping for uaddr ENOENT is returned. 110 110 */ 111 __native sys_futex_sleep_timeout(__address uaddr, __u32usec, int flags)112 { 113 futex_t *futex; 114 __addresspaddr;111 unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags) 112 { 113 futex_t *futex; 114 uintptr_t paddr; 115 115 pte_t *t; 116 116 ipl_t ipl; … … 126 126 page_table_unlock(AS, true); 127 127 interrupts_restore(ipl); 128 return ( __native) ENOENT;128 return (unative_t) ENOENT; 129 129 } 130 130 paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE)); … … 135 135 futex = futex_find(paddr); 136 136 137 return ( __native) waitq_sleep_timeout(&futex->wq, usec, flags | SYNCH_FLAGS_INTERRUPTIBLE);137 return (unative_t) waitq_sleep_timeout(&futex->wq, usec, flags | SYNCH_FLAGS_INTERRUPTIBLE); 138 138 } 139 139 … … 144 144 * @return ENOENT if there is no physical mapping for uaddr. 145 145 */ 146 __native sys_futex_wakeup(__addressuaddr)147 { 148 futex_t *futex; 149 __addresspaddr;146 unative_t sys_futex_wakeup(uintptr_t uaddr) 147 { 148 futex_t *futex; 149 uintptr_t paddr; 150 150 pte_t *t; 151 151 ipl_t ipl; … … 161 161 page_table_unlock(AS, true); 162 162 interrupts_restore(ipl); 163 return ( __native) ENOENT;163 return (unative_t) ENOENT; 164 164 } 165 165 paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE)); … … 183 183 * @return Address of the kernel futex structure. 184 184 */ 185 futex_t *futex_find( __addresspaddr)185 futex_t *futex_find(uintptr_t paddr) 186 186 { 187 187 link_t *item; … … 276 276 * @return Index into futex hash table. 277 277 */ 278 index_t futex_ht_hash( __native*key)278 index_t futex_ht_hash(unative_t *key) 279 279 { 280 280 return *key & (FUTEX_HT_SIZE-1); … … 287 287 * @return True if the item matches the key. False otherwise. 288 288 */ 289 bool futex_ht_compare( __native*key, count_t keys, link_t *item)289 bool futex_ht_compare(unative_t *key, count_t keys, link_t *item) 290 290 { 291 291 futex_t *futex; … … 324 324 for (i = 0; i < node->keys; i++) { 325 325 futex_t *ftx; 326 __addresspaddr = node->key[i];326 uintptr_t paddr = node->key[i]; 327 327 328 328 ftx = (futex_t *) node->value[i]; -
generic/src/synch/mutex.c
r991779c5 r7f1c620 65 65 * @return See comment for waitq_sleep_timeout(). 66 66 */ 67 int _mutex_lock_timeout(mutex_t *mtx, __u32usec, int flags)67 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags) 68 68 { 69 69 return _semaphore_down_timeout(&mtx->sem, usec, flags); -
generic/src/synch/rwlock.c
r991779c5 r7f1c620 102 102 * @return See comment for waitq_sleep_timeout(). 103 103 */ 104 int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32usec, int flags)104 int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags) 105 105 { 106 106 ipl_t ipl; … … 156 156 * @return See comment for waitq_sleep_timeout(). 157 157 */ 158 int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32usec, int flags)158 int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags) 159 159 { 160 160 int rc; -
generic/src/synch/semaphore.c
r991779c5 r7f1c620 79 79 * @return See comment for waitq_sleep_timeout(). 80 80 */ 81 int _semaphore_down_timeout(semaphore_t *s, __u32usec, int flags)81 int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags) 82 82 { 83 83 return waitq_sleep_timeout(&s->wq, usec, flags); -
generic/src/synch/spinlock.c
r991779c5 r7f1c620 109 109 if (i++ > DEADLOCK_THRESHOLD) { 110 110 printf("cpu%d: looping on spinlock %.*p:%s, caller=%.*p", 111 CPU->id, sizeof( __address) * 2, sl, sl->name, sizeof(__address) * 2, CALLER);111 CPU->id, sizeof(uintptr_t) * 2, sl, sl->name, sizeof(uintptr_t) * 2, CALLER); 112 112 symbol = get_symtab_entry(CALLER); 113 113 if (symbol) -
generic/src/synch/waitq.c
r991779c5 r7f1c620 215 215 * attempted. 216 216 */ 217 int waitq_sleep_timeout(waitq_t *wq, __u32usec, int flags)217 int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags) 218 218 { 219 219 ipl_t ipl; … … 298 298 * @return See waitq_sleep_timeout(). 299 299 */ 300 int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32usec, int flags)300 int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags) 301 301 { 302 302 /* checks whether to go to sleep at all */ … … 352 352 } 353 353 THREAD->timeout_pending = true; 354 timeout_register(&THREAD->sleep_timeout, ( __u64) usec, waitq_timeouted_sleep, THREAD);354 timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, waitq_timeouted_sleep, THREAD); 355 355 } 356 356 -
generic/src/syscall/copy.c
r991779c5 r7f1c620 68 68 69 69 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 70 if (overlaps(( __address) uspace_src, size,70 if (overlaps((uintptr_t) uspace_src, size, 71 71 KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) { 72 72 /* … … 109 109 110 110 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 111 if (overlaps(( __address) uspace_dst, size,111 if (overlaps((uintptr_t) uspace_dst, size, 112 112 KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) { 113 113 /* -
generic/src/syscall/syscall.c
r991779c5 r7f1c620 59 59 * this syscall to facilitate it. 60 60 */ 61 static __nativesys_io(int fd, const void * buf, size_t count)61 static unative_t sys_io(int fd, const void * buf, size_t count) 62 62 { 63 63 size_t i; … … 86 86 87 87 /** Tell kernel to get keyboard/console access again */ 88 static __nativesys_debug_enable_console(void)88 static unative_t sys_debug_enable_console(void) 89 89 { 90 90 arch_grab_console(); … … 93 93 94 94 /** Dispatch system call */ 95 __native syscall_handler(__native a1, __native a2, __nativea3,96 __native a4, __nativeid)95 unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3, 96 unative_t a4, unative_t id) 97 97 { 98 __nativerc;98 unative_t rc; 99 99 100 100 if (id < SYSCALL_END) -
generic/src/sysinfo/sysinfo.c
r991779c5 r7f1c620 168 168 } 169 169 170 void sysinfo_set_item_val(const char *name, sysinfo_item_t **root, __nativeval)170 void sysinfo_set_item_val(const char *name, sysinfo_item_t **root, unative_t val) 171 171 { 172 172 if (root == NULL) … … 223 223 while (root != NULL) { 224 224 int i; 225 __nativeval = 0;225 unative_t val = 0; 226 226 char *vtype = NULL; 227 227 … … 279 279 } 280 280 281 __native sys_sysinfo_valid(__native ptr, __nativelen)281 unative_t sys_sysinfo_valid(unative_t ptr, unative_t len) 282 282 { 283 283 char *str; … … 293 293 } 294 294 295 __native sys_sysinfo_value(__native ptr, __nativelen)295 unative_t sys_sysinfo_value(unative_t ptr, unative_t len) 296 296 { 297 297 char *str; -
generic/src/time/clock.c
r991779c5 r7f1c620 58 58 /* Pointers to public variables with time */ 59 59 struct ptime { 60 __nativeseconds1;61 __nativeuseconds;62 __nativeseconds2;60 unative_t seconds1; 61 unative_t useconds; 62 unative_t seconds2; 63 63 }; 64 64 struct ptime *public_time; … … 66 66 * seconds correctly 67 67 */ 68 static __nativesecfrag = 0;68 static unative_t secfrag = 0; 69 69 70 70 /** Initialize realtime clock counter … … 91 91 public_time->useconds = 0; 92 92 93 sysinfo_set_item_val("clock.faddr", NULL, ( __native)faddr);93 sysinfo_set_item_val("clock.faddr", NULL, (unative_t)faddr); 94 94 } 95 95 … … 166 166 167 167 if (THREAD) { 168 __u64ticks;168 uint64_t ticks; 169 169 170 170 spinlock_lock(&CPU->lock); -
generic/src/time/delay.c
r991779c5 r7f1c620 50 50 * @param usec Number of microseconds to sleep. 51 51 */ 52 void delay( __u32usec)52 void delay(uint32_t usec) 53 53 { 54 54 ipl_t ipl; -
generic/src/time/timeout.c
r991779c5 r7f1c620 104 104 * 105 105 */ 106 void timeout_register(timeout_t *t, __u64time, timeout_handler_t f, void *arg)106 void timeout_register(timeout_t *t, uint64_t time, timeout_handler_t f, void *arg) 107 107 { 108 108 timeout_t *hlp = NULL; 109 109 link_t *l, *m; 110 110 ipl_t ipl; 111 __u64sum;111 uint64_t sum; 112 112 113 113 ipl = interrupts_disable();
Note:
See TracChangeset
for help on using the changeset viewer.