-/* $OpenBSD: gdt.c,v 1.23 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: gdt.c,v 1.24 2015/05/24 01:01:49 guenther Exp $ */
/* $NetBSD: gdt.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
panic("gdt_init: no pages");
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg), PROT_READ | PROT_WRITE);
}
- memcpy(ci->ci_gdt, gdtstore, GDT_SIZE);
+ memcpy(ci->ci_gdt, cpu_info_primary.ci_gdt, GDT_SIZE);
bzero(ci->ci_tss, sizeof(*ci->ci_tss));
}
-/* $OpenBSD: machdep.c,v 1.211 2015/05/18 19:59:27 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.212 2015/05/24 01:01:49 guenther Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
struct gate_descriptor *idt;
char idt_allocmap[NIDT];
-char *gdtstore;
extern struct user *proc0paddr;
void
idt = (struct gate_descriptor *)idt_vaddr;
cpu_info_primary.ci_tss = (void *)(idt + NIDT);
- gdtstore = (void *)(cpu_info_primary.ci_tss + 1);
+ cpu_info_primary.ci_gdt = (void *)(cpu_info_primary.ci_tss + 1);
/* make gdt gates and memory segments */
- set_mem_segment(GDT_ADDR_MEM(gdtstore, GCODE_SEL), 0,
+ set_mem_segment(GDT_ADDR_MEM(cpu_info_primary.ci_gdt, GCODE_SEL), 0,
0xfffff, SDT_MEMERA, SEL_KPL, 1, 0, 1);
- set_mem_segment(GDT_ADDR_MEM(gdtstore, GDATA_SEL), 0,
+ set_mem_segment(GDT_ADDR_MEM(cpu_info_primary.ci_gdt, GDATA_SEL), 0,
0xfffff, SDT_MEMRWA, SEL_KPL, 1, 0, 1);
- set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE32_SEL), 0,
+ set_mem_segment(GDT_ADDR_MEM(cpu_info_primary.ci_gdt, GUCODE32_SEL), 0,
atop(VM_MAXUSER_ADDRESS32) - 1, SDT_MEMERA, SEL_UPL, 1, 1, 0);
- set_mem_segment(GDT_ADDR_MEM(gdtstore, GUDATA_SEL), 0,
+ set_mem_segment(GDT_ADDR_MEM(cpu_info_primary.ci_gdt, GUDATA_SEL), 0,
atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 0, 1);
- set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE_SEL), 0,
+ set_mem_segment(GDT_ADDR_MEM(cpu_info_primary.ci_gdt, GUCODE_SEL), 0,
atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1);
- set_sys_segment(GDT_ADDR_SYS(gdtstore, GPROC0_SEL),
+ set_sys_segment(GDT_ADDR_SYS(cpu_info_primary.ci_gdt, GPROC0_SEL),
cpu_info_primary.ci_tss, sizeof (struct x86_64_tss)-1,
SDT_SYS386TSS, SEL_KPL, 0);
idt_allocmap[x] = 1;
}
- setregion(®ion, gdtstore, GDT_SIZE - 1);
+ setregion(®ion, cpu_info_primary.ci_gdt, GDT_SIZE - 1);
lgdt(®ion);
cpu_init_idt();