aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/math-emu/get_address.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/math-emu/get_address.c')
-rw-r--r--arch/x86/math-emu/get_address.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/arch/x86/math-emu/get_address.c b/arch/x86/math-emu/get_address.c
index 62daa7fcc44c..420b3b6e3915 100644
--- a/arch/x86/math-emu/get_address.c
+++ b/arch/x86/math-emu/get_address.c
@@ -29,43 +29,43 @@
29#define FPU_WRITE_BIT 0x10 29#define FPU_WRITE_BIT 0x10
30 30
31static int reg_offset[] = { 31static int reg_offset[] = {
32 offsetof(struct math_emu_info, regs.ax), 32 offsetof(struct pt_regs, ax),
33 offsetof(struct math_emu_info, regs.cx), 33 offsetof(struct pt_regs, cx),
34 offsetof(struct math_emu_info, regs.dx), 34 offsetof(struct pt_regs, dx),
35 offsetof(struct math_emu_info, regs.bx), 35 offsetof(struct pt_regs, bx),
36 offsetof(struct math_emu_info, regs.sp), 36 offsetof(struct pt_regs, sp),
37 offsetof(struct math_emu_info, regs.bp), 37 offsetof(struct pt_regs, bp),
38 offsetof(struct math_emu_info, regs.si), 38 offsetof(struct pt_regs, si),
39 offsetof(struct math_emu_info, regs.di) 39 offsetof(struct pt_regs, di)
40}; 40};
41 41
42#define REG_(x) (*(long *)(reg_offset[(x)]+(u_char *) FPU_info)) 42#define REG_(x) (*(long *)(reg_offset[(x)] + (u_char *)FPU_info->regs))
43 43
44static int reg_offset_vm86[] = { 44static int reg_offset_vm86[] = {
45 offsetof(struct math_emu_info, regs.cs), 45 offsetof(struct pt_regs, cs),
46 offsetof(struct math_emu_info, vm86.ds), 46 offsetof(struct kernel_vm86_regs, ds),
47 offsetof(struct math_emu_info, vm86.es), 47 offsetof(struct kernel_vm86_regs, es),
48 offsetof(struct math_emu_info, vm86.fs), 48 offsetof(struct kernel_vm86_regs, fs),
49 offsetof(struct math_emu_info, vm86.gs), 49 offsetof(struct kernel_vm86_regs, gs),
50 offsetof(struct math_emu_info, regs.ss), 50 offsetof(struct pt_regs, ss),
51 offsetof(struct math_emu_info, vm86.ds) 51 offsetof(struct kernel_vm86_regs, ds)
52}; 52};
53 53
54#define VM86_REG_(x) (*(unsigned short *) \ 54#define VM86_REG_(x) (*(unsigned short *) \
55 (reg_offset_vm86[((unsigned)x)]+(u_char *) FPU_info)) 55 (reg_offset_vm86[((unsigned)x)] + (u_char *)FPU_info->regs))
56 56
57static int reg_offset_pm[] = { 57static int reg_offset_pm[] = {
58 offsetof(struct math_emu_info, regs.cs), 58 offsetof(struct pt_regs, cs),
59 offsetof(struct math_emu_info, regs.ds), 59 offsetof(struct pt_regs, ds),
60 offsetof(struct math_emu_info, regs.es), 60 offsetof(struct pt_regs, es),
61 offsetof(struct math_emu_info, regs.fs), 61 offsetof(struct pt_regs, fs),
62 offsetof(struct math_emu_info, regs.ds), /* dummy, not saved on stack */ 62 offsetof(struct pt_regs, ds), /* dummy, not saved on stack */
63 offsetof(struct math_emu_info, regs.ss), 63 offsetof(struct pt_regs, ss),
64 offsetof(struct math_emu_info, regs.ds) 64 offsetof(struct pt_regs, ds)
65}; 65};
66 66
67#define PM_REG_(x) (*(unsigned short *) \ 67#define PM_REG_(x) (*(unsigned short *) \
68 (reg_offset_pm[((unsigned)x)]+(u_char *) FPU_info)) 68 (reg_offset_pm[((unsigned)x)] + (u_char *)FPU_info->regs))
69 69
70/* Decode the SIB byte. This function assumes mod != 0 */ 70/* Decode the SIB byte. This function assumes mod != 0 */
71static int sib(int mod, unsigned long *fpu_eip) 71static int sib(int mod, unsigned long *fpu_eip)
@@ -346,34 +346,34 @@ void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
346 } 346 }
347 switch (rm) { 347 switch (rm) {
348 case 0: 348 case 0:
349 address += FPU_info->regs.bx + FPU_info->regs.si; 349 address += FPU_info->regs->bx + FPU_info->regs->si;
350 break; 350 break;
351 case 1: 351 case 1:
352 address += FPU_info->regs.bx + FPU_info->regs.di; 352 address += FPU_info->regs->bx + FPU_info->regs->di;
353 break; 353 break;
354 case 2: 354 case 2:
355 address += FPU_info->regs.bp + FPU_info->regs.si; 355 address += FPU_info->regs->bp + FPU_info->regs->si;
356 if (addr_modes.override.segment == PREFIX_DEFAULT) 356 if (addr_modes.override.segment == PREFIX_DEFAULT)
357 addr_modes.override.segment = PREFIX_SS_; 357 addr_modes.override.segment = PREFIX_SS_;
358 break; 358 break;
359 case 3: 359 case 3:
360 address += FPU_info->regs.bp + FPU_info->regs.di; 360 address += FPU_info->regs->bp + FPU_info->regs->di;
361 if (addr_modes.override.segment == PREFIX_DEFAULT) 361 if (addr_modes.override.segment == PREFIX_DEFAULT)
362 addr_modes.override.segment = PREFIX_SS_; 362 addr_modes.override.segment = PREFIX_SS_;
363 break; 363 break;
364 case 4: 364 case 4:
365 address += FPU_info->regs.si; 365 address += FPU_info->regs->si;
366 break; 366 break;
367 case 5: 367 case 5:
368 address += FPU_info->regs.di; 368 address += FPU_info->regs->di;
369 break; 369 break;
370 case 6: 370 case 6:
371 address += FPU_info->regs.bp; 371 address += FPU_info->regs->bp;
372 if (addr_modes.override.segment == PREFIX_DEFAULT) 372 if (addr_modes.override.segment == PREFIX_DEFAULT)
373 addr_modes.override.segment = PREFIX_SS_; 373 addr_modes.override.segment = PREFIX_SS_;
374 break; 374 break;
375 case 7: 375 case 7:
376 address += FPU_info->regs.bx; 376 address += FPU_info->regs->bx;
377 break; 377 break;
378 } 378 }
379 379