Revision 5dc4b744 target-mips/helper.c

b/target-mips/helper.c
86 86
#endif
87 87
    if (user_mode && address > 0x7FFFFFFFUL)
88 88
        return TLBRET_BADADDR;
89
    if (address < SIGN_EXTEND32(0x80000000UL)) {
89
    if (address < (int32_t)0x80000000UL) {
90 90
        if (!(env->hflags & MIPS_HFLAG_ERL)) {
91 91
#ifdef MIPS_USES_R4K_TLB
92 92
            ret = map_address(env, physical, prot, address, rw, access_type);
......
98 98
            *physical = address;
99 99
            *prot = PAGE_READ | PAGE_WRITE;
100 100
        }
101
    } else if (address < SIGN_EXTEND32(0xA0000000UL)) {
101
    } else if (address < (int32_t)0xA0000000UL) {
102 102
        /* kseg0 */
103 103
        /* XXX: check supervisor mode */
104
        *physical = address - SIGN_EXTEND32(0x80000000UL);
104
        *physical = address - (int32_t)0x80000000UL;
105 105
        *prot = PAGE_READ | PAGE_WRITE;
106
    } else if (address < SIGN_EXTEND32(0xC0000000UL)) {
106
    } else if (address < (int32_t)0xC0000000UL) {
107 107
        /* kseg1 */
108 108
        /* XXX: check supervisor mode */
109
        *physical = address - SIGN_EXTEND32(0xA0000000UL);
109
        *physical = address - (int32_t)0xA0000000UL;
110 110
        *prot = PAGE_READ | PAGE_WRITE;
111
    } else if (address < SIGN_EXTEND32(0xE0000000UL)) {
111
    } else if (address < (int32_t)0xE0000000UL) {
112 112
        /* kseg2 */
113 113
#ifdef MIPS_USES_R4K_TLB
114 114
        ret = map_address(env, physical, prot, address, rw, access_type);
......
299 299
    enter_debug_mode:
300 300
        env->hflags |= MIPS_HFLAG_DM;
301 301
        /* EJTAG probe trap enable is not implemented... */
302
        env->PC = SIGN_EXTEND32(0xBFC00480);
302
        env->PC = (int32_t)0xBFC00480;
303 303
        break;
304 304
    case EXCP_RESET:
305 305
        cpu_reset(env);
......
321 321
        }
322 322
        env->hflags |= MIPS_HFLAG_ERL;
323 323
	env->CP0_Status |= (1 << CP0St_ERL) | (1 << CP0St_BEV);
324
        env->PC = SIGN_EXTEND32(0xBFC00000);
324
        env->PC = (int32_t)0xBFC00000;
325 325
        break;
326 326
    case EXCP_MCHECK:
327 327
        cause = 24;
......
389 389
            env->CP0_Cause &= ~0x80000000;
390 390
        }
391 391
        if (env->CP0_Status & (1 << CP0St_BEV)) {
392
            env->PC = SIGN_EXTEND32(0xBFC00200);
392
            env->PC = (int32_t)0xBFC00200;
393 393
        } else {
394
            env->PC = SIGN_EXTEND32(0x80000000);
394
            env->PC = (int32_t)0x80000000;
395 395
        }
396 396
        env->hflags |= MIPS_HFLAG_EXL;
397 397
        env->CP0_Status |= (1 << CP0St_EXL);

Also available in: Unified diff