FreeCalypso > hg > fc-selenite
comparison src/cs/drivers/drv_app/ffs/board/drv.c @ 46:559a8b3ef10b
FFS code: first attempt at non-invasive gcc support
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 19 Jul 2018 00:35:33 +0000 |
parents | b6a5e36de839 |
children | 8019491a67a9 |
comparison
equal
deleted
inserted
replaced
45:e955d102e7c4 | 46:559a8b3ef10b |
---|---|
1421 // Note that we use our own interrupt disable/enable function because | 1421 // Note that we use our own interrupt disable/enable function because |
1422 // Nucleus allegedly should have a bug in its implementation for this. | 1422 // Nucleus allegedly should have a bug in its implementation for this. |
1423 | 1423 |
1424 uint32 int_disable(void) | 1424 uint32 int_disable(void) |
1425 { | 1425 { |
1426 #ifdef __GNUC__ | |
1427 return NU_Control_Interrupts(0xC0); | |
1428 #else | |
1426 asm(" .state16"); | 1429 asm(" .state16"); |
1427 asm(" mov A1, #0xC0"); | 1430 asm(" mov A1, #0xC0"); |
1428 asm(" ldr A2, tct_disable"); | 1431 asm(" ldr A2, tct_disable"); |
1429 asm(" bx A2 "); | 1432 asm(" bx A2 "); |
1430 | 1433 |
1431 asm("tct_disable .field _TCT_Control_Interrupts+0,32"); | 1434 asm("tct_disable .field _TCT_Control_Interrupts+0,32"); |
1432 asm(" .global _TCT_Control_Interrupts"); | 1435 asm(" .global _TCT_Control_Interrupts"); |
1436 #endif | |
1433 } | 1437 } |
1434 | 1438 |
1435 void int_enable(uint32 cpsr) | 1439 void int_enable(uint32 cpsr) |
1436 { | 1440 { |
1441 #ifdef __GNUC__ | |
1442 return NU_Control_Interrupts(cpsr); | |
1443 #else | |
1437 asm(" .state16"); | 1444 asm(" .state16"); |
1438 asm(" ldr A2, tct_enable"); | 1445 asm(" ldr A2, tct_enable"); |
1439 asm(" bx A2 "); | 1446 asm(" bx A2 "); |
1440 | 1447 |
1441 asm("tct_enable .field _TCT_Control_Interrupts+0,32"); | 1448 asm("tct_enable .field _TCT_Control_Interrupts+0,32"); |
1442 asm(" .global _TCT_Control_Interrupts"); | 1449 asm(" .global _TCT_Control_Interrupts"); |
1450 #endif | |
1443 } | 1451 } |
1444 | 1452 |
1445 #else | 1453 #else |
1446 | 1454 |
1447 uint32 int_disable(void) { return 0; } | 1455 uint32 int_disable(void) { return 0; } |