在用户级上应该用swi调用. 如;
void __swi(0) Enable_IRQ(void); void __SWI_0 (void) { int tmp; __asm { MRS tmp, SPSR BIC tmp, tmp, #0x80 MSR SPSR_c, tmp } }
void __swi(1) Disable_IRQ(void); void __SWI_1 (void) { int tmp; __asm { MRS tmp, SPSR ORR tmp, tmp, #0x80 MSR SPSR_c, tmp } }
void __swi(2) Enable_FIQ(void); void __SWI_2 (void) { int tmp; __asm { MRS tmp, SPSR BIC tmp, tmp, #0x40 MSR SPSR_c, tmp } }
void __swi(3) Disable_FIQ(void); void __SWI_3 (void) { int tmp; __asm { MRS tmp, SPSR ORR tmp, tmp, #0x40 MSR SPSR_c, tmp } }
int main(void) { Disable_IRQ(); Disable_FIQ(); //................. Enable_FIQ(); Enable_IRQ(); while(i == 0) { } } |