summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/cpu.h4
-rw-r--r--sys/arch/i386/include/cpu_full.h9
-rw-r--r--sys/arch/i386/include/segments.h7
-rw-r--r--sys/arch/i386/include/tss.h38
4 files changed, 32 insertions, 26 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 351c9be6a7c..4d03c9e1e36 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.162 2018/04/11 15:44:08 bluhm Exp $ */
+/* $OpenBSD: cpu.h,v 1.163 2018/06/22 13:21:14 bluhm Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -184,6 +184,7 @@ struct cpu_info {
union descriptor *ci_gdt;
struct i386tss *ci_tss;
+ struct i386tss *ci_nmi_tss;
volatile int ci_ddb_paused; /* paused due to other proc in ddb */
#define CI_DDB_RUNNING 0
@@ -399,6 +400,7 @@ extern int cpu_apmi_edx;
/* cpu.c */
extern u_int cpu_mwait_size;
extern u_int cpu_mwait_states;
+extern void cpu_update_nmi_cr3(vaddr_t);
/* machdep.c */
extern int cpu_apmhalt;
diff --git a/sys/arch/i386/include/cpu_full.h b/sys/arch/i386/include/cpu_full.h
index da2dee89e72..c7375af16c1 100644
--- a/sys/arch/i386/include/cpu_full.h
+++ b/sys/arch/i386/include/cpu_full.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu_full.h,v 1.2 2018/05/28 20:52:44 bluhm Exp $ */
+/* $OpenBSD: cpu_full.h,v 1.3 2018/06/22 13:21:14 bluhm Exp $ */
/*
* Copyright (c) 2018 Philip Guenther <guenther@openbsd.org>
* Copyright (c) 2018 Hans-Joerg Hoexer <hshoexer@genua.de>
@@ -28,16 +28,19 @@ struct cpu_info_full {
union {
struct {
struct i386tss uu_tss;
+ struct i386tss uu_nmi_tss;
union descriptor uu_gdt[NGDT];
} u_tssgdt;
char u_align[PAGE_SIZE];
} cif_TSS_RO;
#define cif_tss cif_TSS_RO.u_tssgdt.uu_tss
+#define cif_nmi_tss cif_TSS_RO.u_tssgdt.uu_nmi_tss
#define cif_gdt cif_TSS_RO.u_tssgdt.uu_gdt
/* start of page mapped kRW in u-k */
- uint32_t cif_tramp_stack[(PAGE_SIZE
+ uint32_t cif_tramp_stack[(PAGE_SIZE / 4
- offsetof(struct cpu_info, ci_PAGEALIGN)) / sizeof(uint32_t)];
+ uint32_t cif_nmi_stack[(3 * PAGE_SIZE / 4) / sizeof(uint32_t)];
/*
* Beginning of this hangs over into the kRW page; rest is
@@ -47,7 +50,7 @@ struct cpu_info_full {
} __aligned(PAGE_SIZE);
/* tss, align shim, and gdt must fit in a page */
-CTASSERT(_ALIGN(sizeof(struct i386tss)) +
+CTASSERT(_ALIGN(2 * sizeof(struct i386tss)) +
sizeof(struct segment_descriptor) * NGDT < PAGE_SIZE);
/* verify expected alignment */
diff --git a/sys/arch/i386/include/segments.h b/sys/arch/i386/include/segments.h
index 22e9ed9feaf..141bc12e262 100644
--- a/sys/arch/i386/include/segments.h
+++ b/sys/arch/i386/include/segments.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: segments.h,v 1.24 2018/03/31 13:45:03 bluhm Exp $ */
+/* $OpenBSD: segments.h,v 1.25 2018/06/22 13:21:14 bluhm Exp $ */
/* $NetBSD: segments.h,v 1.23 1996/02/01 22:31:03 mycroft Exp $ */
/*-
@@ -222,8 +222,9 @@ void idt_vec_free(int);
#define GUFS_SEL 11 /* User per-thread (%fs) descriptor */
#define GUGS_SEL 12 /* User per-thread (%gs) descriptor */
#define GTSS_SEL 13 /* common TSS */
-#define GBIOS32_SEL 14 /* spare slot for 32 bit BIOS calls */
-#define NGDT 15
+#define GNMITSS_SEL 14 /* NMI TSS */
+#define GBIOS32_SEL 15 /* spare slot for 32 bit BIOS calls */
+#define NGDT 16
#define GDT_SIZE (NGDT << 3)
diff --git a/sys/arch/i386/include/tss.h b/sys/arch/i386/include/tss.h
index 35cfb6f81fd..20ff25dd341 100644
--- a/sys/arch/i386/include/tss.h
+++ b/sys/arch/i386/include/tss.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tss.h,v 1.11 2018/03/31 13:45:03 bluhm Exp $ */
+/* $OpenBSD: tss.h,v 1.12 2018/06/22 13:21:14 bluhm Exp $ */
/* $NetBSD: tss.h,v 1.6 1995/10/11 04:20:28 mycroft Exp $ */
/*-
@@ -50,24 +50,24 @@ struct i386tss {
int __tss_ss1;
int __tss_esp2;
int __tss_ss2;
- int __tss_cr3;
- int __tss_eip;
- int __tss_eflags;
- int __tss_eax;
- int __tss_ecx;
- int __tss_edx;
- int __tss_ebx;
- int __tss_esp;
- int __tss_ebp;
- int __tss_esi;
- int __tss_edi;
- int __tss_es;
- int __tss_cs;
- int __tss_ss;
- int __tss_ds;
- int __tss_fs;
- int __tss_gs;
- int __tss_ldt;
+ int tss_cr3;
+ int tss_eip;
+ int tss_eflags;
+ int tss_eax;
+ int tss_ecx;
+ int tss_edx;
+ int tss_ebx;
+ int tss_esp;
+ int tss_ebp;
+ int tss_esi;
+ int tss_edi;
+ int tss_es;
+ int tss_cs;
+ int tss_ss;
+ int tss_ds;
+ int tss_fs;
+ int tss_gs;
+ int tss_ldt;
int tss_ioopt; /* options and I/O permission map offset */
};