[PATCH 18/23] dove: use vfp_pm function for vfp state save & restore
Brad Figg
brad.figg at canonical.com
Thu Aug 27 23:20:58 UTC 2009
From: Saeed Bishara <saeed at marvell.com>
Signed-off-by: Saeed Bishara <saeed at marvell.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
arch/arm/mach-dove/pm.c | 8 --------
arch/arm/vfp/vfphw.S | 25 -------------------------
arch/arm/vfp/vfpmodule.c | 28 +++++-----------------------
3 files changed, 5 insertions(+), 56 deletions(-)
diff --git a/arch/arm/mach-dove/pm.c b/arch/arm/mach-dove/pm.c
index 107a1ac..9e52a9c 100755
--- a/arch/arm/mach-dove/pm.c
+++ b/arch/arm/mach-dove/pm.c
@@ -668,18 +668,10 @@ void dove_standby(void)
dove_save_timer_regs();
dove_save_int_regs();
-#if defined(CONFIG_VFP)
- vfp_save();
-#endif
-
/* Suspend the CPU only */
mvPmuStandby();
cpu_init();
-#if defined(CONFIG_VFP)
- vfp_restore();
-#endif
-
/* Restore CPU Peripherals state */
dove_restore_int_regs();
dove_restore_timer_regs();
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index c742777..a2171a3 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -268,28 +268,3 @@ ENTRY(vfp_put_double)
#endif
ENDPROC(vfp_put_double)
-
-
-@ VFP save user registers state.
-@
-@ r0 = location to store to
- .globl vfp_save_user_state
-vfp_save_user_state:
- VFPFMRX r1, FPEXC @ Is the VFP enabled?
- orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set
- bic r1, r1, #FPEXC_EX @ make sure exceptions are disabled
- VFPFMXR FPEXC, r1
- VFPFSTMIA r0, r1 @ save the working registers
- mov pc, lr
-
-@ VFP load state.
-@
-@ r0 = location to load from
- .globl vfp_load_user_state
-vfp_load_user_state:
- VFPFMRX r1, FPEXC @ Is the VFP enabled?
- orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set
- bic r1, r1, #FPEXC_EX @ make sure exceptions are disabled
- VFPFMXR FPEXC, r1
- VFPFLDMIA r0, r11 @ save the working registers
- mov pc, lr
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 476888c..538cf97 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -514,36 +514,18 @@ static int __init vfp_init(void)
late_initcall(vfp_init);
-
-void vfp_save_user_state(u32 *);
-void vfp_load_user_state(u32 *);
-
-static u32 fpexc, fpscr;
-static u32 vfp_regs[32];
-
void vfp_save(void)
{
+ struct pm_message temp;
/*
* if VFP was not initialized yet, then do nothing
*/
- if (!VFP_arch)
- return;
-
- fpexc = fmrx(FPEXC);
- fpscr = fmrx(FPSCR);
- vfp_save_user_state(vfp_regs);
+ if (VFP_arch)
+ vfp_pm_suspend(NULL , temp);
}
void vfp_restore(void)
{
- u32 access;
-
- if (!VFP_arch)
- return;
-
- access = get_copro_access();
- set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
- vfp_load_user_state(vfp_regs);
- fmxr(FPSCR, fpscr);
- fmxr(FPEXC, fpexc);
+ if (VFP_arch)
+ vfp_pm_resume(NULL);
}
--
1.6.0.4
More information about the kernel-team
mailing list