mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-28 16:14:20 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
// #define RTGUI_USING_MOUSE_CURSOR
|
||||
// </section>
|
||||
|
||||
#define RT_VFP_LAZY_STACKING
|
||||
// </RDTConfigurator>
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user