diff options
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 11 | ||||
-rw-r--r-- | sys/arch/amd64/include/gdt.h | 26 | ||||
-rw-r--r-- | sys/arch/amd64/include/intrdefs.h | 10 | ||||
-rw-r--r-- | sys/arch/amd64/include/pcb.h | 29 | ||||
-rw-r--r-- | sys/arch/amd64/include/proc.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/segments.h | 13 | ||||
-rw-r--r-- | sys/arch/amd64/include/tss.h | 4 |
7 files changed, 25 insertions, 71 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index b2a1ab3cd7d..ad8df981d52 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.58 2010/10/02 23:13:27 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.59 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -43,7 +43,6 @@ */ #include <machine/frame.h> #include <machine/segments.h> -#include <machine/tss.h> #include <machine/intrdefs.h> #include <machine/cacheinfo.h> @@ -59,6 +58,7 @@ #ifdef _KERNEL +struct x86_64_tss; struct cpu_info { struct device *ci_dev; struct cpu_info *ci_self; @@ -79,7 +79,6 @@ struct cpu_info { struct pcb *ci_curpcb; struct pcb *ci_idle_pcb; - int ci_idle_tss_sel; struct intrsource *ci_isources[MAX_INTR_SOURCES]; u_int32_t ci_ipending; @@ -110,6 +109,7 @@ struct cpu_info { struct x86_cache_info ci_cinfo[CAI_COUNT]; + struct x86_64_tss *ci_tss; char *ci_gdt; volatile int ci_ddb_paused; @@ -125,10 +125,6 @@ struct cpu_info { #define CI_SETPERF_INTRANSIT 2 #define CI_SETPERF_DONE 3 - struct x86_64_tss ci_doubleflt_tss; - - char *ci_doubleflt_stack; - struct ksensordev ci_sensordev; struct ksensor ci_sensor; }; @@ -272,7 +268,6 @@ void cpu_probe_features(struct cpu_info *); /* machdep.c */ void dumpconf(void); -int cpu_maxproc(void); void cpu_reset(void); void x86_64_proc0_tss_ldt_init(void); void x86_64_bufinit(void); diff --git a/sys/arch/amd64/include/gdt.h b/sys/arch/amd64/include/gdt.h index b52bc98e3eb..65a116e8bc1 100644 --- a/sys/arch/amd64/include/gdt.h +++ b/sys/arch/amd64/include/gdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt.h,v 1.4 2009/02/03 11:24:19 mikeb Exp $ */ +/* $OpenBSD: gdt.h,v 1.5 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: gdt.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */ /*- @@ -30,29 +30,5 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _LOCORE -struct proc; -struct pmap; - -void gdt_init(void); void gdt_init_cpu(struct cpu_info *); -void gdt_reload_cpu(struct cpu_info *); void gdt_alloc_cpu(struct cpu_info *); - -int tss_alloc(struct pcb *); -void tss_free(int); - -void ldt_alloc(struct pmap *, char *, size_t); -void ldt_free(struct pmap *); - -void set_mem_gdt(struct mem_segment_descriptor *, void *, size_t, - int, int, int, int, int); -void set_sys_gdt(struct sys_segment_descriptor *, void *, size_t, int, int, - int); -#endif - -/* - * Maximum GDT size. It cannot exceed 65536 since the selector field of - * a descriptor is just 16 bits, and used as free list link. - */ -#define MAXGDTSIZ 65536 diff --git a/sys/arch/amd64/include/intrdefs.h b/sys/arch/amd64/include/intrdefs.h index c61cc1f1c45..96a196ff7cd 100644 --- a/sys/arch/amd64/include/intrdefs.h +++ b/sys/arch/amd64/include/intrdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intrdefs.h,v 1.7 2010/05/22 21:31:05 deraadt Exp $ */ +/* $OpenBSD: intrdefs.h,v 1.8 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: intrdefs.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */ #ifndef _AMD64_INTRDEFS_H @@ -75,16 +75,14 @@ #define X86_IPI_SYNCH_FPU 0x00000008 #define X86_IPI_TLB 0x00000010 #define X86_IPI_MTRR 0x00000020 -#define X86_IPI_GDT 0x00000040 +#define X86_IPI_SETPERF 0x00000040 #define X86_IPI_DDB 0x00000080 -#define X86_IPI_SETPERF 0x00000100 -#define X86_NIPI 9 +#define X86_NIPI 8 #define X86_IPI_NAMES { "halt IPI", "nop IPI", "FPU flush IPI", \ "FPU synch IPI", "TLB shootdown IPI", \ - "MTRR update IPI", "GDT update IPI", "ddb IPI", \ - "setperf IPI"} + "MTRR update IPI", "setperf IPI", "ddb IPI" } #define IREENT_MAGIC 0x18041969 diff --git a/sys/arch/amd64/include/pcb.h b/sys/arch/amd64/include/pcb.h index db8b0cab91a..8151dc666d4 100644 --- a/sys/arch/amd64/include/pcb.h +++ b/sys/arch/amd64/include/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.6 2010/10/26 05:49:10 guenther Exp $ */ +/* $OpenBSD: pcb.h,v 1.7 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: pcb.h,v 1.1 2003/04/26 18:39:45 fvdl Exp $ */ /*- @@ -73,36 +73,23 @@ #include <sys/signal.h> -#include <machine/segments.h> #include <machine/tss.h> #include <machine/fpu.h> -#include <machine/sysarch.h> - -#define NIOPORTS 1024 /* # of ports we allow to be mapped */ /* * Please note that the pcb_savefpu field in struct below must be * on a 16-byte boundary. */ struct pcb { - /* - * XXXfvdl - * It's overkill to have a TSS here, as it's only needed - * for compatibility processes who use an I/O permission map. - * The pcb fields below are not in the TSS anymore (and there's - * not enough room in the TSS to store them all) - * Should just make this a pointer and allocate. - */ - struct x86_64_tss pcb_tss; - u_int64_t pcb_cr3; - u_int64_t pcb_rsp; - u_int64_t pcb_rbp; struct savefpu pcb_savefpu; /* floating point state */ - int pcb_cr0; /* saved image of CR0 */ + u_int64_t pcb_cr3; + u_int64_t pcb_rsp; + u_int64_t pcb_rbp; + u_int64_t pcb_kstack; /* kernel stack address */ caddr_t pcb_onfault; /* copyin/out fault recovery */ - struct cpu_info *pcb_fpcpu; /* cpu holding our fp state. */ - unsigned pcb_iomap[NIOPORTS/32]; /* I/O bitmap */ - struct pmap *pcb_pmap; /* back pointer to our pmap */ + struct cpu_info *pcb_fpcpu; /* cpu holding our fp state. */ + struct pmap *pcb_pmap; /* back pointer to our pmap */ + int pcb_cr0; /* saved image of CR0 */ }; /* diff --git a/sys/arch/amd64/include/proc.h b/sys/arch/amd64/include/proc.h index fb662a6ecd7..46ca006f6b4 100644 --- a/sys/arch/amd64/include/proc.h +++ b/sys/arch/amd64/include/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.3 2005/12/13 00:18:19 jsg Exp $ */ +/* $OpenBSD: proc.h,v 1.4 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: proc.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -42,7 +42,6 @@ */ struct mdproc { struct trapframe *md_regs; /* registers on current frame */ - int md_tss_sel; /* TSS selector */ int md_flags; __volatile int md_astpending; }; diff --git a/sys/arch/amd64/include/segments.h b/sys/arch/amd64/include/segments.h index 79f36ed301f..87650c8388a 100644 --- a/sys/arch/amd64/include/segments.h +++ b/sys/arch/amd64/include/segments.h @@ -1,4 +1,4 @@ -/* $OpenBSD: segments.h,v 1.7 2010/10/26 05:49:10 guenther Exp $ */ +/* $OpenBSD: segments.h,v 1.8 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: segments.h,v 1.1 2003/04/26 18:39:47 fvdl Exp $ */ /*- @@ -61,16 +61,14 @@ #define ISLDT(s) ((s) & SEL_LDT) /* is it local or global */ #define SEL_LDT 4 /* local descriptor table */ -/* Dynamically allocated TSSs start (byte offset) */ #define SYSSEL_START (NGDT_MEM << 3) -#define DYNSEL_START (SYSSEL_START + (NGDT_SYS << 4)) +#define GDT_SIZE (SYSSEL_START + (NGDT_SYS << 4)) /* * These define the index not from the start of the GDT, but from * the part of the GDT that they're allocated from. * First NGDT_MEM entries are 8-byte descriptors for CS and DS. - * - * The rest is 16-byte descriptors for TSSs + * Next NGDT_SYS entries are 16-byte descriptors defining TSSs. */ #define IDXSEL(s) (((s) >> 3) & 0x1fff) @@ -249,7 +247,7 @@ void cpu_init_idt(void); * The code and data descriptors must come first. There * are NGDT_MEM of them. * - * Then come the predefined LDT (and possibly TSS) descriptors. + * Then comes the predefined TSS descriptor. * There are NGDT_SYS of them. * * The particular order of the UCODE32, UDATA, and UCODE descriptors is @@ -263,7 +261,8 @@ void cpu_init_idt(void); #define GUCODE_SEL 5 /* User code descriptor */ #define NGDT_MEM 6 -#define NGDT_SYS 0 +#define GPROC0_SEL 0 /* common TSS */ +#define NGDT_SYS 1 #define GDT_SYS_OFFSET (NGDT_MEM << 3) diff --git a/sys/arch/amd64/include/tss.h b/sys/arch/amd64/include/tss.h index c674e0952dd..22b44bca8b2 100644 --- a/sys/arch/amd64/include/tss.h +++ b/sys/arch/amd64/include/tss.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tss.h,v 1.1 2004/01/28 01:39:39 mickey Exp $ */ +/* $OpenBSD: tss.h,v 1.2 2010/11/13 04:16:42 guenther Exp $ */ /* $NetBSD: tss.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */ /* @@ -49,7 +49,7 @@ struct x86_64_tss { u_int32_t tss_reserved1; u_int64_t tss_rsp0; u_int64_t tss_rsp1; - u_int64_t tss_rsp3; + u_int64_t tss_rsp2; u_int32_t tss_reserved2; u_int32_t tss_reserved3; u_int64_t tss_ist[7]; |