|
@@ -29,46 +29,43 @@
|
|
#define FPU_WRITE_BIT 0x10
|
|
#define FPU_WRITE_BIT 0x10
|
|
|
|
|
|
static int reg_offset[] = {
|
|
static int reg_offset[] = {
|
|
- offsetof(struct info, ___eax),
|
|
|
|
- offsetof(struct info, ___ecx),
|
|
|
|
- offsetof(struct info, ___edx),
|
|
|
|
- offsetof(struct info, ___ebx),
|
|
|
|
- offsetof(struct info, ___esp),
|
|
|
|
- offsetof(struct info, ___ebp),
|
|
|
|
- offsetof(struct info, ___esi),
|
|
|
|
- offsetof(struct info, ___edi)
|
|
|
|
|
|
+ offsetof(struct pt_regs, ax),
|
|
|
|
+ offsetof(struct pt_regs, cx),
|
|
|
|
+ offsetof(struct pt_regs, dx),
|
|
|
|
+ offsetof(struct pt_regs, bx),
|
|
|
|
+ offsetof(struct pt_regs, sp),
|
|
|
|
+ offsetof(struct pt_regs, bp),
|
|
|
|
+ offsetof(struct pt_regs, si),
|
|
|
|
+ offsetof(struct pt_regs, di)
|
|
};
|
|
};
|
|
|
|
|
|
-#define REG_(x) (*(long *)(reg_offset[(x)]+(u_char *) FPU_info))
|
|
|
|
|
|
+#define REG_(x) (*(long *)(reg_offset[(x)] + (u_char *)FPU_info->regs))
|
|
|
|
|
|
static int reg_offset_vm86[] = {
|
|
static int reg_offset_vm86[] = {
|
|
- offsetof(struct info, ___cs),
|
|
|
|
- offsetof(struct info, ___vm86_ds),
|
|
|
|
- offsetof(struct info, ___vm86_es),
|
|
|
|
- offsetof(struct info, ___vm86_fs),
|
|
|
|
- offsetof(struct info, ___vm86_gs),
|
|
|
|
- offsetof(struct info, ___ss),
|
|
|
|
- offsetof(struct info, ___vm86_ds)
|
|
|
|
|
|
+ offsetof(struct pt_regs, cs),
|
|
|
|
+ offsetof(struct kernel_vm86_regs, ds),
|
|
|
|
+ offsetof(struct kernel_vm86_regs, es),
|
|
|
|
+ offsetof(struct kernel_vm86_regs, fs),
|
|
|
|
+ offsetof(struct kernel_vm86_regs, gs),
|
|
|
|
+ offsetof(struct pt_regs, ss),
|
|
|
|
+ offsetof(struct kernel_vm86_regs, ds)
|
|
};
|
|
};
|
|
|
|
|
|
#define VM86_REG_(x) (*(unsigned short *) \
|
|
#define VM86_REG_(x) (*(unsigned short *) \
|
|
- (reg_offset_vm86[((unsigned)x)]+(u_char *) FPU_info))
|
|
|
|
-
|
|
|
|
-/* This dummy, gs is not saved on the stack. */
|
|
|
|
-#define ___GS ___ds
|
|
|
|
|
|
+ (reg_offset_vm86[((unsigned)x)] + (u_char *)FPU_info->regs))
|
|
|
|
|
|
static int reg_offset_pm[] = {
|
|
static int reg_offset_pm[] = {
|
|
- offsetof(struct info, ___cs),
|
|
|
|
- offsetof(struct info, ___ds),
|
|
|
|
- offsetof(struct info, ___es),
|
|
|
|
- offsetof(struct info, ___fs),
|
|
|
|
- offsetof(struct info, ___GS),
|
|
|
|
- offsetof(struct info, ___ss),
|
|
|
|
- offsetof(struct info, ___ds)
|
|
|
|
|
|
+ offsetof(struct pt_regs, cs),
|
|
|
|
+ offsetof(struct pt_regs, ds),
|
|
|
|
+ offsetof(struct pt_regs, es),
|
|
|
|
+ offsetof(struct pt_regs, fs),
|
|
|
|
+ offsetof(struct pt_regs, ds), /* dummy, not saved on stack */
|
|
|
|
+ offsetof(struct pt_regs, ss),
|
|
|
|
+ offsetof(struct pt_regs, ds)
|
|
};
|
|
};
|
|
|
|
|
|
#define PM_REG_(x) (*(unsigned short *) \
|
|
#define PM_REG_(x) (*(unsigned short *) \
|
|
- (reg_offset_pm[((unsigned)x)]+(u_char *) FPU_info))
|
|
|
|
|
|
+ (reg_offset_pm[((unsigned)x)] + (u_char *)FPU_info->regs))
|
|
|
|
|
|
/* Decode the SIB byte. This function assumes mod != 0 */
|
|
/* Decode the SIB byte. This function assumes mod != 0 */
|
|
static int sib(int mod, unsigned long *fpu_eip)
|
|
static int sib(int mod, unsigned long *fpu_eip)
|
|
@@ -349,34 +346,34 @@ void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
|
|
}
|
|
}
|
|
switch (rm) {
|
|
switch (rm) {
|
|
case 0:
|
|
case 0:
|
|
- address += FPU_info->___ebx + FPU_info->___esi;
|
|
|
|
|
|
+ address += FPU_info->regs->bx + FPU_info->regs->si;
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- address += FPU_info->___ebx + FPU_info->___edi;
|
|
|
|
|
|
+ address += FPU_info->regs->bx + FPU_info->regs->di;
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
- address += FPU_info->___ebp + FPU_info->___esi;
|
|
|
|
|
|
+ address += FPU_info->regs->bp + FPU_info->regs->si;
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
- address += FPU_info->___ebp + FPU_info->___edi;
|
|
|
|
|
|
+ address += FPU_info->regs->bp + FPU_info->regs->di;
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
- address += FPU_info->___esi;
|
|
|
|
|
|
+ address += FPU_info->regs->si;
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
- address += FPU_info->___edi;
|
|
|
|
|
|
+ address += FPU_info->regs->di;
|
|
break;
|
|
break;
|
|
case 6:
|
|
case 6:
|
|
- address += FPU_info->___ebp;
|
|
|
|
|
|
+ address += FPU_info->regs->bp;
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
if (addr_modes.override.segment == PREFIX_DEFAULT)
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
addr_modes.override.segment = PREFIX_SS_;
|
|
break;
|
|
break;
|
|
case 7:
|
|
case 7:
|
|
- address += FPU_info->___ebx;
|
|
|
|
|
|
+ address += FPU_info->regs->bx;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|