Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faca6227 authored by H. Peter Anvin's avatar H. Peter Anvin Committed by Ingo Molnar
Browse files

x86: use generic register name in the thread and tss structures



This changes size-specific register names (eip/rip, esp/rsp, etc.) to
generic names in the thread and tss structures.

Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 25149b62
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -101,8 +101,8 @@ void foo(void)
	OFFSET(pbe_orig_address, pbe, orig_address);
	OFFSET(pbe_next, pbe, next);

	/* Offset from the sysenter stack to tss.esp0 */
	DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) -
	/* Offset from the sysenter stack to tss.sp0 */
	DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
		 sizeof(struct tss_struct));

	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+1 −1
Original line number Diff line number Diff line
@@ -691,7 +691,7 @@ void __cpuinit cpu_init(void)
		BUG();
	enter_lazy_tlb(&init_mm, curr);

	load_esp0(t, thread);
	load_sp0(t, thread);
	set_tss_desc(cpu,t);
	load_TR_desc();
	load_LDT(&init_mm.context);
+8 −7
Original line number Diff line number Diff line
@@ -35,12 +35,13 @@ static void doublefault_fn(void)
		if (ptr_ok(tss)) {
			struct i386_hw_tss *t = (struct i386_hw_tss *)tss;

			printk(KERN_EMERG "eip = %08lx, esp = %08lx\n", t->eip, t->esp);
			printk(KERN_EMERG "eip = %08lx, esp = %08lx\n",
			       t->ip, t->sp);

			printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
				t->eax, t->ebx, t->ecx, t->edx);
				t->ax, t->bx, t->cx, t->dx);
			printk(KERN_EMERG "esi = %08lx, edi = %08lx\n",
				t->esi, t->edi);
				t->si, t->di);
		}
	}

@@ -50,15 +51,15 @@ static void doublefault_fn(void)

struct tss_struct doublefault_tss __cacheline_aligned = {
	.x86_tss = {
		.esp0		= STACK_START,
		.sp0		= STACK_START,
		.ss0		= __KERNEL_DS,
		.ldt		= 0,
		.io_bitmap_base	= INVALID_IO_BITMAP_OFFSET,

		.eip		= (unsigned long) doublefault_fn,
		.ip		= (unsigned long) doublefault_fn,
		/* 0x2 bit is always set */
		.eflags		= X86_EFLAGS_SF | 0x2,
		.esp		= STACK_START,
		.flags		= X86_EFLAGS_SF | 0x2,
		.sp		= STACK_START,
		.es		= __USER_DS,
		.cs		= __KERNEL_CS,
		.ss		= __KERNEL_DS,
+3 −3
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ ENTRY(ia32_sysenter_target)
	CFI_SIGNAL_FRAME
	CFI_DEF_CFA esp, 0
	CFI_REGISTER esp, ebp
	movl TSS_sysenter_esp0(%esp),%esp
	movl TSS_sysenter_sp0(%esp),%esp
sysenter_past_esp:
	/*
	 * No need to follow this irqs on/off section: the syscall
@@ -743,7 +743,7 @@ END(device_not_available)
 * that sets up the real kernel stack. Check here, since we can't
 * allow the wrong stack to be used.
 *
 * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
 * "TSS_sysenter_sp0+12" is because the NMI/debug handler will have
 * already pushed 3 words if it hits on the sysenter instruction:
 * eflags, cs and eip.
 *
@@ -755,7 +755,7 @@ END(device_not_available)
	cmpw $__KERNEL_CS,4(%esp);		\
	jne ok;					\
label:						\
	movl TSS_sysenter_esp0+offset(%esp),%esp;	\
	movl TSS_sysenter_sp0+offset(%esp),%esp;	\
	CFI_DEF_CFA esp, 0;			\
	CFI_UNDEFINED eip;			\
	pushfl;					\
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ struct pv_cpu_ops pv_cpu_ops = {
	.write_ldt_entry = write_dt_entry,
	.write_gdt_entry = write_dt_entry,
	.write_idt_entry = write_dt_entry,
	.load_esp0 = native_load_esp0,
	.load_sp0 = native_load_sp0,

	.irq_enable_syscall_ret = native_irq_enable_syscall_ret,
	.iret = native_iret,
Loading