Changeset 7f1c620 in mainline for arch/mips32/src/debugger.c


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.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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                }
Note: See TracChangeset for help on using the changeset viewer.