@@ -194,7 +194,7 @@ int peek_user(struct task_struct *child, long addr, long data)
194
194
195
195
static int get_fpregs (struct user_i387_struct __user * buf , struct task_struct * child )
196
196
{
197
- int err , n , cpu = (( struct thread_info * ) child -> stack ) -> cpu ;
197
+ int err , n , cpu = task_cpu ( child ) ;
198
198
struct user_i387_struct fpregs ;
199
199
200
200
err = save_i387_registers (userspace_pid [cpu ],
@@ -211,7 +211,7 @@ static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *c
211
211
212
212
static int set_fpregs (struct user_i387_struct __user * buf , struct task_struct * child )
213
213
{
214
- int n , cpu = (( struct thread_info * ) child -> stack ) -> cpu ;
214
+ int n , cpu = task_cpu ( child ) ;
215
215
struct user_i387_struct fpregs ;
216
216
217
217
n = copy_from_user (& fpregs , buf , sizeof (fpregs ));
@@ -224,7 +224,7 @@ static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *c
224
224
225
225
static int get_fpxregs (struct user_fxsr_struct __user * buf , struct task_struct * child )
226
226
{
227
- int err , n , cpu = (( struct thread_info * ) child -> stack ) -> cpu ;
227
+ int err , n , cpu = task_cpu ( child ) ;
228
228
struct user_fxsr_struct fpregs ;
229
229
230
230
err = save_fpx_registers (userspace_pid [cpu ], (unsigned long * ) & fpregs );
@@ -240,7 +240,7 @@ static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *
240
240
241
241
static int set_fpxregs (struct user_fxsr_struct __user * buf , struct task_struct * child )
242
242
{
243
- int n , cpu = (( struct thread_info * ) child -> stack ) -> cpu ;
243
+ int n , cpu = task_cpu ( child ) ;
244
244
struct user_fxsr_struct fpregs ;
245
245
246
246
n = copy_from_user (& fpregs , buf , sizeof (fpregs ));
0 commit comments