diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2011-04-06 11:17:17 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-04-10 16:13:37 -0400 |
commit | c98c09773d80db93cae349f0496fef109feab54d (patch) | |
tree | 1f453c19ae8f6e3f1f322534d704355dfb32bbdd /arch | |
parent | 2e82669acf03e5bf2080f5d3ef005168e67d8a51 (diff) |
ARM: 6868/1: Preserve the VFP state during fork
VFP registers d16-d31 are callee saved registers and must be preserved
during function calls, including fork(). The VFP configuration should
also be preserved. The patch copies the full VFP state to the child
process.
Reported-by: Paul Wright <paul.wright@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/vfp/vfpmodule.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 1c88bbdfd34d..f74695075e64 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -78,6 +78,14 @@ static void vfp_thread_exit(struct thread_info *thread) | |||
78 | put_cpu(); | 78 | put_cpu(); |
79 | } | 79 | } |
80 | 80 | ||
81 | static void vfp_thread_copy(struct thread_info *thread) | ||
82 | { | ||
83 | struct thread_info *parent = current_thread_info(); | ||
84 | |||
85 | vfp_sync_hwstate(parent); | ||
86 | thread->vfpstate = parent->vfpstate; | ||
87 | } | ||
88 | |||
81 | /* | 89 | /* |
82 | * When this function is called with the following 'cmd's, the following | 90 | * When this function is called with the following 'cmd's, the following |
83 | * is true while this function is being run: | 91 | * is true while this function is being run: |
@@ -148,6 +156,10 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) | |||
148 | case THREAD_NOTIFY_EXIT: | 156 | case THREAD_NOTIFY_EXIT: |
149 | vfp_thread_exit(thread); | 157 | vfp_thread_exit(thread); |
150 | break; | 158 | break; |
159 | |||
160 | case THREAD_NOTIFY_COPY: | ||
161 | vfp_thread_copy(thread); | ||
162 | break; | ||
151 | } | 163 | } |
152 | 164 | ||
153 | return NOTIFY_DONE; | 165 | return NOTIFY_DONE; |