Module Name:    src
Committed By:   maxv
Date:           Sat Jul 22 09:01:46 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: autoconf.c machdep.c
        src/sys/arch/i386/i386: machdep.c
        src/sys/arch/x86/include: cpu.h

Log Message:
Call _proc0_tss_ldt_init only once, and rename them.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amd64/amd64/autoconf.c
cvs rdiff -u -r1.257 -r1.258 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.784 -r1.785 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/include/cpu.h

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/autoconf.c
diff -u src/sys/arch/amd64/amd64/autoconf.c:1.26 src/sys/arch/amd64/amd64/autoconf.c:1.27
--- src/sys/arch/amd64/amd64/autoconf.c:1.26	Tue May 23 08:48:34 2017
+++ src/sys/arch/amd64/amd64/autoconf.c	Sat Jul 22 09:01:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.26 2017/05/23 08:48:34 nonaka Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.27 2017/07/22 09:01:46 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26 2017/05/23 08:48:34 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.27 2017/07/22 09:01:46 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_intrdebug.h"
@@ -95,8 +95,6 @@ cpu_configure(void)
 	identify_hypervisor();
 #endif
 
-	x86_64_proc0_tss_ldt_init();
-
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("configure: mainbus not configured");
 

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.257 src/sys/arch/amd64/amd64/machdep.c:1.258
--- src/sys/arch/amd64/amd64/machdep.c:1.257	Sat Jul 22 08:23:19 2017
+++ src/sys/arch/amd64/amd64/machdep.c	Sat Jul 22 09:01:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.257 2017/07/22 08:23:19 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.258 2017/07/22 09:01:46 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.257 2017/07/22 08:23:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.258 2017/07/22 09:01:46 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -299,6 +299,8 @@ u_long cpu_dump_mempagecnt(void);
 void dodumpsys(void);
 void dumpsys(void);
 
+static void x86_64_proc0_pcb_ldt_init(void);
+
 extern int time_adjusted;	/* XXX no common header */
 
 void dump_misc_init(void);
@@ -394,7 +396,7 @@ cpu_startup(void)
 #endif
 
 	gdt_init();
-	x86_64_proc0_tss_ldt_init();
+	x86_64_proc0_pcb_ldt_init();
 
 	cpu_init_tss(&cpu_info_primary);
 #if !defined(XEN)
@@ -458,10 +460,10 @@ x86_64_tls_switch(struct lwp *l)
 #endif /* XEN */
 
 /*
- * Set up proc0's TSS and LDT.
+ * Set up proc0's PCB and LDT.
  */
-void
-x86_64_proc0_tss_ldt_init(void)
+static void
+x86_64_proc0_pcb_ldt_init(void)
 {
 	struct lwp *l = &lwp0;
 	struct pcb *pcb = lwp_getpcb(l);

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.784 src/sys/arch/i386/i386/machdep.c:1.785
--- src/sys/arch/i386/i386/machdep.c:1.784	Sat Jul 22 08:23:18 2017
+++ src/sys/arch/i386/i386/machdep.c	Sat Jul 22 09:01:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.784 2017/07/22 08:23:18 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.785 2017/07/22 09:01:46 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.784 2017/07/22 08:23:18 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.785 2017/07/22 09:01:46 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -266,7 +266,6 @@ void (*delay_func)(unsigned int) = i8254
 void (*initclock_func)(void) = i8254_initclocks;
 #endif
 
-
 /*
  * Size of memory segments, before any memory is stolen.
  */
@@ -276,6 +275,8 @@ int mem_cluster_cnt = 0;
 void init386(paddr_t);
 void initgdt(union descriptor *);
 
+static void i386_proc0_pcb_ldt_init(void);
+
 extern int time_adjusted;
 
 int *esym;
@@ -481,7 +482,7 @@ cpu_startup(void)
 #endif
 
 	gdt_init();
-	i386_proc0_tss_ldt_init();
+	i386_proc0_pcb_ldt_init();
 
 #ifndef XEN
 	cpu_init_tss(&cpu_info_primary);
@@ -492,10 +493,10 @@ cpu_startup(void)
 }
 
 /*
- * Set up proc0's TSS and LDT.
+ * Set up proc0's PCB and LDT.
  */
-void
-i386_proc0_tss_ldt_init(void)
+static void
+i386_proc0_pcb_ldt_init(void)
 {
 	struct lwp *l = &lwp0;
 	struct pcb *pcb = lwp_getpcb(l);

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.74 src/sys/arch/x86/include/cpu.h:1.75
--- src/sys/arch/x86/include/cpu.h:1.74	Sun Jul 16 14:02:48 2017
+++ src/sys/arch/x86/include/cpu.h	Sat Jul 22 09:01:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.74 2017/07/16 14:02:48 cherry Exp $	*/
+/*	$NetBSD: cpu.h,v 1.75 2017/07/22 09:01:46 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -408,10 +408,6 @@ extern void (*x86_cpu_idle)(void);
 
 /* machdep.c */
 void	cpu_reset(void);
-void	i386_proc0_tss_ldt_init(void);
-void	cpu_reset(void);
-void	x86_64_proc0_tss_ldt_init(void);
-void	x86_64_init_pcb_tss_ldt(struct cpu_info *);
 
 /* longrun.c */
 u_int 	tmx86_get_longrun_mode(void);

Reply via email to