From 4090154b9e6175090e42d3e5fcccfbc6d690eeb1 Mon Sep 17 00:00:00 2001
From: Bruce Evans <bde@FreeBSD.org>
Date: Mon, 27 Oct 1997 17:23:18 +0000
Subject: [PATCH] Moved declaration of etext from <machine/md_var.h> to
 <machine/cpu.h> and fixed everything that dependended on it being declared in
 the old place.  It is used in "machine-independent" code in subr_prof.c.

Moved declaration of btext from subr_prof.c to <machine/cpu.h>.  It
is machine-dependent.
---
 sys/amd64/amd64/db_interface.c | 5 ++---
 sys/amd64/amd64/db_trace.c     | 5 ++---
 sys/amd64/include/cpu.h        | 4 +++-
 sys/amd64/include/md_var.h     | 3 +--
 sys/i386/i386/db_interface.c   | 5 ++---
 sys/i386/i386/db_trace.c       | 5 ++---
 sys/i386/include/cpu.h         | 4 +++-
 sys/i386/include/md_var.h      | 3 +--
 sys/kern/subr_prof.c           | 5 +----
 9 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c
index 738b647658de..b05285ad6c01 100644
--- a/sys/amd64/amd64/db_interface.c
+++ b/sys/amd64/amd64/db_interface.c
@@ -23,7 +23,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- *	$Id: db_interface.c,v 1.35 1997/07/20 08:37:17 bde Exp $
+ *	$Id: db_interface.c,v 1.36 1997/08/07 05:15:46 dyson Exp $
  */
 
 /*
@@ -34,8 +34,7 @@
 #include <sys/reboot.h>
 
 #include <machine/cons.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
+#include <machine/cpu.h>
 #ifdef SMP
 #include <machine/smp.h>
 #include <machine/smptests.h>	/** CPUSTOP_ON_DDBBREAK */
diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c
index d16b92d98055..d4aaaec8026e 100644
--- a/sys/amd64/amd64/db_trace.c
+++ b/sys/amd64/amd64/db_trace.c
@@ -23,14 +23,13 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- *	$Id: db_trace.c,v 1.24 1997/08/18 06:58:06 charnier Exp $
+ *	$Id: db_trace.c,v 1.25 1997/08/21 06:32:37 charnier Exp $
  */
 
 #include <sys/param.h>
 #include <sys/systm.h>
 
-#include <machine/md_var.h>
-#include <machine/segments.h>
+#include <machine/cpu.h>
 
 #include <vm/vm.h>
 #include <vm/vm_param.h>
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index 730b5b365494..5c0c5323a0f6 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)cpu.h	5.4 (Berkeley) 5/9/91
- *	$Id: cpu.h,v 1.32 1997/08/21 06:32:48 charnier Exp $
+ *	$Id: cpu.h,v 1.33 1997/08/30 02:51:58 kato Exp $
  */
 
 #ifndef _MACHINE_CPU_H_
@@ -144,8 +144,10 @@ struct cpu_nameclass {
 }
 
 #ifdef KERNEL
+extern char	btext[];
 extern int	cpu;
 extern int	cpu_class;
+extern char	etext[];
 extern u_char	intr_nesting_level;
 extern int	want_resched;	/* resched was called */
 
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index fb6f3ad92e2f..7ba75fe3fa0e 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: md_var.h,v 1.17 1997/09/10 12:31:36 joerg Exp $
+ *	$Id: md_var.h,v 1.18 1997/09/13 16:12:11 joerg Exp $
  */
 
 #ifndef _MACHINE_MD_VAR_H_
@@ -43,7 +43,6 @@ extern	u_long	cpu_high;
 extern	u_long	cpu_id;
 extern	u_long	cyrix_did;
 extern	char	cpu_vendor[];
-extern	char	etext[];
 extern	char	kstack[];
 extern	void	(*netisrs[32]) __P((void));
 extern	int	nfs_diskless_valid;
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index 738b647658de..b05285ad6c01 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -23,7 +23,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- *	$Id: db_interface.c,v 1.35 1997/07/20 08:37:17 bde Exp $
+ *	$Id: db_interface.c,v 1.36 1997/08/07 05:15:46 dyson Exp $
  */
 
 /*
@@ -34,8 +34,7 @@
 #include <sys/reboot.h>
 
 #include <machine/cons.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
+#include <machine/cpu.h>
 #ifdef SMP
 #include <machine/smp.h>
 #include <machine/smptests.h>	/** CPUSTOP_ON_DDBBREAK */
diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c
index d16b92d98055..d4aaaec8026e 100644
--- a/sys/i386/i386/db_trace.c
+++ b/sys/i386/i386/db_trace.c
@@ -23,14 +23,13 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- *	$Id: db_trace.c,v 1.24 1997/08/18 06:58:06 charnier Exp $
+ *	$Id: db_trace.c,v 1.25 1997/08/21 06:32:37 charnier Exp $
  */
 
 #include <sys/param.h>
 #include <sys/systm.h>
 
-#include <machine/md_var.h>
-#include <machine/segments.h>
+#include <machine/cpu.h>
 
 #include <vm/vm.h>
 #include <vm/vm_param.h>
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h
index 730b5b365494..5c0c5323a0f6 100644
--- a/sys/i386/include/cpu.h
+++ b/sys/i386/include/cpu.h
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)cpu.h	5.4 (Berkeley) 5/9/91
- *	$Id: cpu.h,v 1.32 1997/08/21 06:32:48 charnier Exp $
+ *	$Id: cpu.h,v 1.33 1997/08/30 02:51:58 kato Exp $
  */
 
 #ifndef _MACHINE_CPU_H_
@@ -144,8 +144,10 @@ struct cpu_nameclass {
 }
 
 #ifdef KERNEL
+extern char	btext[];
 extern int	cpu;
 extern int	cpu_class;
+extern char	etext[];
 extern u_char	intr_nesting_level;
 extern int	want_resched;	/* resched was called */
 
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index fb6f3ad92e2f..7ba75fe3fa0e 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: md_var.h,v 1.17 1997/09/10 12:31:36 joerg Exp $
+ *	$Id: md_var.h,v 1.18 1997/09/13 16:12:11 joerg Exp $
  */
 
 #ifndef _MACHINE_MD_VAR_H_
@@ -43,7 +43,6 @@ extern	u_long	cpu_high;
 extern	u_long	cpu_id;
 extern	u_long	cyrix_did;
 extern	char	cpu_vendor[];
-extern	char	etext[];
 extern	char	kstack[];
 extern	void	(*netisrs[32]) __P((void));
 extern	int	nfs_diskless_valid;
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index 9788da61d03f..c81364b8795a 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)subr_prof.c	8.3 (Berkeley) 9/23/93
- * $Id: subr_prof.c,v 1.21 1997/10/11 18:31:24 phk Exp $
+ * $Id: subr_prof.c,v 1.22 1997/10/12 20:24:00 phk Exp $
  */
 
 #include <sys/param.h>
@@ -55,9 +55,6 @@ SYSINIT(kmem, SI_SUB_KPROF, SI_ORDER_FIRST, kmstartup, NULL)
 
 struct gmonparam _gmonparam = { GMON_PROF_OFF };
 
-extern char btext[];
-extern char etext[];
-
 #ifdef GUPROF
 void
 nullfunc_loop_profiled()