Module Name: src Committed By: maxv Date: Sat Aug 27 14:19:47 UTC 2016
Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/amd64/include: segments.h src/sys/arch/i386/i386: machdep.c src/sys/arch/i386/include: segments.h src/sys/arch/x86/x86: idt.c Log Message: Remove idt_init. To generate a diff of this commit: cvs rdiff -u -r1.227 -r1.228 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amd64/include/segments.h cvs rdiff -u -r1.759 -r1.760 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.55 -r1.56 src/sys/arch/i386/include/segments.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/x86/idt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.227 src/sys/arch/amd64/amd64/machdep.c:1.228 --- src/sys/arch/amd64/amd64/machdep.c:1.227 Sat Aug 27 14:12:58 2016 +++ src/sys/arch/amd64/amd64/machdep.c Sat Aug 27 14:19:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.227 2016/08/27 14:12:58 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.228 2016/08/27 14:19:47 maxv Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 @@ -111,7 +111,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.227 2016/08/27 14:12:58 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.228 2016/08/27 14:19:47 maxv Exp $"); /* #define XENDEBUG_LOW */ @@ -1640,7 +1640,6 @@ init_x86_64(paddr_t first_avail) pmap_update(pmap_kernel()); #ifndef XEN - idt_init(); idt = (struct gate_descriptor *)idt_vaddr; gdtstore = (char *)(idt + NIDT); ldtstore = gdtstore + DYNSEL_START; @@ -1652,25 +1651,29 @@ init_x86_64(paddr_t first_avail) gdtstore = (char *) (ldtstore + PAGE_SIZE); #endif /* XEN */ - /* make gdt gates and memory segments */ + /* + * Make GDT gates and memory segments. + */ set_mem_segment(GDT_ADDR_MEM(gdtstore, GCODE_SEL), 0, 0xfffff, SDT_MEMERA, SEL_KPL, 1, 0, 1); set_mem_segment(GDT_ADDR_MEM(gdtstore, GDATA_SEL), 0, 0xfffff, SDT_MEMRWA, SEL_KPL, 1, 0, 1); -#ifndef XEN - set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore, - LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0); -#endif - set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE_SEL), 0, x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1); set_mem_segment(GDT_ADDR_MEM(gdtstore, GUDATA_SEL), 0, x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 0, 1); - /* make ldt gates and memory segments */ +#ifndef XEN + set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore, + LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0); +#endif + + /* + * Make LDT gates and memory segments. + */ setgate((struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL), &IDTVEC(oosyscall), 0, SDT_SYS386CGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); @@ -1705,7 +1708,7 @@ init_x86_64(paddr_t first_avail) SDT_MEMRWA, SEL_UPL, 1, 1, 0); /* - * Other entries. + * Other LDT entries. */ memcpy((struct gate_descriptor *)(ldtstore + LSOL26CALLS_SEL), (struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL), Index: src/sys/arch/amd64/include/segments.h diff -u src/sys/arch/amd64/include/segments.h:1.26 src/sys/arch/amd64/include/segments.h:1.27 --- src/sys/arch/amd64/include/segments.h:1.26 Sat Aug 27 14:12:58 2016 +++ src/sys/arch/amd64/include/segments.h Sat Aug 27 14:19:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: segments.h,v 1.26 2016/08/27 14:12:58 maxv Exp $ */ +/* $NetBSD: segments.h,v 1.27 2016/08/27 14:19:47 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -248,7 +248,6 @@ void cpu_init_idt(void); void update_descriptor(void *, void *); #if !defined(XEN) -void idt_init(void); void idt_vec_reserve(int); int idt_vec_alloc(int, int); void idt_vec_set(int, void (*)(void)); Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.759 src/sys/arch/i386/i386/machdep.c:1.760 --- src/sys/arch/i386/i386/machdep.c:1.759 Sat Jul 16 17:02:34 2016 +++ src/sys/arch/i386/i386/machdep.c Sat Aug 27 14:19:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.759 2016/07/16 17:02:34 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.760 2016/08/27 14:19:47 maxv Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.759 2016/07/16 17:02:34 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.760 2016/08/27 14:19:47 maxv Exp $"); #include "opt_beep.h" #include "opt_compat_ibcs2.h" @@ -1303,10 +1303,7 @@ init386(paddr_t first_avail) pmap_update(pmap_kernel()); memset((void *)idt_vaddr, 0, PAGE_SIZE); - #ifndef XEN - idt_init(); - idt = (struct gate_descriptor *)idt_vaddr; pmap_kenter_pa(pentium_idt_vaddr, idt_paddr, VM_PROT_READ, 0); pmap_update(pmap_kernel()); Index: src/sys/arch/i386/include/segments.h diff -u src/sys/arch/i386/include/segments.h:1.55 src/sys/arch/i386/include/segments.h:1.56 --- src/sys/arch/i386/include/segments.h:1.55 Sun Jan 24 18:21:50 2016 +++ src/sys/arch/i386/include/segments.h Sat Aug 27 14:19:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: segments.h,v 1.55 2016/01/24 18:21:50 christos Exp $ */ +/* $NetBSD: segments.h,v 1.56 2016/08/27 14:19:47 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -200,7 +200,6 @@ void cpu_init_idt(void); void update_descriptor(union descriptor *, union descriptor *); #if !defined(XEN) -void idt_init(void); void idt_vec_reserve(int); int idt_vec_alloc(int, int); void idt_vec_set(int, void (*)(void)); Index: src/sys/arch/x86/x86/idt.c diff -u src/sys/arch/x86/x86/idt.c:1.3 src/sys/arch/x86/x86/idt.c:1.4 --- src/sys/arch/x86/x86/idt.c:1.3 Sun Apr 19 14:11:37 2009 +++ src/sys/arch/x86/x86/idt.c Sat Aug 27 14:19:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: idt.c,v 1.3 2009/04/19 14:11:37 ad Exp $ */ +/* $NetBSD: idt.c,v 1.4 2016/08/27 14:19:47 maxv Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2009 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.3 2009/04/19 14:11:37 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.4 2016/08/27 14:19:47 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -136,10 +136,4 @@ idt_vec_free(int vec) idt_allocmap[vec] = 0; } -void -idt_init(void) -{ - -} - #endif /* !defined(XEN) */