summaryrefslogtreecommitdiff
path: root/bsp/rm48x50
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2013-05-31 20:25:44 +0800
committerGrissiom <[email protected]>2013-05-31 20:58:08 +0800
commit24fc6e6ebbb5769941845e4549382be6d6f76ced (patch)
tree3242febd63cc487a0b65229999c1a5d5db8d9fa0 /bsp/rm48x50
parent8bbfd45ce3bd78d01e8c03bd5877825f1bb4d610 (diff)
rm48x50: VFP lazy stacking
You need to turn on RT_VFP_LAZY_STACKING in rtconfig.h. By default, RTT will turn on VFP for all threads and stack all the VFP registers. When doing lazy stacking, VFP will only be turned on for the thread who issued VFP instructions. Currently, if a thread turned on VFP, it cannot be turned off. RTT will never know what time the thread doesn't need VFP any more. The thread might could turn off the VFP for it self in proper time.
Diffstat (limited to 'bsp/rm48x50')
-rw-r--r--bsp/rm48x50/HALCoGen/source/sys_core.asm5
-rw-r--r--bsp/rm48x50/HALCoGen/source/sys_intvecs.asm13
-rw-r--r--bsp/rm48x50/rtconfig.h1
3 files changed, 14 insertions, 5 deletions
diff --git a/bsp/rm48x50/HALCoGen/source/sys_core.asm b/bsp/rm48x50/HALCoGen/source/sys_core.asm
index bfb4ad22a8..ae2a9ebd93 100644
--- a/bsp/rm48x50/HALCoGen/source/sys_core.asm
+++ b/bsp/rm48x50/HALCoGen/source/sys_core.asm
@@ -72,8 +72,8 @@ _coreInitRegisters_
orr r2, r2, #0xF00000
mcr p15, #0x00, r2, c1, c0, #0x02
- ; Enable FPV
- fmrx R2, fpexc
+ .if (RT_VFP_LAZY_STACKING) = 0
+ fmrx r2, fpexc
orr r2, r2, #0x40000000
fmxr fpexc, r2
@@ -93,6 +93,7 @@ _coreInitRegisters_
fmdrr d13, r1, r1
fmdrr d14, r1, r1
fmdrr d15, r1, r1
+ .endif
bl next1
next1
bl next2
diff --git a/bsp/rm48x50/HALCoGen/source/sys_intvecs.asm b/bsp/rm48x50/HALCoGen/source/sys_intvecs.asm
index 16cd338fa0..e97ba448ac 100644
--- a/bsp/rm48x50/HALCoGen/source/sys_intvecs.asm
+++ b/bsp/rm48x50/HALCoGen/source/sys_intvecs.asm
@@ -21,8 +21,7 @@
resetEntry
b _c_int00
-undefEntry
- b undefEntry
+ b turnon_VFP
svcEntry
b svcEntry
prefetchEntry
@@ -33,5 +32,13 @@ reservedEntry
b IRQ_Handler
ldr pc,[pc,#-0x1b0]
-
+ .sect ".text"
+turnon_VFP
+ ; Enable FPV
+ STMDB sp!, {r0}
+ fmrx r0, fpexc
+ orr r0, r0, #0x40000000
+ fmxr fpexc, r0
+ LDMIA sp!, {r0}
+ subs pc, lr, #4
;-------------------------------------------------------------------------------
diff --git a/bsp/rm48x50/rtconfig.h b/bsp/rm48x50/rtconfig.h
index 0ae5168fba..86fc630c8c 100644
--- a/bsp/rm48x50/rtconfig.h
+++ b/bsp/rm48x50/rtconfig.h
@@ -211,6 +211,7 @@
// #define RTGUI_USING_MOUSE_CURSOR
// </section>
+#define RT_VFP_LAZY_STACKING
// </RDTConfigurator>
#endif