changeset 90 | 947f0dc9f7a8 |
parent 36 | 538db54a451d |
child 109 | b3a1d9898418 |
52:2d65c2f76d7b | 90:947f0dc9f7a8 |
---|---|
603 #define __MSR_CPSR_C(cc,r) asm("msr"#cc" cpsr_c,"#r); |
603 #define __MSR_CPSR_C(cc,r) asm("msr"#cc" cpsr_c,"#r); |
604 #endif |
604 #endif |
605 |
605 |
606 // Causes undefined instruction exception on both ARM and THUMB |
606 // Causes undefined instruction exception on both ARM and THUMB |
607 #define __ASM_CRASH() asm(".word 0xe7ffdeff ") |
607 #define __ASM_CRASH() asm(".word 0xe7ffdeff ") |
608 #if defined(__GNUC__) |
608 #if defined(__GNUC__) |
609 #define __crash() asm(".word 0xe7ffdeff " : : : "memory") |
609 #define __crash() asm(".word 0xe7ffdeff " : : : "memory") |
610 #elif defined(__GCCXML__) |
|
611 #define __crash() (*((TInt *) 0x0) = 0xd1e) |
|
610 #elif defined(__ARMCC__) |
612 #elif defined(__ARMCC__) |
611 // RVCT doesn't let us inline an undefined instruction |
613 // RVCT doesn't let us inline an undefined instruction |
612 // use a CDP to CP15 instead - doesn't work on THUMB but never mind |
614 // use a CDP to CP15 instead - doesn't work on THUMB but never mind |
613 #if __ARMCC_VERSION < 310000 |
615 #if __ARMCC_VERSION < 310000 |
614 #define __crash() asm("cdp p15, 0, c0, c0, c0, 0 ") |
616 #define __crash() asm("cdp p15, 0, c0, c0, c0, 0 ") |
636 |
638 |
637 #ifdef __CPU_X86 |
639 #ifdef __CPU_X86 |
638 #define EXC_TRAP_CTX_SZ 10 // ebx, esp, ebp, esi, edi, ds, es, fs, gs, eip |
640 #define EXC_TRAP_CTX_SZ 10 // ebx, esp, ebp, esi, edi, ds, es, fs, gs, eip |
639 |
641 |
640 // Causes exception |
642 // Causes exception |
641 #if defined(__VC32__) || defined(__CW32__) |
643 #if defined(__VC32__) |
642 #define __crash() do { _asm int 0ffh } while(0) |
644 #define __crash() do { _asm int 255 } while(0) |
645 #elif defined(__CW32__) |
|
646 #define __crash() do { *(volatile TInt*)0 = 0; } while(0) |
|
643 #else |
647 #else |
644 #define __crash() asm("int 0xff " : : : "memory") |
648 #define __crash() asm("int 0xff " : : : "memory") |
645 #endif |
649 #endif |
646 |
650 |
647 #ifdef __VC32__ |
651 #ifdef __VC32__ |