replaced tabs with spaces
This commit is contained in:
parent
85a05dd794
commit
0467181093
@ -21,22 +21,22 @@
|
|||||||
|
|
||||||
int inISR(void)
|
int inISR(void)
|
||||||
{
|
{
|
||||||
return (__get_IPSR() & 0xFF);
|
return (__get_IPSR() & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int disableIRQ(void)
|
unsigned int disableIRQ(void)
|
||||||
{
|
{
|
||||||
// FIXME PRIMASK is the old CPSR (FAULTMASK ??? BASEPRI ???)
|
// FIXME PRIMASK is the old CPSR (FAULTMASK ??? BASEPRI ???)
|
||||||
//PRIMASK lesen
|
//PRIMASK lesen
|
||||||
unsigned int uiPriMask = __get_PRIMASK();
|
unsigned int uiPriMask = __get_PRIMASK();
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
return uiPriMask;
|
return uiPriMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void restoreIRQ(unsigned oldPRIMASK)
|
void restoreIRQ(unsigned oldPRIMASK)
|
||||||
{
|
{
|
||||||
//PRIMASK lesen setzen
|
//PRIMASK lesen setzen
|
||||||
__set_PRIMASK(oldPRIMASK);
|
__set_PRIMASK(oldPRIMASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -76,36 +76,36 @@ void eINT(void)
|
|||||||
|
|
||||||
void save_context(void)
|
void save_context(void)
|
||||||
{
|
{
|
||||||
/* {r0-r3,r12,LR,PC,xPSR} are saved automatically on exception entry */
|
/* {r0-r3,r12,LR,PC,xPSR} are saved automatically on exception entry */
|
||||||
asm("push {r4-r11}");
|
asm("push {r4-r11}");
|
||||||
/* save unsaved registers */
|
/* save unsaved registers */
|
||||||
asm("push {LR}");
|
asm("push {LR}");
|
||||||
/* save exception return value */
|
/* save exception return value */
|
||||||
|
|
||||||
asm("ldr r1, =active_thread");
|
asm("ldr r1, =active_thread");
|
||||||
/* load address of currend pdc */
|
/* load address of currend pdc */
|
||||||
asm("ldr r1, [r1]");
|
asm("ldr r1, [r1]");
|
||||||
/* deref pdc */
|
/* deref pdc */
|
||||||
asm("str sp, [r1]");
|
asm("str sp, [r1]");
|
||||||
/* write sp to pdc->sp means current threads stack pointer */
|
/* write sp to pdc->sp means current threads stack pointer */
|
||||||
}
|
}
|
||||||
|
|
||||||
void restore_context(void)
|
void restore_context(void)
|
||||||
{
|
{
|
||||||
asm("ldr r0, =active_thread");
|
asm("ldr r0, =active_thread");
|
||||||
/* load address of currend pdc */
|
/* load address of currend pdc */
|
||||||
asm("ldr r0, [r0]");
|
asm("ldr r0, [r0]");
|
||||||
/* deref pdc */
|
/* deref pdc */
|
||||||
asm("ldr sp, [r0]");
|
asm("ldr sp, [r0]");
|
||||||
/* load pdc->sp to sp register */
|
/* load pdc->sp to sp register */
|
||||||
|
|
||||||
asm("pop {r0}");
|
asm("pop {r0}");
|
||||||
/* restore exception retrun value from stack */
|
/* restore exception retrun value from stack */
|
||||||
asm("pop {r4-r11}");
|
asm("pop {r4-r11}");
|
||||||
/* load unloaded register */
|
/* load unloaded register */
|
||||||
// asm("pop {r4}"); /*foo*/
|
// asm("pop {r4}"); /*foo*/
|
||||||
asm("bx r0"); /* load exception return value to pc causes end of exception*/
|
asm("bx r0"); /* load exception return value to pc causes end of exception*/
|
||||||
/* {r0-r3,r12,LR,PC,xPSR} are restored automatically on exception return */
|
/* {r0-r3,r12,LR,PC,xPSR} are restored automatically on exception return */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define USR_RESET (0x102)
|
#define USR_RESET (0x102)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user