svn commit: r326656 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64

Bruce Evans bde at FreeBSD.org
Thu Dec 7 07:55:40 UTC 2017


Author: bde
Date: Thu Dec  7 07:55:38 2017
New Revision: 326656
URL: https://svnweb.freebsd.org/changeset/base/326656

Log:
  Move instantiation of msgbufp from 9 MD files to subr_prf.c.
  
  This variable should be pure MI except possibly for reading it in MD
  dump routines.  Its initialization was pure MD in 4.4BSD, but FreeBSD
  changed this in r36441 in 1998.  There were many imperfections in
  r36441.  This commit fixes only a small one, to simplify fixing the
  others 1 arch at a time.  (r47678 added support for
  special/early/multiple message buffer initialization which I want in
  a more general form, but this was too fragile to use because hacking
  on the msgbufp global corrupted it, and was only used for 5 hours in
  -current...)

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/arm/arm/pmap-v4.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm64/arm64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/kern/subr_prf.c
  head/sys/mips/mips/machdep.c
  head/sys/powerpc/powerpc/pmap_dispatch.c
  head/sys/riscv/riscv/pmap.c
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/amd64/amd64/machdep.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -184,8 +184,6 @@ struct init_ops init_ops = {
  */
 extern char kernphys[];
 
-struct msgbuf *msgbufp;
-
 /*
  * Physical address of the EFI System Table. Stashed from the metadata hints
  * passed into the kernel and used by the EFI code to call runtime services.

Modified: head/sys/arm/arm/pmap-v4.c
==============================================================================
--- head/sys/arm/arm/pmap-v4.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/arm/arm/pmap-v4.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -265,8 +265,6 @@ void		(*pmap_copy_page_offs_func)(vm_paddr_t a_phys,
 		    int cnt);
 void		(*pmap_zero_page_func)(vm_paddr_t, int, int);
 
-struct msgbuf *msgbufp = NULL;
-
 /*
  * Crashdump maps.
  */

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/arm/arm/pmap-v6.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -294,8 +294,6 @@ vm_paddr_t first_managed_pa;
  */
 caddr_t _tmppt = 0;
 
-struct msgbuf *msgbufp = NULL; /* XXX move it to machdep.c */
-
 /*
  *  Crashdump maps.
  */

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/arm64/arm64/pmap.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -221,8 +221,6 @@ vm_offset_t virtual_avail;	/* VA of first avail page (
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
 vm_offset_t kernel_vm_end = 0;
 
-struct msgbuf *msgbufp = NULL;
-
 /*
  * Data for the pv entry allocation mechanism.
  * Updates to pv_invl_gen are protected by the pv_list_locks[]

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/i386/i386/pmap.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -255,7 +255,6 @@ pt_entry_t *CMAP3;
 static pd_entry_t *KPTD;
 caddr_t ptvmmap = 0;
 caddr_t CADDR3;
-struct msgbuf *msgbufp = NULL;
 
 /*
  * Crashdump maps.

Modified: head/sys/kern/subr_prf.c
==============================================================================
--- head/sys/kern/subr_prf.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/kern/subr_prf.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -122,6 +122,7 @@ static void  snprintf_func(int ch, void *arg);
 
 static int msgbufmapped;		/* Set when safe to use msgbuf */
 int msgbuftrigger;
+struct msgbuf *msgbufp;
 
 static int log_console_output = 1;
 SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RWTUN,

Modified: head/sys/mips/mips/machdep.c
==============================================================================
--- head/sys/mips/mips/machdep.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/mips/mips/machdep.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -318,8 +318,6 @@ cpu_initclocks(void)
 	cpu_initclocks_bsp();
 }
 
-struct msgbuf *msgbufp = NULL;
-
 /*
  * Initialize the hardware exception vectors, and the jump table used to
  * call locore cache and TLB management functions, based on the kind

Modified: head/sys/powerpc/powerpc/pmap_dispatch.c
==============================================================================
--- head/sys/powerpc/powerpc/pmap_dispatch.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/powerpc/powerpc/pmap_dispatch.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -72,7 +72,6 @@ static struct kobj_ops	mmu_kernel_kops;
  */
 struct pmap kernel_pmap_store;
 
-struct msgbuf *msgbufp;
 vm_offset_t    msgbuf_phys;
 
 vm_offset_t kernel_vm_end;

Modified: head/sys/riscv/riscv/pmap.c
==============================================================================
--- head/sys/riscv/riscv/pmap.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/riscv/riscv/pmap.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -220,8 +220,6 @@ vm_offset_t virtual_avail;	/* VA of first avail page (
 vm_offset_t virtual_end;	/* VA of last avail page (end of kernel AS) */
 vm_offset_t kernel_vm_end = 0;
 
-struct msgbuf *msgbufp = NULL;
-
 vm_paddr_t dmap_phys_base;	/* The start of the dmap region */
 vm_paddr_t dmap_phys_max;	/* The limit of the dmap region */
 vm_offset_t dmap_max_addr;	/* The virtual address limit of the dmap */

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Thu Dec  7 05:55:18 2017	(r326655)
+++ head/sys/sparc64/sparc64/pmap.c	Thu Dec  7 07:55:38 2017	(r326656)
@@ -100,11 +100,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/ver.h>
 
 /*
- * Virtual address of message buffer
- */
-struct msgbuf *msgbufp;
-
-/*
  * Map of physical memory reagions
  */
 vm_paddr_t phys_avail[128];


More information about the svn-src-all mailing list