Changeset 7f1c620 in mainline for generic/src


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

Location:
generic/src
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • generic/src/adt/bitmap.c

    r991779c5 r7f1c620  
    5656 * @param bits Number of bits stored in bitmap.
    5757 */
    58 void bitmap_initialize(bitmap_t *bitmap, __u8 *map, count_t bits)
     58void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, count_t bits)
    5959{
    6060        bitmap->map = map;
  • generic/src/adt/hash_table.c

    r991779c5 r7f1c620  
    6565                panic("cannot allocate memory for hash table\n");
    6666        }
    67         memsetb((__address) h->entry, m * sizeof(link_t), 0);
     67        memsetb((uintptr_t) h->entry, m * sizeof(link_t), 0);
    6868       
    6969        for (i = 0; i < m; i++)
     
    8181 * @param item Item to be inserted into the hash table.
    8282 */
    83 void hash_table_insert(hash_table_t *h, __native key[], link_t *item)
     83void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item)
    8484{
    8585        index_t chain;
     
    101101 * @return Matching item on success, NULL if there is no such item.
    102102 */
    103 link_t *hash_table_find(hash_table_t *h, __native key[])
     103link_t *hash_table_find(hash_table_t *h, unative_t key[])
    104104{
    105105        link_t *cur;
     
    131131 * @param keys Number of keys in the key array.
    132132 */
    133 void hash_table_remove(hash_table_t *h, __native key[], count_t keys)
     133void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys)
    134134{
    135135        index_t chain;
  • generic/src/console/chardev.c

    r991779c5 r7f1c620  
    6060 * @param ch Character being pushed.
    6161 */
    62 void chardev_push_character(chardev_t *chardev, __u8 ch)
     62void chardev_push_character(chardev_t *chardev, uint8_t ch)
    6363{
    6464        spinlock_lock(&chardev->lock);
  • generic/src/console/cmd.c

    r991779c5 r7f1c620  
    480480int cmd_call0(cmd_arg_t *argv)
    481481{
    482         __address symaddr;
     482        uintptr_t symaddr;
    483483        char *symbol;
    484         __native (*f)(void);
     484        unative_t (*f)(void);
    485485#ifdef ia64
    486486        struct {
    487                 __native f;
    488                 __native gp;
     487                unative_t f;
     488                unative_t gp;
    489489        }fptr;
    490490#endif
     
    493493        if (!symaddr)
    494494                printf("Symbol %s not found.\n", argv->buffer);
    495         else if (symaddr == (__address) -1) {
     495        else if (symaddr == (uintptr_t) -1) {
    496496                symtab_print_search(argv->buffer);
    497497                printf("Duplicate symbol, be more specific.\n");
    498498        } else {
    499499                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);
    501501#ifdef ia64
    502502                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;
    505505#else
    506                 f =  (__native (*)(void)) symaddr;
     506                f =  (unative_t (*)(void)) symaddr;
    507507#endif
    508508                printf("Result: %#zx\n", f());
     
    515515int cmd_call1(cmd_arg_t *argv)
    516516{
    517         __address symaddr;
     517        uintptr_t symaddr;
    518518        char *symbol;
    519         __native (*f)(__native,...);
    520         __native arg1 = argv[1].intval;
     519        unative_t (*f)(unative_t,...);
     520        unative_t arg1 = argv[1].intval;
    521521#ifdef ia64
    522522        struct {
    523                 __native f;
    524                 __native gp;
     523                unative_t f;
     524                unative_t gp;
    525525        }fptr;
    526526#endif
     
    529529        if (!symaddr)
    530530                printf("Symbol %s not found.\n", argv->buffer);
    531         else if (symaddr == (__address) -1) {
     531        else if (symaddr == (uintptr_t) -1) {
    532532                symtab_print_search(argv->buffer);
    533533                printf("Duplicate symbol, be more specific.\n");
     
    535535                symbol = get_symtab_entry(symaddr);
    536536
    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);
    538538#ifdef ia64
    539539                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;
    542542#else
    543                 f =  (__native (*)(__native,...)) symaddr;
     543                f =  (unative_t (*)(unative_t,...)) symaddr;
    544544#endif
    545545                printf("Result: %#zx\n", f(arg1));
     
    552552int cmd_call2(cmd_arg_t *argv)
    553553{
    554         __address symaddr;
     554        uintptr_t symaddr;
    555555        char *symbol;
    556         __native (*f)(__native,__native,...);
    557         __native arg1 = argv[1].intval;
    558         __native arg2 = 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;
    559559#ifdef ia64
    560560        struct {
    561                 __native f;
    562                 __native gp;
     561                unative_t f;
     562                unative_t gp;
    563563        }fptr;
    564564#endif
     
    567567        if (!symaddr)
    568568                printf("Symbol %s not found.\n", argv->buffer);
    569         else if (symaddr == (__address) -1) {
     569        else if (symaddr == (uintptr_t) -1) {
    570570                symtab_print_search(argv->buffer);
    571571                printf("Duplicate symbol, be more specific.\n");
     
    573573                symbol = get_symtab_entry(symaddr);
    574574                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);
    576576#ifdef ia64
    577577                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;
    580580#else
    581                 f =  (__native (*)(__native,__native,...)) symaddr;
     581                f =  (unative_t (*)(unative_t,unative_t,...)) symaddr;
    582582#endif
    583583                printf("Result: %#zx\n", f(arg1, arg2));
     
    590590int cmd_call3(cmd_arg_t *argv)
    591591{
    592         __address symaddr;
     592        uintptr_t symaddr;
    593593        char *symbol;
    594         __native (*f)(__native,__native,__native,...);
    595         __native arg1 = argv[1].intval;
    596         __native arg2 = argv[2].intval;
    597         __native arg3 = 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;
    598598#ifdef ia64
    599599        struct {
    600                 __native f;
    601                 __native gp;
     600                unative_t f;
     601                unative_t gp;
    602602        }fptr;
    603603#endif
     
    606606        if (!symaddr)
    607607                printf("Symbol %s not found.\n", argv->buffer);
    608         else if (symaddr == (__address) -1) {
     608        else if (symaddr == (uintptr_t) -1) {
    609609                symtab_print_search(argv->buffer);
    610610                printf("Duplicate symbol, be more specific.\n");
     
    612612                symbol = get_symtab_entry(symaddr);
    613613                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);
    615615#ifdef ia64
    616616                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;
    619619#else
    620                 f =  (__native (*)(__native,__native,__native,...)) symaddr;
     620                f =  (unative_t (*)(unative_t,unative_t,unative_t,...)) symaddr;
    621621#endif
    622622                printf("Result: %#zx\n", f(arg1, arg2, arg3));
     
    660660int cmd_set4(cmd_arg_t *argv)
    661661{
    662         __u32 *addr ;
    663         __u32 arg1 = argv[1].intval;
     662        uint32_t *addr ;
     663        uint32_t arg1 = argv[1].intval;
    664664        bool pointer = false;
    665665
    666666        if (((char *)argv->buffer)[0] == '*') {
    667                 addr = (__u32 *) get_symbol_addr(argv->buffer+1);
     667                addr = (uint32_t *) get_symbol_addr(argv->buffer+1);
    668668                pointer = true;
    669669        } else if (((char *)argv->buffer)[0] >= '0' &&
    670670                   ((char *)argv->buffer)[0] <= '9')
    671                 addr = (__u32 *)atoi((char *)argv->buffer);
     671                addr = (uint32_t *)atoi((char *)argv->buffer);
    672672        else
    673                 addr = (__u32 *)get_symbol_addr(argv->buffer);
     673                addr = (uint32_t *)get_symbol_addr(argv->buffer);
    674674
    675675        if (!addr)
    676676                printf("Symbol %s not found.\n", argv->buffer);
    677         else if (addr == (__u32 *) -1) {
     677        else if (addr == (uint32_t *) -1) {
    678678                symtab_print_search(argv->buffer);
    679679                printf("Duplicate symbol, be more specific.\n");
    680680        } else {
    681681                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);
    684684                *addr = arg1;
    685685               
  • generic/src/console/console.c

    r991779c5 r7f1c620  
    7777 * @return Character read.
    7878 */
    79 __u8 _getc(chardev_t *chardev)
     79uint8_t _getc(chardev_t *chardev)
    8080{
    81         __u8 ch;
     81        uint8_t ch;
    8282        ipl_t ipl;
    8383
     
    151151
    152152/** Get character from device & echo it to screen */
    153 __u8 getc(chardev_t *chardev)
     153uint8_t getc(chardev_t *chardev)
    154154{
    155         __u8 ch;
     155        uint8_t ch;
    156156
    157157        ch = _getc(chardev);
  • generic/src/console/kconsole.c

    r991779c5 r7f1c620  
    432432}
    433433
    434 static int parse_int_arg(char *text, size_t len, __native *result)
     434static int parse_int_arg(char *text, size_t len, unative_t *result)
    435435{
    436436        char symname[MAX_SYMBOL_NAME];
    437         __address symaddr;
     437        uintptr_t symaddr;
    438438        bool isaddr = false;
    439439        bool isptr = false;
     
    454454                        return -1;
    455455                }
    456                 if (symaddr == (__address) -1) {
     456                if (symaddr == (uintptr_t) -1) {
    457457                        printf("Duplicate symbol %s.\n",symname);
    458458                        symtab_print_search(symname);
     
    460460                }
    461461                if (isaddr)
    462                         *result = (__native)symaddr;
     462                        *result = (unative_t)symaddr;
    463463                else if (isptr)
    464                         *result = **((__native **)symaddr);
     464                        *result = **((unative_t **)symaddr);
    465465                else
    466                         *result = *((__native *)symaddr);
     466                        *result = *((unative_t *)symaddr);
    467467        } else { /* It's a number - convert it */
    468468                *result = atoi(text);
    469469                if (isptr)
    470                         *result = *((__native *)*result);
     470                        *result = *((unative_t *)*result);
    471471        }
    472472
     
    555555                                        min((end-start), cmd->argv[i].len));
    556556                                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;
    558558                                cmd->argv[i].vartype = ARG_TYPE_STRING;
    559559                        } else if (!parse_int_arg(cmdline+start, end-start+1,
  • generic/src/console/klog.c

    r991779c5 r7f1c620  
    6464        klog = (char *)PA2KA(faddr);
    6565       
    66         sysinfo_set_item_val("klog.faddr", NULL, (__native)faddr);
     66        sysinfo_set_item_val("klog.faddr", NULL, (unative_t)faddr);
    6767        sysinfo_set_item_val("klog.pages", NULL, 1 << KLOG_ORDER);
    6868
  • generic/src/cpu/cpu.c

    r991779c5 r7f1c620  
    6969
    7070                /* 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);
    7272
    7373                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);
    7575                       
    7676                        cpus[i].id = i;
  • generic/src/ddi/ddi.c

    r991779c5 r7f1c620  
    6363 *         there was a problem in creating address space area.
    6464 */
    65 static int ddi_physmem_map(__address pf, __address vp, count_t pages, int flags)
     65static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags)
    6666{
    6767        ipl_t ipl;
     
    111111 *         ENOENT if there is no task matching the specified ID.
    112112 */
    113 static int ddi_iospace_enable(task_id_t id, __address ioaddr, size_t size)
     113static int ddi_iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size)
    114114{
    115115        ipl_t ipl;
     
    159159 * @return 0 on success, otherwise it returns error code found in errno.h
    160160 */
    161 __native sys_physmem_map(__native phys_base, __native virt_base, __native pages,
    162                          __native flags)
    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,
     161unative_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,
    166166                                          (int) flags);
    167167}
     
    173173 * @return 0 on success, otherwise it returns error code found in errno.h
    174174 */
    175 __native sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
     175unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
    176176{
    177177        ddi_ioarg_t arg;
     
    180180        rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
    181181        if (rc != 0)
    182                 return (__native) rc;
     182                return (unative_t) rc;
    183183               
    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);
    185185}
    186186
     
    193193 * @return Zero on success or EPERM if callers capabilities are not sufficient.
    194194 */
    195 __native sys_preempt_control(int enable)
     195unative_t sys_preempt_control(int enable)
    196196{
    197197        if (! cap_get(TASK) & CAP_PREEMPT_CONTROL)
  • generic/src/debug/symtab.c

    r991779c5 r7f1c620  
    5151 * @return Pointer to respective symbol string on success, NULL otherwise.
    5252 */
    53 char * get_symtab_entry(__native addr)
     53char * get_symtab_entry(unative_t addr)
    5454{
    5555        count_t i;
    5656
    5757        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))
    5959                        break;
    6060        }
    61         if (addr >= __u64_le2host(symbol_table[i-1].address_le))
     61        if (addr >= uint64_t_le2host(symbol_table[i-1].address_le))
    6262                return symbol_table[i-1].symbol_name;
    6363        return NULL;
     
    109109 * @return 0 - Not found, -1 - Duplicate symbol, other - address of symbol
    110110 */
    111 __address get_symbol_addr(const char *name)
     111uintptr_t get_symbol_addr(const char *name)
    112112{
    113113        count_t found = 0;
    114         __address addr = NULL;
     114        uintptr_t addr = NULL;
    115115        char *hint;
    116116        int i;
     
    119119        while ((hint=symtab_search_one(name, &i))) {
    120120                if (!strlen(hint)) {
    121                         addr =  __u64_le2host(symbol_table[i].address_le);
     121                        addr =  uint64_t_le2host(symbol_table[i].address_le);
    122122                        found++;
    123123                }
     
    125125        }
    126126        if (found > 1)
    127                 return ((__address) -1);
     127                return ((uintptr_t) -1);
    128128        return addr;
    129129}
     
    133133{
    134134        int i;
    135         __address addr;
     135        uintptr_t addr;
    136136        char *realname;
    137137
     
    139139        i = 0;
    140140        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);
    142142                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);
    144144                i++;
    145145        }
  • generic/src/interrupt/interrupt.c

    r991779c5 r7f1c620  
    110110        printf("Exc Description Handler\n");
    111111        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);
    113113                if (!symbol)
    114114                        symbol = "not found";
    115115                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);           
    117117                if (!((i+1) % 20)) {
    118118                        printf("Press any key to continue.");
  • generic/src/ipc/ipc.c

    r991779c5 r7f1c620  
    6262static void _ipc_call_init(call_t *call)
    6363{
    64         memsetb((__address)call, sizeof(*call), 0);
     64        memsetb((uintptr_t)call, sizeof(*call), 0);
    6565        call->callerbox = &TASK->answerbox;
    6666        call->sender = TASK;
     
    186186 * message and sending it as a normal answer.
    187187 */
    188 void ipc_backsend_err(phone_t *phone, call_t *call, __native err)
     188void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err)
    189189{
    190190        call->data.phone = phone;
     
    309309 * - to distinguish between call and answer, look at call->flags
    310310 */
    311 call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int flags)
     311call_t * ipc_wait_for_call(answerbox_t *box, uint32_t usec, int flags)
    312312{
    313313        call_t *request;
  • generic/src/ipc/ipcrsc.c

    r991779c5 r7f1c620  
    139139 * @return NULL on not found, otherwise pointer to call structure
    140140 */
    141 call_t * get_call(__native callid)
     141call_t * get_call(unative_t callid)
    142142{
    143143        link_t *lst;
     
    148148             lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
    149149                call = list_get_instance(lst, call_t, link);
    150                 if ((__native)call == callid) {
     150                if ((unative_t)call == callid) {
    151151                        result = call;
    152152                        break;
  • generic/src/ipc/irq.c

    r991779c5 r7f1c620  
    7373{
    7474        int i;
    75         __native dstval = 0;
     75        unative_t dstval = 0;
    7676       
    7777        if (!code)
     
    8181                switch (code->cmds[i].cmd) {
    8282                case CMD_MEM_READ_1:
    83                         dstval = *((__u8 *)code->cmds[i].addr);
     83                        dstval = *((uint8_t *)code->cmds[i].addr);
    8484                        break;
    8585                case CMD_MEM_READ_2:
    86                         dstval = *((__u16 *)code->cmds[i].addr);
     86                        dstval = *((uint16_t *)code->cmds[i].addr);
    8787                        break;
    8888                case CMD_MEM_READ_4:
    89                         dstval = *((__u32 *)code->cmds[i].addr);
     89                        dstval = *((uint32_t *)code->cmds[i].addr);
    9090                        break;
    9191                case CMD_MEM_READ_8:
    92                         dstval = *((__u64 *)code->cmds[i].addr);
     92                        dstval = *((uint64_t *)code->cmds[i].addr);
    9393                        break;
    9494                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;
    9696                        break;
    9797                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;
    9999                        break;
    100100                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;
    102102                        break;
    103103                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;
    105105                        break;
    106106#if defined(ia32) || defined(amd64)
     
    235235 *
    236236 */
    237 void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3)
     237void ipc_irq_send_msg(int irq, unative_t a1, unative_t a2, unative_t a3)
    238238{
    239239        call_t *call;
  • generic/src/ipc/sysipc.c

    r991779c5 r7f1c620  
    5757
    5858/** Return true if the method is a system method */
    59 static inline int is_system_method(__native method)
     59static inline int is_system_method(unative_t method)
    6060{
    6161        if (method <= IPC_M_LAST_SYSTEM)
     
    6969 *   it is useless
    7070 */
    71 static inline int is_forwardable(__native method)
     71static inline int is_forwardable(unative_t method)
    7272{
    7373        if (method == IPC_M_PHONE_HUNGUP || method == IPC_M_AS_AREA_SEND \
     
    132132                        phone_connect(phoneid,&answer->sender->answerbox);
    133133                        /* 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]);
    135135                }
    136136        } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) {
     
    192192                        return ELIMIT;
    193193                /* 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]);
    195195                call->flags |= IPC_CALL_CONN_ME_TO;
    196196                call->private = newphid;
     
    254254           -2 on 'Too many async request, handle answers first
    255255 */
    256 __native sys_ipc_call_sync_fast(__native phoneid, __native method,
    257                                 __native arg1, ipc_data_t *data)
     256unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method,
     257                                unative_t arg1, ipc_data_t *data)
    258258{
    259259        call_t call;
     
    278278
    279279/** Synchronous IPC call allowing to send whole message */
    280 __native sys_ipc_call_sync(__native phoneid, ipc_data_t *question,
     280unative_t sys_ipc_call_sync(unative_t phoneid, ipc_data_t *question,
    281281                           ipc_data_t *reply)
    282282{
     
    289289        rc = copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args));
    290290        if (rc != 0)
    291                 return (__native) rc;
     291                return (unative_t) rc;
    292292
    293293        GET_CHECK_PHONE(phone, phoneid, return ENOENT);
     
    324324           -2 on 'Too many async request, handle answers first
    325325 */
    326 __native sys_ipc_call_async_fast(__native phoneid, __native method,
    327                                  __native arg1, __native arg2)
     326unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method,
     327                                 unative_t arg1, unative_t arg2)
    328328{
    329329        call_t *call;
     
    347347                ipc_backsend_err(phone, call, res);
    348348
    349         return (__native) call;
     349        return (unative_t) call;
    350350}
    351351
     
    354354 * @return The same as sys_ipc_call_async
    355355 */
    356 __native sys_ipc_call_async(__native phoneid, ipc_data_t *data)
     356unative_t sys_ipc_call_async(unative_t phoneid, ipc_data_t *data)
    357357{
    358358        call_t *call;
     
    370370        if (rc != 0) {
    371371                ipc_call_free(call);
    372                 return (__native) rc;
     372                return (unative_t) rc;
    373373        }
    374374        if (!(res=request_preprocess(call)))
     
    377377                ipc_backsend_err(phone, call, res);
    378378
    379         return (__native) call;
     379        return (unative_t) call;
    380380}
    381381
     
    387387 *          arg3 is not rewritten for certain system IPC
    388388 */
    389 __native sys_ipc_forward_fast(__native callid, __native phoneid,
    390                               __native method, __native arg1)
     389unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid,
     390                              unative_t method, unative_t arg1)
    391391{
    392392        call_t *call;
     
    429429
    430430/** Send IPC answer */
    431 __native sys_ipc_answer_fast(__native callid, __native retval,
    432                              __native arg1, __native arg2)
     431unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval,
     432                             unative_t arg1, unative_t arg2)
    433433{
    434434        call_t *call;
     
    460460
    461461/** Send IPC answer */
    462 __native sys_ipc_answer(__native callid, ipc_data_t *data)
     462unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data)
    463463{
    464464        call_t *call;
     
    494494 *
    495495 */
    496 __native sys_ipc_hangup(int phoneid)
     496unative_t sys_ipc_hangup(int phoneid)
    497497{
    498498        phone_t *phone;
     
    514514 * @return Callid, if callid & 1, then the call is answer
    515515 */
    516 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int flags)
     516unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags)
    517517{
    518518        call_t *call;
     
    533533                ipc_call_free(call);
    534534               
    535                 return ((__native)call) | IPC_CALLID_NOTIFICATION;
     535                return ((unative_t)call) | IPC_CALLID_NOTIFICATION;
    536536        }
    537537
     
    551551                ipc_call_free(call);
    552552
    553                 return ((__native)call) | IPC_CALLID_ANSWERED;
     553                return ((unative_t)call) | IPC_CALLID_ANSWERED;
    554554        }
    555555
     
    562562                return 0;
    563563        }
    564         return (__native)call;
     564        return (unative_t)call;
    565565}
    566566
    567567/** Connect irq handler to task */
    568 __native sys_ipc_register_irq(int irq, irq_code_t *ucode)
     568unative_t sys_ipc_register_irq(int irq, irq_code_t *ucode)
    569569{
    570570        if (!(cap_get(TASK) & CAP_IRQ_REG))
     
    572572
    573573        if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL)
    574                 return (__native) ELIMIT;
     574                return (unative_t) ELIMIT;
    575575       
    576576        irq_ipc_bind_arch(irq);
     
    580580
    581581/* Disconnect irq handler from task */
    582 __native sys_ipc_unregister_irq(int irq)
     582unative_t sys_ipc_unregister_irq(int irq)
    583583{
    584584        if (!(cap_get(TASK) & CAP_IRQ_REG))
     
    586586
    587587        if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL)
    588                 return (__native) ELIMIT;
     588                return (unative_t) ELIMIT;
    589589
    590590        ipc_irq_unregister(&TASK->answerbox, irq);
  • generic/src/lib/elf.c

    r991779c5 r7f1c620  
    9797        /* Walk through all segment headers and process them. */
    9898        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);
    100100                if (rc != EE_OK)
    101101                        return rc;
     
    104104        /* Inspect all section headers and proccess them. */
    105105        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);
    107107                if (rc != EE_OK)
    108108                        return rc;
  • generic/src/lib/func.c

    r991779c5 r7f1c620  
    149149}
    150150
    151 /** Convert ascii representation to __native
     151/** Convert ascii representation to unative_t
    152152 *
    153153 * Supports 0x for hexa & 0 for octal notation.
     
    157157 * @return Converted number or 0 if no valid number ofund
    158158 */
    159 __native atoi(const char *text)
     159unative_t atoi(const char *text)
    160160{
    161161        int base = 10;
    162         __native result = 0;
     162        unative_t result = 0;
    163163
    164164        if (text[0] == '0' && text[1] == 'x') {
  • generic/src/lib/memstr.c

    r991779c5 r7f1c620  
    6262        int i, j;
    6363       
    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) {
    6666                for (i = 0; i < cnt; i++)
    67                         ((__u8 *) dst)[i] = ((__u8 *) src)[i];
     67                        ((uint8_t *) dst)[i] = ((uint8_t *) src)[i];
    6868        } else {
    6969       
    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];
    7272               
    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];
    7575        }
    7676               
     
    8888 *
    8989 */
    90 void _memsetb(__address dst, size_t cnt, __u8 x)
     90void _memsetb(uintptr_t dst, size_t cnt, uint8_t x)
    9191{
    9292        int i;
    93         __u8 *p = (__u8 *) dst;
     93        uint8_t *p = (uint8_t *) dst;
    9494       
    9595        for(i=0; i<cnt; i++)
     
    107107 *
    108108 */
    109 void _memsetw(__address dst, size_t cnt, __u16 x)
     109void _memsetw(uintptr_t dst, size_t cnt, uint16_t x)
    110110{
    111111        int i;
    112         __u16 *p = (__u16 *) dst;
     112        uint16_t *p = (uint16_t *) dst;
    113113       
    114114        for(i=0; i<cnt; i++)
  • generic/src/lib/sort.c

    r991779c5 r7f1c620  
    6464void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b))
    6565{
    66         __u8 buf_tmp[EBUFSIZE];
    67         __u8 buf_pivot[EBUFSIZE];
     66        uint8_t buf_tmp[EBUFSIZE];
     67        uint8_t buf_pivot[EBUFSIZE];
    6868        void * tmp = buf_tmp;
    6969        void * pivot = buf_pivot;
     
    133133void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b))
    134134{
    135         __u8 buf_slot[EBUFSIZE];
     135        uint8_t buf_slot[EBUFSIZE];
    136136        void * slot = buf_slot;
    137137       
     
    185185}
    186186
    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;
     187int 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
     192int 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
     197int 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;
    200200}
    201201
  • generic/src/main/main.c

    r991779c5 r7f1c620  
    102102 * appropriate sizes and addresses.
    103103 */
    104 __address hardcoded_load_address = 0;   /**< Virtual address of where the kernel is loaded. */
     104uintptr_t hardcoded_load_address = 0;   /**< Virtual address of where the kernel is loaded. */
    105105size_t hardcoded_ktext_size = 0;        /**< Size of the kernel code in bytes. */
    106106size_t hardcoded_kdata_size = 0;        /**< Size of the kernel data in bytes. */
     
    133133void main_bsp(void)
    134134{
    135         __address stackaddr;
     135        uintptr_t stackaddr;
    136136
    137137        config.cpu_count = 1;
     
    203203
    204204        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);
    206206
    207207        arch_pre_smp_init();
     
    224224       
    225225        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);
    227227       
    228228        ipc_init();
     
    298298         * switch to this cpu's private stack prior to waking kmp up.
    299299         */
    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);
    301301        context_restore(&CPU->saved_context);
    302302        /* not reached */
  • generic/src/mm/as.c

    r991779c5 r7f1c620  
    9898
    9999static int area_flags_to_page_flags(int aflags);
    100 static as_area_t *find_area_and_lock(as_t *as, __address va);
    101 static bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area);
     100static as_area_t *find_area_and_lock(as_t *as, uintptr_t va);
     101static bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area);
    102102static void sh_info_remove_reference(share_info_t *sh_info);
    103103
     
    200200 * @return Address space area on success or NULL on failure.
    201201 */
    202 as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs,
     202as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs,
    203203               mem_backend_t *backend, mem_backend_data_t *backend_data)
    204204{
     
    239239                a->backend_data = *backend_data;
    240240        else
    241                 memsetb((__address) &a->backend_data, sizeof(a->backend_data), 0);
     241                memsetb((uintptr_t) &a->backend_data, sizeof(a->backend_data), 0);
    242242
    243243        btree_create(&a->used_space);
     
    260260 * @return Zero on success or a value from @ref errno.h otherwise.
    261261 */
    262 int as_area_resize(as_t *as, __address address, size_t size, int flags)
     262int as_area_resize(as_t *as, uintptr_t address, size_t size, int flags)
    263263{
    264264        as_area_t *area;
     
    313313        if (pages < area->pages) {
    314314                bool cond;
    315                 __address start_free = area->base + pages*PAGE_SIZE;
     315                uintptr_t start_free = area->base + pages*PAGE_SIZE;
    316316
    317317                /*
     
    338338                        node = list_get_instance(area->used_space.leaf_head.prev, btree_node_t, leaf_link);
    339339                        if ((cond = (bool) node->keys)) {
    340                                 __address b = node->key[node->keys - 1];
     340                                uintptr_t b = node->key[node->keys - 1];
    341341                                count_t c = (count_t) node->value[node->keys - 1];
    342342                                int i = 0;
     
    419419 * @return Zero on success or a value from @ref errno.h on failure.
    420420 */
    421 int as_area_destroy(as_t *as, __address address)
     421int as_area_destroy(as_t *as, uintptr_t address)
    422422{
    423423        as_area_t *area;
    424         __address base;
     424        uintptr_t base;
    425425        link_t *cur;
    426426        ipl_t ipl;
     
    452452                node = list_get_instance(cur, btree_node_t, leaf_link);
    453453                for (i = 0; i < node->keys; i++) {
    454                         __address b = node->key[i];
     454                        uintptr_t b = node->key[i];
    455455                        count_t j;
    456456                        pte_t *pte;
     
    519519 *         to share non-anonymous address space area is detected.
    520520 */
    521 int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
    522                   as_t *dst_as, __address dst_base, int dst_flags_mask)
     521int 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)
    523523{
    524524        ipl_t ipl;
     
    666666 *         fault was caused by copy_to_uspace() or copy_from_uspace().
    667667 */
    668 int as_page_fault(__address page, pf_access_t access, istate_t *istate)
     668int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate)
    669669{
    670670        pte_t *pte;
     
    745745        if (THREAD->in_copy_from_uspace) {
    746746                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);
    748748        } else if (THREAD->in_copy_to_uspace) {
    749749                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);
    751751        } else {
    752752                return AS_PF_FAULT;
     
    943943 * @return Locked address space area containing va on success or NULL on failure.
    944944 */
    945 as_area_t *find_area_and_lock(as_t *as, __address va)
     945as_area_t *find_area_and_lock(as_t *as, uintptr_t va)
    946946{
    947947        as_area_t *a;
     
    999999 * @return True if there is no conflict, false otherwise.
    10001000 */
    1001 bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area)
     1001bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area)
    10021002{
    10031003        as_area_t *a;
     
    10721072
    10731073/** Return size of the address space area with given base.  */
    1074 size_t as_get_size(__address base)
     1074size_t as_get_size(uintptr_t base)
    10751075{
    10761076        ipl_t ipl;
     
    11001100 * @return 0 on failure and 1 on success.
    11011101 */
    1102 int used_space_insert(as_area_t *a, __address page, count_t count)
     1102int used_space_insert(as_area_t *a, uintptr_t page, count_t count)
    11031103{
    11041104        btree_node_t *leaf, *node;
     
    11241124        node = btree_leaf_node_left_neighbour(&a->used_space, leaf);
    11251125        if (node) {
    1126                 __address left_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];
    11271127                count_t left_cnt = (count_t) node->value[node->keys - 1], right_cnt = (count_t) leaf->value[0];
    11281128               
     
    11671167                }
    11681168        } else if (page < leaf->key[0]) {
    1169                 __address right_pg = leaf->key[0];
     1169                uintptr_t right_pg = leaf->key[0];
    11701170                count_t right_cnt = (count_t) leaf->value[0];
    11711171       
     
    11981198        node = btree_leaf_node_right_neighbour(&a->used_space, leaf);
    11991199        if (node) {
    1200                 __address left_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];
    12011201                count_t left_cnt = (count_t) leaf->value[leaf->keys - 1], right_cnt = (count_t) node->value[0];
    12021202               
     
    12411241                }
    12421242        } else if (page >= leaf->key[leaf->keys - 1]) {
    1243                 __address left_pg = leaf->key[leaf->keys - 1];
     1243                uintptr_t left_pg = leaf->key[leaf->keys - 1];
    12441244                count_t left_cnt = (count_t) leaf->value[leaf->keys - 1];
    12451245       
     
    12731273        for (i = 1; i < leaf->keys; i++) {
    12741274                if (page < leaf->key[i]) {
    1275                         __address left_pg = leaf->key[i - 1], right_pg = leaf->key[i];
     1275                        uintptr_t left_pg = leaf->key[i - 1], right_pg = leaf->key[i];
    12761276                        count_t left_cnt = (count_t) leaf->value[i - 1], right_cnt = (count_t) leaf->value[i];
    12771277
     
    13271327 * @return 0 on failure and 1 on success.
    13281328 */
    1329 int used_space_remove(as_area_t *a, __address page, count_t count)
     1329int used_space_remove(as_area_t *a, uintptr_t page, count_t count)
    13301330{
    13311331        btree_node_t *leaf, *node;
     
    13641364        node = btree_leaf_node_left_neighbour(&a->used_space, leaf);
    13651365        if (node && page < leaf->key[0]) {
    1366                 __address left_pg = node->key[node->keys - 1];
     1366                uintptr_t left_pg = node->key[node->keys - 1];
    13671367                count_t left_cnt = (count_t) node->value[node->keys - 1];
    13681368
     
    13971397       
    13981398        if (page > leaf->key[leaf->keys - 1]) {
    1399                 __address left_pg = leaf->key[leaf->keys - 1];
     1399                uintptr_t left_pg = leaf->key[leaf->keys - 1];
    14001400                count_t left_cnt = (count_t) leaf->value[leaf->keys - 1];
    14011401
     
    14331433        for (i = 1; i < leaf->keys - 1; i++) {
    14341434                if (page < leaf->key[i]) {
    1435                         __address left_pg = leaf->key[i - 1];
     1435                        uintptr_t left_pg = leaf->key[i - 1];
    14361436                        count_t left_cnt = (count_t) leaf->value[i - 1];
    14371437
     
    14971497                        node = list_get_instance(cur, btree_node_t, leaf_link);
    14981498                        for (i = 0; i < node->keys; i++)
    1499                                 frame_free((__address) node->value[i]);
     1499                                frame_free((uintptr_t) node->value[i]);
    15001500                }
    15011501               
     
    15141514
    15151515/** Wrapper for as_area_create(). */
    1516 __native sys_as_area_create(__address address, size_t size, int flags)
     1516unative_t sys_as_area_create(uintptr_t address, size_t size, int flags)
    15171517{
    15181518        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;
    15201520        else
    1521                 return (__native) -1;
     1521                return (unative_t) -1;
    15221522}
    15231523
    15241524/** Wrapper for as_area_resize. */
    1525 __native sys_as_area_resize(__address address, size_t size, int flags)
    1526 {
    1527         return (__native) as_area_resize(AS, address, size, 0);
     1525unative_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);
    15281528}
    15291529
    15301530/** Wrapper for as_area_destroy. */
    1531 __native sys_as_area_destroy(__address address)
    1532 {
    1533         return (__native) as_area_destroy(AS, address);
     1531unative_t sys_as_area_destroy(uintptr_t address)
     1532{
     1533        return (unative_t) as_area_destroy(AS, address);
    15341534}
    15351535
  • generic/src/mm/backend_anon.c

    r991779c5 r7f1c620  
    5252#include <arch.h>
    5353
    54 static int anon_page_fault(as_area_t *area, __address addr, pf_access_t access);
    55 static void anon_frame_free(as_area_t *area, __address page, __address frame);
     54static int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access);
     55static void anon_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame);
    5656static void anon_share(as_area_t *area);
    5757
     
    7272 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced).
    7373 */
    74 int anon_page_fault(as_area_t *area, __address addr, pf_access_t access)
     74int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
    7575{
    76         __address frame;
     76        uintptr_t frame;
    7777
    7878        if (!as_area_check_access(area, access))
     
    8989                 */
    9090                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,
    9292                        ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf);
    9393                if (!frame) {
     
    106106                        }
    107107                        if (allocate) {
    108                                 frame = (__address) frame_alloc(ONE_FRAME, 0);
     108                                frame = (uintptr_t) frame_alloc(ONE_FRAME, 0);
    109109                                memsetb(PA2KA(frame), FRAME_SIZE, 0);
    110110                               
     
    133133                 *   the different causes
    134134                 */
    135                 frame = (__address)frame_alloc(ONE_FRAME, 0);
     135                frame = (uintptr_t)frame_alloc(ONE_FRAME, 0);
    136136                memsetb(PA2KA(frame), FRAME_SIZE, 0);
    137137        }
     
    157157 * @param frame Frame to be released.
    158158 */
    159 void anon_frame_free(as_area_t *area, __address page, __address frame)
     159void anon_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame)
    160160{
    161161        frame_free(frame);
     
    185185                node = list_get_instance(cur, btree_node_t, leaf_link);
    186186                for (i = 0; i < node->keys; i++) {
    187                         __address base = node->key[i];
     187                        uintptr_t base = node->key[i];
    188188                        count_t count = (count_t) node->value[i];
    189189                        int j;
  • generic/src/mm/backend_elf.c

    r991779c5 r7f1c620  
    5151#include <arch.h>
    5252
    53 static int elf_page_fault(as_area_t *area, __address addr, pf_access_t access);
    54 static void elf_frame_free(as_area_t *area, __address page, __address frame);
     53static int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access);
     54static void elf_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame);
    5555static void elf_share(as_area_t *area);
    5656
     
    7171 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced).
    7272 */
    73 int elf_page_fault(as_area_t *area, __address addr, pf_access_t access)
     73int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
    7474{
    7575        elf_header_t *elf = area->backend_data.elf;
    7676        elf_segment_header_t *entry = area->backend_data.segment;
    7777        btree_node_t *leaf;
    78         __address base, frame;
     78        uintptr_t base, frame;
    7979        index_t i;
    8080
     
    8484        ASSERT((addr >= entry->p_vaddr) && (addr < entry->p_vaddr + entry->p_memsz));
    8585        i = (addr - entry->p_vaddr) >> PAGE_WIDTH;
    86         base = (__address) (((void *) elf) + entry->p_offset);
     86        base = (uintptr_t) (((void *) elf) + entry->p_offset);
    8787        ASSERT(ALIGN_UP(base, FRAME_SIZE) == base);
    8888
     
    9595                 
    9696                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,
    9898                        ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf);
    9999                if (!frame) {
     
    135135                 */
    136136                if (entry->p_flags & PF_W) {
    137                         frame = (__address)frame_alloc(ONE_FRAME, 0);
     137                        frame = (uintptr_t)frame_alloc(ONE_FRAME, 0);
    138138                        memcpy((void *) PA2KA(frame), (void *) (base + i*FRAME_SIZE), FRAME_SIZE);
    139139                       
     
    154154                 * and cleared.
    155155                 */
    156                 frame = (__address)frame_alloc(ONE_FRAME, 0);
     156                frame = (uintptr_t)frame_alloc(ONE_FRAME, 0);
    157157                memsetb(PA2KA(frame), FRAME_SIZE, 0);
    158158
     
    171171                 */
    172172                size = entry->p_filesz - (i<<PAGE_WIDTH);
    173                 frame = (__address)frame_alloc(ONE_FRAME, 0);
     173                frame = (uintptr_t)frame_alloc(ONE_FRAME, 0);
    174174                memsetb(PA2KA(frame) + size, FRAME_SIZE - size, 0);
    175175                memcpy((void *) PA2KA(frame), (void *) (base + i*FRAME_SIZE), size);
     
    202202 *
    203203 */
    204 void elf_frame_free(as_area_t *area, __address page, __address frame)
     204void elf_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame)
    205205{
    206206        elf_header_t *elf = area->backend_data.elf;
    207207        elf_segment_header_t *entry = area->backend_data.segment;
    208         __address base;
     208        uintptr_t base;
    209209        index_t i;
    210210       
    211211        ASSERT((page >= entry->p_vaddr) && (page < entry->p_vaddr + entry->p_memsz));
    212212        i = (page - entry->p_vaddr) >> PAGE_WIDTH;
    213         base = (__address) (((void *) elf) + entry->p_offset);
     213        base = (uintptr_t) (((void *) elf) + entry->p_offset);
    214214        ASSERT(ALIGN_UP(base, FRAME_SIZE) == base);
    215215       
     
    246246        link_t *cur;
    247247        btree_node_t *leaf, *node;
    248         __address start_anon = entry->p_vaddr + entry->p_filesz;
     248        uintptr_t start_anon = entry->p_vaddr + entry->p_filesz;
    249249
    250250        /*
     
    270270               
    271271                for (i = 0; i < node->keys; i++) {
    272                         __address base = node->key[i];
     272                        uintptr_t base = node->key[i];
    273273                        count_t count = (count_t) node->value[i];
    274274                        int j;
  • generic/src/mm/backend_phys.c

    r991779c5 r7f1c620  
    4747#include <align.h>
    4848
    49 static int phys_page_fault(as_area_t *area, __address addr, pf_access_t access);
     49static int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access);
    5050static void phys_share(as_area_t *area);
    5151
     
    6666 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced).
    6767 */
    68 int phys_page_fault(as_area_t *area, __address addr, pf_access_t access)
     68int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
    6969{
    70         __address base = area->backend_data.base;
     70        uintptr_t base = area->backend_data.base;
    7171
    7272        if (!as_area_check_access(area, access))
  • generic/src/mm/buddy.c

    r991779c5 r7f1c620  
    6767 */
    6868void buddy_system_create(buddy_system_t *b,
    69                          __u8 max_order,
     69                         uint8_t max_order,
    7070                         buddy_system_operations_t *op,
    7171                         void *data)
     
    102102 * @return True if block can be allocated
    103103 */
    104 bool buddy_system_can_alloc(buddy_system_t *b, __u8 i) {
    105         __u8 k;
     104bool buddy_system_can_alloc(buddy_system_t *b, uint8_t i) {
     105        uint8_t k;
    106106       
    107107        /*
     
    131131{
    132132        link_t *left,*right, *tmp;
    133         __u8 order;
     133        uint8_t order;
    134134
    135135        left = b->op->find_block(b, block, BUDDY_SYSTEM_INNER_BLOCK);
     
    168168 * @return Block of data represented by link_t.
    169169 */
    170 link_t *buddy_system_alloc(buddy_system_t *b, __u8 i)
     170link_t *buddy_system_alloc(buddy_system_t *b, uint8_t i)
    171171{
    172172        link_t *res, *hlp;
     
    231231{
    232232        link_t *buddy, *hlp;
    233         __u8 i;
     233        uint8_t i;
    234234
    235235        /*
  • generic/src/mm/frame.c

    r991779c5 r7f1c620  
    7070typedef struct {
    7171        count_t refcount;       /**< tracking of shared frames  */
    72         __u8 buddy_order;       /**< buddy system block order */
     72        uint8_t buddy_order;    /**< buddy system block order */
    7373        link_t buddy_link;      /**< link to the next free block inside one order */
    7474        void *parent;           /**< If allocated by slab, this points there */
     
    218218
    219219/** @return True if zone can allocate specified order */
    220 static int zone_can_alloc(zone_t *z, __u8 order)
     220static int zone_can_alloc(zone_t *z, uint8_t order)
    221221{
    222222        return buddy_system_can_alloc(z->buddy_system, order);
     
    231231 * @param pzone Pointer to preferred zone or NULL, on return contains zone number
    232232 */
    233 static zone_t * find_free_zone_lock(__u8 order, int *pzone)
     233static zone_t * find_free_zone_lock(uint8_t order, int *pzone)
    234234{
    235235        int i;
     
    272272 */
    273273static link_t *zone_buddy_find_block(buddy_system_t *b, link_t *child,
    274                                      __u8 order)
     274                                     uint8_t order)
    275275{
    276276        frame_t * frame;
     
    381381 * @param order Order to set
    382382 */
    383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8 order) {
     383static void zone_buddy_set_order(buddy_system_t *b, link_t * block, uint8_t order) {
    384384        frame_t * frame;
    385385        frame = list_get_instance(block, frame_t, buddy_link);
     
    394394 * @return Order of block
    395395 */
    396 static __u8 zone_buddy_get_order(buddy_system_t *b, link_t * block) {
     396static uint8_t zone_buddy_get_order(buddy_system_t *b, link_t * block) {
    397397        frame_t * frame;
    398398        frame = list_get_instance(block, frame_t, buddy_link);
     
    451451 *
    452452 */
    453 static pfn_t zone_frame_alloc(zone_t *zone, __u8 order)
     453static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
    454454{
    455455        pfn_t v;
     
    484484{
    485485        frame_t *frame;
    486         __u8 order;
     486        uint8_t order;
    487487
    488488        frame = &zone->frames[frame_idx];
     
    538538static void _zone_merge(zone_t *z, zone_t *z1, zone_t *z2)
    539539{
    540         __u8 max_order;
     540        uint8_t max_order;
    541541        int i, z2idx;
    542542        pfn_t frame_idx;
     
    625625        int i;
    626626
    627         pfn = ADDR2PFN((__address)KA2PA(oldzone));
     627        pfn = ADDR2PFN((uintptr_t)KA2PA(oldzone));
    628628        cframes = SIZE2FRAMES(zone_conf_size(oldzone->count));
    629629       
     
    654654{
    655655        count_t i;
    656         __u8 order;
     656        uint8_t order;
    657657        frame_t *frame;
    658658       
     
    690690        zone_t *zone1, *zone2, *newzone;
    691691        int cframes;
    692         __u8 order;
     692        uint8_t order;
    693693        int i;
    694694        pfn_t pfn;
     
    780780{
    781781        int i;
    782         __u8 max_order;
     782        uint8_t max_order;
    783783
    784784        spinlock_initialize(&z->lock, "zone_lock");
     
    818818 * @return Size of zone configuration info (in bytes)
    819819 */
    820 __address zone_conf_size(count_t count)
     820uintptr_t zone_conf_size(count_t count)
    821821{
    822822        int size = sizeof(zone_t) + count*sizeof(frame_t);
     
    846846{
    847847        zone_t *z;
    848         __address addr;
     848        uintptr_t addr;
    849849        count_t confcount;
    850850        int i;
     
    932932 *
    933933 */
    934 void * frame_alloc_generic(__u8 order, int flags, int *pzone)
     934void * frame_alloc_generic(uint8_t order, int flags, int *pzone)
    935935{
    936936        ipl_t ipl;
     
    991991 * @param Frame Physical Address of of the frame to be freed.
    992992 */
    993 void frame_free(__address frame)
     993void frame_free(uintptr_t frame)
    994994{
    995995        ipl_t ipl;
     
    11001100                zone = zones.info[i];
    11011101                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);
    11031103                spinlock_unlock(&zone->lock);
    11041104        }
     
    11321132        spinlock_lock(&zone->lock);
    11331133        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));
    11351135        printf("Zone size: %zd frames (%zdK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10);
    11361136        printf("Allocated space: %zd frames (%zdK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10);
  • generic/src/mm/page.c

    r991779c5 r7f1c620  
    7070 * @param size Size of the structure.
    7171 */
    72 void map_structure(__address s, size_t size)
     72void map_structure(uintptr_t s, size_t size)
    7373{
    7474        int i, cnt, length;
     
    9494 * @param flags Flags to be used for mapping.
    9595 */
    96 void page_mapping_insert(as_t *as, __address page, __address frame, int flags)
     96void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags)
    9797{
    9898        ASSERT(page_mapping_operations);
     
    113113 * @param page Virtual address of the page to be demapped.
    114114 */
    115 void page_mapping_remove(as_t *as, __address page)
     115void page_mapping_remove(as_t *as, uintptr_t page)
    116116{
    117117        ASSERT(page_mapping_operations);
     
    132132 * @return NULL if there is no such mapping; requested mapping otherwise.
    133133 */
    134 pte_t *page_mapping_find(as_t *as, __address page)
     134pte_t *page_mapping_find(as_t *as, uintptr_t page)
    135135{
    136136        ASSERT(page_mapping_operations);
  • generic/src/mm/slab.c

    r991779c5 r7f1c620  
    550550        cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0);
    551551        for (i=0; i < config.cpu_count; i++) {
    552                 memsetb((__address)&cache->mag_cache[i],
     552                memsetb((uintptr_t)&cache->mag_cache[i],
    553553                        sizeof(cache->mag_cache[i]), 0);
    554554                spinlock_initialize(&cache->mag_cache[i].lock,
     
    570570        ipl_t ipl;
    571571
    572         memsetb((__address)cache, sizeof(*cache), 0);
     572        memsetb((uintptr_t)cache, sizeof(*cache), 0);
    573573        cache->name = name;
    574574
    575         if (align < sizeof(__native))
    576                 align = sizeof(__native);
     575        if (align < sizeof(unative_t))
     576                align = sizeof(unative_t);
    577577        size = ALIGN_UP(size, align);
    578578               
     
    821821                           "slab_magazine",
    822822                           sizeof(slab_magazine_t)+SLAB_MAG_SIZE*sizeof(void*),
    823                            sizeof(__address),
     823                           sizeof(uintptr_t),
    824824                           NULL, NULL,
    825825                           SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE);
     
    828828                           "slab_cache",
    829829                           sizeof(slab_cache_cache),
    830                            sizeof(__address),
     830                           sizeof(uintptr_t),
    831831                           NULL, NULL,
    832832                           SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE);
  • generic/src/mm/tlb.c

    r991779c5 r7f1c620  
    7979 * @param count Number of pages, if required by type.
    8080 */
    81 void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, __address page, count_t count)
     81void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count)
    8282{
    8383        int i;
     
    142142        tlb_invalidate_type_t type;
    143143        asid_t asid;
    144         __address page;
     144        uintptr_t page;
    145145        count_t count;
    146146        int i;
  • generic/src/printf/printf_core.c

    r991779c5 r7f1c620  
    8989 * @return string length without trailing zero.
    9090 */
    91 static __native strlen(const char *str)
    92 {
    93         __native counter = 0;
     91static unative_t strlen(const char *str)
     92{
     93        unative_t counter = 0;
    9494
    9595        while (str[counter] != 0) {
     
    147147 * @return number of printed characters, negative value on fail
    148148 */
    149 static int print_char(char c, int width, __u64 flags, struct printf_spec *ps)
     149static int print_char(char c, int width, uint64_t flags, struct printf_spec *ps)
    150150{
    151151        int counter = 0;
     
    177177 */
    178178                                               
    179 static int print_string(char *s, int width, int precision, __u64 flags, struct printf_spec *ps)
     179static int print_string(char *s, int width, int precision, uint64_t flags, struct printf_spec *ps)
    180180{
    181181        int counter = 0;
     
    237237 *
    238238 */
    239 static int print_number(__u64 num, int width, int precision, int base , __u64 flags, struct printf_spec *ps)
     239static int print_number(uint64_t num, int width, int precision, int base , uint64_t flags, struct printf_spec *ps)
    240240{
    241241        char *digits = digits_small;
     
    428428 *      - "l"   Signed or usigned long int.@n
    429429 *      - "ll"  Signed or usigned long long int.@n
    430  *      - "z"   __native (non-standard extension).@n
     430 *      - "z"   unative_t (non-standard extension).@n
    431431 *
    432432 *
     
    467467        qualifier_t qualifier;  /* type of argument */
    468468        int base;       /**< base in which will be parameter (numbers only) printed */
    469         __u64 number; /**< argument value */
     469        uint64_t number; /**< argument value */
    470470        size_t  size; /**< byte size of integer parameter */
    471471        int width, precision;
    472         __u64 flags;
     472        uint64_t flags;
    473473       
    474474        counter = 0;
     
    563563                                        }
    564564                                        break;
    565                                 case 'z':       /* __native */
     565                                case 'z':       /* unative_t */
    566566                                        qualifier = PrintfQualifierNative;
    567567                                        break;
     
    645645                                case PrintfQualifierByte:
    646646                                        size = sizeof(unsigned char);
    647                                         number = (__u64)va_arg(ap, unsigned int);
     647                                        number = (uint64_t)va_arg(ap, unsigned int);
    648648                                        break;
    649649                                case PrintfQualifierShort:
    650650                                        size = sizeof(unsigned short);
    651                                         number = (__u64)va_arg(ap, unsigned int);
     651                                        number = (uint64_t)va_arg(ap, unsigned int);
    652652                                        break;
    653653                                case PrintfQualifierInt:
    654654                                        size = sizeof(unsigned int);
    655                                         number = (__u64)va_arg(ap, unsigned int);
     655                                        number = (uint64_t)va_arg(ap, unsigned int);
    656656                                        break;
    657657                                case PrintfQualifierLong:
    658658                                        size = sizeof(unsigned long);
    659                                         number = (__u64)va_arg(ap, unsigned long);
     659                                        number = (uint64_t)va_arg(ap, unsigned long);
    660660                                        break;
    661661                                case PrintfQualifierLongLong:
    662662                                        size = sizeof(unsigned long long);
    663                                         number = (__u64)va_arg(ap, unsigned long long);
     663                                        number = (uint64_t)va_arg(ap, unsigned long long);
    664664                                        break;
    665665                                case PrintfQualifierPointer:
    666666                                        size = sizeof(void *);
    667                                         number = (__u64)(unsigned long)va_arg(ap, void *);
     667                                        number = (uint64_t)(unsigned long)va_arg(ap, void *);
    668668                                        break;
    669669                                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);
    672672                                        break;
    673673                                default: /* Unknown qualifier */
     
    680680                                        flags |= __PRINTF_FLAG_NEGATIVE;
    681681                               
    682                                         if (size == sizeof(__u64)) {
    683                                                 number = -((__s64)number);
     682                                        if (size == sizeof(uint64_t)) {
     683                                                number = -((int64_t)number);
    684684                                        } else {
    685685                                                number = ~number;
     
    704704       
    705705        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 */
    707707                        counter = -counter;
    708708                        goto out;
  • generic/src/proc/scheduler.c

    r991779c5 r7f1c620  
    350350         */
    351351        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);
    353353        context_restore(&CPU->saved_context);
    354354        /* not reached */
  • generic/src/proc/task.c

    r991779c5 r7f1c620  
    241241 * @return 0 on success or an error code from @ref errno.h.
    242242 */
    243 __native sys_task_get_id(task_id_t *uspace_task_id)
     243unative_t sys_task_get_id(task_id_t *uspace_task_id)
    244244{
    245245        /*
     
    247247         * remains constant for the lifespan of the task.
    248248         */
    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));
    250250}
    251251
  • generic/src/proc/thread.c

    r991779c5 r7f1c620  
    9191
    9292SPINLOCK_INITIALIZE(tidlock);
    93 __u32 last_tid = 0;
     93uint32_t last_tid = 0;
    9494
    9595static slab_cache_t *thread_slab;
     
    255255
    256256        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);
    258258        spinlock_unlock(&threads_lock);
    259259
     
    300300       
    301301        /* 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);
    303303       
    304304        ipl = interrupts_disable();
     
    309309       
    310310        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);
    312312       
    313313        the_initialize((the_t *) t->kstack);
     
    369369         */
    370370        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);
    372372        spinlock_unlock(&threads_lock);
    373373       
     
    412412 *
    413413 */
    414 void thread_sleep(__u32 sec)
     414void thread_sleep(uint32_t sec)
    415415{
    416416        thread_usleep(sec*1000000);
     
    425425 * @return An error code from errno.h or an error code from synch.h.
    426426 */
    427 int thread_join_timeout(thread_t *t, __u32 usec, int flags)
     427int thread_join_timeout(thread_t *t, uint32_t usec, int flags)
    428428{
    429429        ipl_t ipl;
     
    485485 *
    486486 */     
    487 void thread_usleep(__u32 usec)
     487void thread_usleep(uint32_t usec)
    488488{
    489489        waitq_t wq;
     
    565565        btree_node_t *leaf;
    566566       
    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;
    568568}
    569569
     
    571571 *
    572572 */
    573 __native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
     573unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
    574574{
    575575        thread_t *t;
    576576        char namebuf[THREAD_NAME_BUFLEN];
    577577        uspace_arg_t *kernel_uarg;
    578         __u32 tid;
     578        uint32_t tid;
    579579        int rc;
    580580
    581581        rc = copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN);
    582582        if (rc != 0)
    583                 return (__native) rc;
     583                return (unative_t) rc;
    584584
    585585        kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
     
    587587        if (rc != 0) {
    588588                free(kernel_uarg);
    589                 return (__native) rc;
     589                return (unative_t) rc;
    590590        }
    591591
     
    593593                tid = t->tid;
    594594                thread_ready(t);
    595                 return (__native) tid;
     595                return (unative_t) tid;
    596596        } else {
    597597                free(kernel_uarg);
    598598        }
    599599
    600         return (__native) ENOMEM;
     600        return (unative_t) ENOMEM;
    601601}
    602602
     
    604604 *
    605605 */
    606 __native sys_thread_exit(int uspace_status)
     606unative_t sys_thread_exit(int uspace_status)
    607607{
    608608        thread_exit();
  • generic/src/security/cap.c

    r991779c5 r7f1c620  
    9595 * @return Zero on success or an error code from @ref errno.h.
    9696 */
    97 __native sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)
     97unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)
    9898{
    9999        sysarg64_t taskid_arg;
     
    103103       
    104104        if (!(cap_get(TASK) & CAP_CAP))
    105                 return (__native) EPERM;
     105                return (unative_t) EPERM;
    106106       
    107107        rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
    108108        if (rc != 0)
    109                 return (__native) rc;
     109                return (unative_t) rc;
    110110               
    111111        ipl = interrupts_disable();
     
    115115                spinlock_unlock(&tasks_lock);
    116116                interrupts_restore(ipl);
    117                 return (__native) ENOENT;
     117                return (unative_t) ENOENT;
    118118        }
    119119       
     
    140140 * @return Zero on success or an error code from @ref errno.h.
    141141 */
    142 __native sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps)
     142unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps)
    143143{
    144144        sysarg64_t taskid_arg;
     
    149149        rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
    150150        if (rc != 0)
    151                 return (__native) rc;
     151                return (unative_t) rc;
    152152
    153153        ipl = interrupts_disable();
     
    157157                spinlock_unlock(&tasks_lock);
    158158                interrupts_restore(ipl);
    159                 return (__native) ENOENT;
     159                return (unative_t) ENOENT;
    160160        }
    161161
     
    168168                spinlock_unlock(&tasks_lock);
    169169                interrupts_restore(ipl);
    170                 return (__native) EPERM;
     170                return (unative_t) EPERM;
    171171        }
    172172       
  • generic/src/synch/condvar.c

    r991779c5 r7f1c620  
    8888 * @return See comment for waitq_sleep_timeout().
    8989 */
    90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec, int flags)
     90int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)
    9191{
    9292        int rc;
  • generic/src/synch/futex.c

    r991779c5 r7f1c620  
    5959static void futex_initialize(futex_t *futex);
    6060
    61 static futex_t *futex_find(__address paddr);
    62 static index_t futex_ht_hash(__native *key);
    63 static bool futex_ht_compare(__native *key, count_t keys, link_t *item);
     61static futex_t *futex_find(uintptr_t paddr);
     62static index_t futex_ht_hash(unative_t *key);
     63static bool futex_ht_compare(unative_t *key, count_t keys, link_t *item);
    6464static void futex_ht_remove_callback(link_t *item);
    6565
     
    109109 *         If there is no physical mapping for uaddr ENOENT is returned.
    110110 */
    111 __native sys_futex_sleep_timeout(__address uaddr, __u32 usec, int flags)
    112 {
    113         futex_t *futex;
    114         __address paddr;
     111unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags)
     112{
     113        futex_t *futex;
     114        uintptr_t paddr;
    115115        pte_t *t;
    116116        ipl_t ipl;
     
    126126                page_table_unlock(AS, true);
    127127                interrupts_restore(ipl);
    128                 return (__native) ENOENT;
     128                return (unative_t) ENOENT;
    129129        }
    130130        paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
     
    135135        futex = futex_find(paddr);
    136136       
    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);
    138138}
    139139
     
    144144 * @return ENOENT if there is no physical mapping for uaddr.
    145145 */
    146 __native sys_futex_wakeup(__address uaddr)
    147 {
    148         futex_t *futex;
    149         __address paddr;
     146unative_t sys_futex_wakeup(uintptr_t uaddr)
     147{
     148        futex_t *futex;
     149        uintptr_t paddr;
    150150        pte_t *t;
    151151        ipl_t ipl;
     
    161161                page_table_unlock(AS, true);
    162162                interrupts_restore(ipl);
    163                 return (__native) ENOENT;
     163                return (unative_t) ENOENT;
    164164        }
    165165        paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
     
    183183 * @return Address of the kernel futex structure.
    184184 */
    185 futex_t *futex_find(__address paddr)
     185futex_t *futex_find(uintptr_t paddr)
    186186{
    187187        link_t *item;
     
    276276 * @return Index into futex hash table.
    277277 */
    278 index_t futex_ht_hash(__native *key)
     278index_t futex_ht_hash(unative_t *key)
    279279{
    280280        return *key & (FUTEX_HT_SIZE-1);
     
    287287 * @return True if the item matches the key. False otherwise.
    288288 */
    289 bool futex_ht_compare(__native *key, count_t keys, link_t *item)
     289bool futex_ht_compare(unative_t *key, count_t keys, link_t *item)
    290290{
    291291        futex_t *futex;
     
    324324                for (i = 0; i < node->keys; i++) {
    325325                        futex_t *ftx;
    326                         __address paddr = node->key[i];
     326                        uintptr_t paddr = node->key[i];
    327327                       
    328328                        ftx = (futex_t *) node->value[i];
  • generic/src/synch/mutex.c

    r991779c5 r7f1c620  
    6565 * @return See comment for waitq_sleep_timeout().
    6666 */
    67 int _mutex_lock_timeout(mutex_t *mtx, __u32 usec, int flags)
     67int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags)
    6868{
    6969        return _semaphore_down_timeout(&mtx->sem, usec, flags);
  • generic/src/synch/rwlock.c

    r991779c5 r7f1c620  
    102102 * @return See comment for waitq_sleep_timeout().
    103103 */
    104 int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32 usec, int flags)
     104int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags)
    105105{
    106106        ipl_t ipl;
     
    156156 * @return See comment for waitq_sleep_timeout().
    157157 */
    158 int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32 usec, int flags)
     158int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags)
    159159{
    160160        int rc;
  • generic/src/synch/semaphore.c

    r991779c5 r7f1c620  
    7979 * @return See comment for waitq_sleep_timeout().
    8080 */
    81 int _semaphore_down_timeout(semaphore_t *s, __u32 usec, int flags)
     81int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags)
    8282{
    8383        return waitq_sleep_timeout(&s->wq, usec, flags);
  • generic/src/synch/spinlock.c

    r991779c5 r7f1c620  
    109109                if (i++ > DEADLOCK_THRESHOLD) {
    110110                        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);
    112112                        symbol = get_symtab_entry(CALLER);
    113113                        if (symbol)
  • generic/src/synch/waitq.c

    r991779c5 r7f1c620  
    215215 * attempted.
    216216 */
    217 int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int flags)
     217int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags)
    218218{
    219219        ipl_t ipl;
     
    298298 * @return See waitq_sleep_timeout().
    299299 */
    300 int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32 usec, int flags)
     300int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags)
    301301{
    302302        /* checks whether to go to sleep at all */
     
    352352                }
    353353                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);
    355355        }
    356356
  • generic/src/syscall/copy.c

    r991779c5 r7f1c620  
    6868       
    6969        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
    70                 if (overlaps((__address) uspace_src, size,
     70                if (overlaps((uintptr_t) uspace_src, size,
    7171                        KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) {
    7272                        /*
     
    109109       
    110110        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
    111                 if (overlaps((__address) uspace_dst, size,
     111                if (overlaps((uintptr_t) uspace_dst, size,
    112112                        KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) {
    113113                        /*
  • generic/src/syscall/syscall.c

    r991779c5 r7f1c620  
    5959 * this syscall to facilitate it.
    6060 */
    61 static __native sys_io(int fd, const void * buf, size_t count)
     61static unative_t sys_io(int fd, const void * buf, size_t count)
    6262{
    6363        size_t i;
     
    8686
    8787/** Tell kernel to get keyboard/console access again */
    88 static __native sys_debug_enable_console(void)
     88static unative_t sys_debug_enable_console(void)
    8989{
    9090        arch_grab_console();
     
    9393
    9494/** Dispatch system call */
    95 __native syscall_handler(__native a1, __native a2, __native a3,
    96                          __native a4, __native id)
     95unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3,
     96                         unative_t a4, unative_t id)
    9797{
    98         __native rc;
     98        unative_t rc;
    9999
    100100        if (id < SYSCALL_END)
  • generic/src/sysinfo/sysinfo.c

    r991779c5 r7f1c620  
    168168}
    169169
    170 void sysinfo_set_item_val(const char *name, sysinfo_item_t **root, __native val)
     170void sysinfo_set_item_val(const char *name, sysinfo_item_t **root, unative_t val)
    171171{
    172172        if (root == NULL)
     
    223223        while (root != NULL) {
    224224                int i;
    225                 __native val = 0;
     225                unative_t val = 0;
    226226                char *vtype = NULL;
    227227               
     
    279279}
    280280
    281 __native sys_sysinfo_valid(__native ptr, __native len)
     281unative_t sys_sysinfo_valid(unative_t ptr, unative_t len)
    282282{
    283283        char *str;
     
    293293}
    294294
    295 __native sys_sysinfo_value(__native ptr, __native len)
     295unative_t sys_sysinfo_value(unative_t ptr, unative_t len)
    296296{
    297297        char *str;
  • generic/src/time/clock.c

    r991779c5 r7f1c620  
    5858/* Pointers to public variables with time */
    5959struct ptime {
    60         __native seconds1;
    61         __native useconds;
    62         __native seconds2;
     60        unative_t seconds1;
     61        unative_t useconds;
     62        unative_t seconds2;
    6363};
    6464struct ptime *public_time;
     
    6666 * seconds correctly
    6767 */
    68 static __native secfrag = 0;
     68static unative_t secfrag = 0;
    6969
    7070/** Initialize realtime clock counter
     
    9191        public_time->useconds = 0;
    9292
    93         sysinfo_set_item_val("clock.faddr", NULL, (__native)faddr);
     93        sysinfo_set_item_val("clock.faddr", NULL, (unative_t)faddr);
    9494}
    9595
     
    166166
    167167        if (THREAD) {
    168                 __u64 ticks;
     168                uint64_t ticks;
    169169               
    170170                spinlock_lock(&CPU->lock);
  • generic/src/time/delay.c

    r991779c5 r7f1c620  
    5050 * @param usec Number of microseconds to sleep.
    5151 */
    52 void delay(__u32 usec)
     52void delay(uint32_t usec)
    5353{
    5454        ipl_t ipl;
  • generic/src/time/timeout.c

    r991779c5 r7f1c620  
    104104 *
    105105 */
    106 void timeout_register(timeout_t *t, __u64 time, timeout_handler_t f, void *arg)
     106void timeout_register(timeout_t *t, uint64_t time, timeout_handler_t f, void *arg)
    107107{
    108108        timeout_t *hlp = NULL;
    109109        link_t *l, *m;
    110110        ipl_t ipl;
    111         __u64 sum;
     111        uint64_t sum;
    112112
    113113        ipl = interrupts_disable();
Note: See TracChangeset for help on using the changeset viewer.