git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4687 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2012-09-17 10:46:10 +00:00
parent f3d472965e
commit e8ce6fcf43
5 changed files with 118 additions and 109 deletions

View File

@ -46,71 +46,74 @@
* Fixed IVOR offset table. * Fixed IVOR offset table.
*/ */
.globl IVORS .globl IVORS
IVORS: b IVOR0 IVORS:
.align 16 IVOR0: b IVOR0
b IVOR1 .align 4
.align 16 IVOR1: b _IVOR1
b IVOR2 .align 4
.align 16 IVOR2: b _IVOR2
b IVOR3 .align 4
.align 16 IVOR3: b _IVOR3
b IVOR4 .align 4
.align 16 IVOR4: b _IVOR4
b IVOR5 .align 4
.align 16 IVOR5: b _IVOR5
b IVOR6 .align 4
.align 16 IVOR6: b _IVOR6
b IVOR7 .align 4
.align 16 IVOR7: b _IVOR7
b IVOR8 .align 4
.align 16 IVOR8: b _IVOR8
b IVOR9 .align 4
.align 16 IVOR9: b _IVOR9
b IVOR10 .align 4
.align 16 IVOR10: b _IVOR10
b IVOR11 .align 4
.align 16 IVOR11: b _IVOR11
b IVOR12 .align 4
.align 16 IVOR12: b _IVOR12
b IVOR13 .align 4
.align 16 IVOR13: b _IVOR13
b IVOR14 .align 4
.align 16 IVOR14: b _IVOR14
b IVOR15 .align 4
IVOR15: b _IVOR15
/* /*
* Unhandled exceptions handler. * Unhandled exceptions handler.
*/ */
.weak IVOR0 .weak _IVOR0
IVOR0: _IVOR0:
.weak IVOR1 .weak _IVOR1
IVOR1: _IVOR1:
.weak IVOR2 .weak _IVOR2
IVOR2: _IVOR2:
.weak IVOR3 .weak _IVOR3
IVOR3: _IVOR3:
.weak IVOR5 .weak _IVOR5
IVOR5: _IVOR5:
.weak IVOR6 .weak _IVOR6
IVOR6: _IVOR6:
.weak IVOR7 .weak _IVOR7
IVOR7: _IVOR7:
.weak IVOR8 .weak _IVOR8
IVOR8: _IVOR8:
.weak IVOR9 .weak _IVOR9
IVOR9: _IVOR9:
.weak IVOR10 .weak _IVOR10
IVOR10: _IVOR10:
.weak IVOR11 .weak _IVOR11
IVOR11: _IVOR11:
.weak IVOR12 .weak _IVOR12
IVOR12: _IVOR12:
.weak IVOR13 .weak _IVOR13
IVOR13: _IVOR13:
.weak IVOR14 .weak _IVOR14
IVOR14: _IVOR14:
.weak IVOR15 .weak _IVOR15
IVOR15: _IVOR15:
.weak _unhandled_exception
.type _unhandled_exception, @function
_unhandled_exception: _unhandled_exception:
b _unhandled_exception b _unhandled_exception
@ -118,8 +121,9 @@ _unhandled_exception:
* IVOR4 handler (Book-E external interrupt). * IVOR4 handler (Book-E external interrupt).
*/ */
.align 4 .align 4
.globl IVOR4 .globl _IVOR4
IVOR4: .type _IVOR4, @function
_IVOR4:
/* Creation of the external stack frame (extctx structure).*/ /* Creation of the external stack frame (extctx structure).*/
stwu %sp, -80(%sp) /* Size of the extctx structure.*/ stwu %sp, -80(%sp) /* Size of the extctx structure.*/
#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI #if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
@ -184,11 +188,12 @@ IVOR4:
#endif #endif
bl chSchIsPreemptionRequired bl chSchIsPreemptionRequired
cmpli cr0, %r3, 0 cmpli cr0, %r3, 0
beq cr0, .ctxrestore beq cr0, _ivor_exit
bl chSchDoReschedule bl chSchDoReschedule
/* Context restore.*/ /* Context restore.*/
.ctxrestore: .globl _ivor_exit
_ivor_exit:
#if CH_DBG_SYSTEM_STATE_CHECK #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock bl dbg_check_unlock
#endif #endif

View File

@ -1099,7 +1099,7 @@ vector259:
.weak vector260 .weak vector260
vector260: vector260:
.globl _unhandled_irq .weak _unhandled_irq
.type _unhandled_irq, @function .type _unhandled_irq, @function
_unhandled_irq: _unhandled_irq:
b _unhandled_irq b _unhandled_irq

View File

@ -45,44 +45,46 @@
/* /*
* Unhandled exceptions handler. * Unhandled exceptions handler.
*/ */
.weak IVOR0 .weak _IVOR0
IVOR0: _IVOR0:
.weak IVOR1 .weak _IVOR1
IVOR1: _IVOR1:
.weak IVOR2 .weak _IVOR2
IVOR2: _IVOR2:
.weak IVOR3 .weak _IVOR3
IVOR3: _IVOR3:
.weak IVOR5 .weak _IVOR5
IVOR5: _IVOR5:
.weak IVOR6 .weak _IVOR6
IVOR6: _IVOR6:
.weak IVOR7 .weak _IVOR7
IVOR7: _IVOR7:
.weak IVOR8 .weak _IVOR8
IVOR8: _IVOR8:
.weak IVOR9 .weak _IVOR9
IVOR9: _IVOR9:
.weak IVOR11 .weak _IVOR11
IVOR11: _IVOR11:
.weak IVOR12 .weak _IVOR12
IVOR12: _IVOR12:
.weak IVOR13 .weak _IVOR13
IVOR13: _IVOR13:
.weak IVOR14 .weak _IVOR14
IVOR14: _IVOR14:
.weak IVOR15 .weak _IVOR15
IVOR15: _IVOR15:
.globl _unhandled_exception .weak _unhandled_exception
.type _unhandled_exception, @function
_unhandled_exception: _unhandled_exception:
b _unhandled_exception b _unhandled_exception
/* /*
* IVOR10 handler (Book-E decrementer). * _IVOR10 handler (Book-E decrementer).
*/ */
.align 4 .align 4
.globl IVOR10 .globl _IVOR10
IVOR10: .type _IVOR10, @function
_IVOR10:
/* Creation of the external stack frame (extctx structure).*/ /* Creation of the external stack frame (extctx structure).*/
stwu %sp, -80(%sp) /* Size of the extctx structure.*/ stwu %sp, -80(%sp) /* Size of the extctx structure.*/
#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI #if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
@ -137,14 +139,15 @@ IVOR10:
cmpli cr0, %r3, 0 cmpli cr0, %r3, 0
beq cr0, .ctxrestore beq cr0, .ctxrestore
bl chSchDoReschedule bl chSchDoReschedule
b .ctxrestore b _ivor_exit
/* /*
* IVOR4 handler (Book-E external interrupt). * _IVOR4 handler (Book-E external interrupt).
*/ */
.align 4 .align 4
.globl IVOR4 .globl _IVOR4
IVOR4: .type _IVOR4, @function
_IVOR4:
/* Creation of the external stack frame (extctx structure).*/ /* Creation of the external stack frame (extctx structure).*/
stwu %sp, -80(%sp) /* Size of the extctx structure.*/ stwu %sp, -80(%sp) /* Size of the extctx structure.*/
#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI #if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
@ -209,11 +212,12 @@ IVOR4:
#endif #endif
bl chSchIsPreemptionRequired bl chSchIsPreemptionRequired
cmpli cr0, %r3, 0 cmpli cr0, %r3, 0
beq cr0, .ctxrestore beq cr0, _ivor_exit
bl chSchDoReschedule bl chSchDoReschedule
/* Context restore.*/ /* Context restore.*/
.ctxrestore: .globl
_ivor_exit:
#if CH_DBG_SYSTEM_STATE_CHECK #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock bl dbg_check_unlock
#endif #endif

View File

@ -1495,7 +1495,7 @@ vector358:
.weak vector359 .weak vector359
vector359: vector359:
.globl _unhandled_irq .weak _unhandled_irq
.type _unhandled_irq, @function .type _unhandled_irq, @function
_unhandled_irq: _unhandled_irq:
b _unhandled_irq b _unhandled_irq

View File

@ -36,10 +36,10 @@ void port_init(void) {
#if PPC_SUPPORTS_IVORS #if PPC_SUPPORTS_IVORS
/* The CPU support IVOR registers, the kernel requires IVOR4 and IVOR10 /* The CPU support IVOR registers, the kernel requires IVOR4 and IVOR10
and the initialization is performed here.*/ and the initialization is performed here.*/
asm volatile ("li %r3, IVOR4@l \t\n" asm volatile ("li %r3, _IVOR4@l \t\n"
"mtIVOR4 %r3 \t\n" "mtIVOR4 %r3 \t\n"
"li %r3, IVOR10@l \t\n" "li %r3, _IVOR10@l \t\n"
"mtIVOR10 %r3"); "mtIVOR10 %r3" : : : "memory");
#endif #endif
} }