Changeset 7f1c620 in mainline for arch/mips32/src


Ignore:
Timestamp:
2006-07-04T17:17:56Z (20 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:
arch/mips32/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/ddi/ddi.c

    r991779c5 r7f1c620  
    5151 * @return 0 on success or an error code from errno.h.
    5252 */
    53 int ddi_iospace_enable_arch(task_t *task, __address ioaddr, size_t size)
     53int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size)
    5454{
    5555        return 0;
  • arch/mips32/src/debugger.c

    r991779c5 r7f1c620  
    9292
    9393static struct {
    94         __u32 andmask;
    95         __u32 value;
     94        uint32_t andmask;
     95        uint32_t value;
    9696}jmpinstr[] = {
    9797        {0xf3ff0000, 0x41000000}, /* BCzF */
     
    126126 * @return true - it is jump instruction, false otherwise
    127127 */
    128 static bool is_jump(__native instr)
     128static bool is_jump(unative_t instr)
    129129{
    130130        int i;
     
    154154        /* Check, that the breakpoints do not conflict */
    155155        for (i=0; i<BKPOINTS_MAX; i++) {
    156                 if (breakpoints[i].address == (__address)argv->intval) {
     156                if (breakpoints[i].address == (uintptr_t)argv->intval) {
    157157                        printf("Duplicate breakpoint %d.\n", i);
    158158                        spinlock_unlock(&bkpoints_lock);
    159159                        return 0;
    160                 } else if (breakpoints[i].address == (__address)argv->intval + sizeof(__native) || \
    161                            breakpoints[i].address == (__address)argv->intval - sizeof(__native)) {
     160                } else if (breakpoints[i].address == (uintptr_t)argv->intval + sizeof(unative_t) || \
     161                           breakpoints[i].address == (uintptr_t)argv->intval - sizeof(unative_t)) {
    162162                        printf("Adjacent breakpoints not supported, conflict with %d.\n", i);
    163163                        spinlock_unlock(&bkpoints_lock);
     
    178178                return 0;
    179179        }
    180         cur->address = (__address) argv->intval;
     180        cur->address = (uintptr_t) argv->intval;
    181181        printf("Adding breakpoint on address: %p\n", argv->intval);
    182         cur->instruction = ((__native *)cur->address)[0];
    183         cur->nextinstruction = ((__native *)cur->address)[1];
     182        cur->instruction = ((unative_t *)cur->address)[0];
     183        cur->nextinstruction = ((unative_t *)cur->address)[1];
    184184        if (argv == &add_argv) {
    185185                cur->flags = 0;
     
    193193
    194194        /* Set breakpoint */
    195         *((__native *)cur->address) = 0x0d;
     195        *((unative_t *)cur->address) = 0x0d;
    196196
    197197        spinlock_unlock(&bkpoint_lock);
     
    229229                return 0;
    230230        }
    231         ((__u32 *)cur->address)[0] = cur->instruction;
    232         ((__u32 *)cur->address)[1] = cur->nextinstruction;
     231        ((uint32_t *)cur->address)[0] = cur->instruction;
     232        ((uint32_t *)cur->address)[1] = cur->nextinstruction;
    233233
    234234        cur->address = NULL;
     
    299299{
    300300        bpinfo_t *cur = NULL;
    301         __address fireaddr = istate->epc;
     301        uintptr_t fireaddr = istate->epc;
    302302        int i;
    303303
     
    316316                /* Reinst only breakpoint */
    317317                if ((breakpoints[i].flags & BKPOINT_REINST) \
    318                     && (fireaddr ==breakpoints[i].address+sizeof(__native))) {
     318                    && (fireaddr ==breakpoints[i].address+sizeof(unative_t))) {
    319319                        cur = &breakpoints[i];
    320320                        break;
     
    324324                if (cur->flags & BKPOINT_REINST) {
    325325                        /* Set breakpoint on first instruction */
    326                         ((__u32 *)cur->address)[0] = 0x0d;
     326                        ((uint32_t *)cur->address)[0] = 0x0d;
    327327                        /* Return back the second */
    328                         ((__u32 *)cur->address)[1] = cur->nextinstruction;
     328                        ((uint32_t *)cur->address)[1] = cur->nextinstruction;
    329329                        cur->flags &= ~BKPOINT_REINST;
    330330                        spinlock_unlock(&bkpoint_lock);
     
    339339
    340340                /* Return first instruction back */
    341                 ((__u32 *)cur->address)[0] = cur->instruction;
     341                ((uint32_t *)cur->address)[0] = cur->instruction;
    342342
    343343                if (! (cur->flags & BKPOINT_ONESHOT)) {
    344344                        /* Set Breakpoint on next instruction */
    345                         ((__u32 *)cur->address)[1] = 0x0d;
     345                        ((uint32_t *)cur->address)[1] = 0x0d;
    346346                        cur->flags |= BKPOINT_REINST;
    347347                }
  • arch/mips32/src/drivers/arc.c

    r991779c5 r7f1c620  
    143143                case CmResourceTypePort:
    144144                        printf("Port: %p-size:%d ",
    145                                (__address)configdata->descr[i].u.port.start,
     145                               (uintptr_t)configdata->descr[i].u.port.start,
    146146                               configdata->descr[i].u.port.length);
    147147                        break;
     
    153153                case CmResourceTypeMemory:
    154154                        printf("Memory: %p-size:%d ",
    155                                (__address)configdata->descr[i].u.port.start,
     155                               (uintptr_t)configdata->descr[i].u.port.start,
    156156                               configdata->descr[i].u.port.length);
    157157                        break;
     
    237237static void arc_putchar(char ch)
    238238{
    239         __u32 cnt;
     239        uint32_t cnt;
    240240        ipl_t ipl;
    241241
     
    294294{
    295295        char ch;
    296         __u32 count;
     296        uint32_t count;
    297297        long result;
    298298       
     
    317317{
    318318        char ch;
    319         __u32 count;
     319        uint32_t count;
    320320        long result;
    321321
     
    381381        arc_memdescriptor_t *desc;
    382382        int total = 0;
    383         __address base;
     383        uintptr_t base;
    384384        size_t basesize;
    385385
  • arch/mips32/src/exception.c

    r991779c5 r7f1c620  
    9696static void reserved_instr_exception(int n, istate_t *istate)
    9797{
    98         if (*((__u32 *)istate->epc) == 0x7c03e83b) {
     98        if (*((uint32_t *)istate->epc) == 0x7c03e83b) {
    9999                ASSERT(THREAD);
    100100                istate->epc += 4;
     
    140140static void interrupt_exception(int n, istate_t *istate)
    141141{
    142         __u32 cause;
     142        uint32_t cause;
    143143        int i;
    144144       
  • arch/mips32/src/interrupt.c

    r991779c5 r7f1c620  
    133133
    134134/* Reregister irq to be IPC-ready */
    135 void irq_ipc_bind_arch(__native irq)
     135void irq_ipc_bind_arch(unative_t irq)
    136136{
    137137        /* Do not allow to redefine timer */
  • arch/mips32/src/mips32.c

    r991779c5 r7f1c620  
    7272 * when not in .text section ????????
    7373 */
    74 __address supervisor_sp __attribute__ ((section (".text")));
     74uintptr_t supervisor_sp __attribute__ ((section (".text")));
    7575/* Stack pointer saved when entering user mode */
    7676/* TODO: How do we do it on SMP system???? */
     
    8282        init.cnt = bootinfo.cnt;
    8383       
    84         __u32 i;
     84        uint32_t i;
    8585       
    8686        for (i = 0; i < bootinfo.cnt; i++) {
     
    147147                                              cp0_status_um_bit |
    148148                                              cp0_status_ie_enabled_bit));
    149         cp0_epc_write((__address) kernel_uarg->uspace_entry);
    150         userspace_asm(((__address) kernel_uarg->uspace_stack+PAGE_SIZE),
    151                       (__address) kernel_uarg->uspace_uarg,
    152                       (__address) kernel_uarg->uspace_entry);
     149        cp0_epc_write((uintptr_t) kernel_uarg->uspace_entry);
     150        userspace_asm(((uintptr_t) kernel_uarg->uspace_stack+PAGE_SIZE),
     151                      (uintptr_t) kernel_uarg->uspace_uarg,
     152                      (uintptr_t) kernel_uarg->uspace_entry);
    153153        while (1)
    154154                ;
     
    163163void before_thread_runs_arch(void)
    164164{
    165         supervisor_sp = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
     165        supervisor_sp = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
    166166}
    167167
     
    175175 * possible to have it separately in the future.
    176176 */
    177 __native sys_tls_set(__native addr)
     177unative_t sys_tls_set(unative_t addr)
    178178{
    179179        return 0;
  • arch/mips32/src/mm/page.c

    r991779c5 r7f1c620  
    4646 *   translate the physical address to uncached area
    4747 */
    48 __address hw_map(__address physaddr, size_t size)
     48uintptr_t hw_map(uintptr_t physaddr, size_t size)
    4949{
    5050        return physaddr + 0xa0000000;
  • arch/mips32/src/mm/tlb.c

    r991779c5 r7f1c620  
    5252static void tlb_modified_fail(istate_t *istate);
    5353
    54 static pte_t *find_mapping_and_check(__address badvaddr, int access, istate_t *istate, int *pfrc);
    55 
    56 static void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, bool cacheable, __address pfn);
    57 static void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr);
     54static pte_t *find_mapping_and_check(uintptr_t badvaddr, int access, istate_t *istate, int *pfrc);
     55
     56static void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, bool cacheable, uintptr_t pfn);
     57static void prepare_entry_hi(entry_hi_t *hi, asid_t asid, uintptr_t addr);
    5858
    5959/** Initialize TLB
     
    9797        entry_hi_t hi;
    9898        asid_t asid;
    99         __address badvaddr;
     99        uintptr_t badvaddr;
    100100        pte_t *pte;
    101101        int pfrc;
     
    167167{
    168168        tlb_index_t index;
    169         __address badvaddr;
     169        uintptr_t badvaddr;
    170170        entry_lo_t lo;
    171171        entry_hi_t hi;
     
    251251{
    252252        tlb_index_t index;
    253         __address badvaddr;
     253        uintptr_t badvaddr;
    254254        entry_lo_t lo;
    255255        entry_hi_t hi;
     
    384384 * @return PTE on success, NULL otherwise.
    385385 */
    386 pte_t *find_mapping_and_check(__address badvaddr, int access, istate_t *istate, int *pfrc)
     386pte_t *find_mapping_and_check(uintptr_t badvaddr, int access, istate_t *istate, int *pfrc)
    387387{
    388388        entry_hi_t hi;
     
    446446}
    447447
    448 void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, bool cacheable, __address pfn)
     448void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, bool cacheable, uintptr_t pfn)
    449449{
    450450        lo->value = 0;
     
    456456}
    457457
    458 void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr)
     458void prepare_entry_hi(entry_hi_t *hi, asid_t asid, uintptr_t addr)
    459459{
    460460        hi->value = ALIGN_DOWN(addr, PAGE_SIZE * 2);
     
    568568 * @param cnt Number of entries to invalidate.
    569569 */
    570 void tlb_invalidate_pages(asid_t asid, __address page, count_t cnt)
     570void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt)
    571571{
    572572        int i;
Note: See TracChangeset for help on using the changeset viewer.