FPU-related code in SB.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13000 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
4430e2c8a1
commit
af38956b67
|
@ -66,7 +66,7 @@ endif
|
|||
|
||||
# Enables the use of FPU (no, softfp, hard).
|
||||
ifeq ($(USE_FPU),)
|
||||
USE_FPU = no
|
||||
USE_FPU = hard
|
||||
endif
|
||||
|
||||
# FPU-related options.
|
||||
|
|
|
@ -720,6 +720,8 @@
|
|||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#define PORT_USE_SYSCALL TRUE
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="xPSR-(format)" val="4"/><content id="r2-(format)" val="4"/><content id="r1-(format)" val="4"/><content id="r0-(format)" val="4"/><content id="s_psp-port_unprivileged_jump-(format)" val="4"/><content id="s_psp-SVC_Handler-(format)" val="4"/><content id="psp-SVC_Handler-(format)" val="4"/></contentList>"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="psp-SVC_Handler-(format)" val="4"/><content id="s_psp-SVC_Handler-(format)" val="4"/><content id="s_psp-port_unprivileged_jump-(format)" val="4"/><content id="r0-(format)" val="4"/><content id="r1-(format)" val="4"/><content id="r2-(format)" val="4"/><content id="xPSR-(format)" val="4"/></contentList>"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x20000300"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
|
||||
|
|
|
@ -166,7 +166,7 @@ void SVC_Handler(void) {
|
|||
newctxp->pc = (uint32_t)port_syscall;
|
||||
newctxp->xpsr = 0x01000000U;
|
||||
#if CORTEX_USE_FPU == TRUE
|
||||
newctxp->fpscr = (regarm_t)FPU->FPDSCR;
|
||||
newctxp->fpscr = FPU->FPDSCR;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -362,7 +362,7 @@ void _port_irq_epilogue(void) {
|
|||
/* Setting up a fake XPSR register value.*/
|
||||
ectxp->xpsr = 0x01000000U;
|
||||
#if CORTEX_USE_FPU == TRUE
|
||||
ectxp->fpscr = (regarm_t)FPU->FPDSCR;
|
||||
ectxp->fpscr = FPU->FPDSCR;
|
||||
#endif
|
||||
|
||||
/* Writing back the modified S-PSP value.*/
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
/* Module constants. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#define FPU 0xE000EF30
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module pre-compile time settings. */
|
||||
/*===========================================================================*/
|
||||
|
@ -114,8 +116,12 @@ UsageFault_Handler:
|
|||
/* This thread is going to die so going back on
|
||||
S-PSP and working safely from there.*/
|
||||
bl port_get_s_psp
|
||||
sub.w r0, r0, #32 // TODO: FPU
|
||||
#if CORTEX_USE_FPU
|
||||
sub.w r0, r0, #104
|
||||
#else
|
||||
sub.w r0, r0, #32
|
||||
msr PSP, r0
|
||||
#endif
|
||||
|
||||
/* Forcing return on exit syscall code with PSR
|
||||
value as exit message.*/
|
||||
|
@ -125,6 +131,11 @@ UsageFault_Handler:
|
|||
str r2, [r0, #24]
|
||||
ldr r2, =0x01000000
|
||||
str r2, [r0, #28]
|
||||
#if CORTEX_USE_FPU
|
||||
ldr r2, =FPU
|
||||
ldr r2, [r2, #12] /* FPDSCR*/
|
||||
str r2, [r0, #96] /* port_extctx.fpscr */
|
||||
#endif
|
||||
|
||||
/* Back to privileged mode.*/
|
||||
mrs r3, CONTROL
|
||||
|
|
Loading…
Reference in New Issue