Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Dec 2019 03:48:35 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355439 - in head/sys/arm: arm include
Message-ID:  <201912060348.xB63mZu3089242@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Fri Dec  6 03:48:35 2019
New Revision: 355439
URL: https://svnweb.freebsd.org/changeset/base/355439

Log:
  Declare the global kernel symbols created by ldscript.arm in arm's machdep.h,
  and remove a couple scattered local declarations.
  
  Most of these aren't referenced in C code (there are some references in
  asm code), and they also aren't documented anywhere.  This helps a bit
  with the latter.

Modified:
  head/sys/arm/arm/mp_machdep.c
  head/sys/arm/arm/unwind.c
  head/sys/arm/include/machdep.h

Modified: head/sys/arm/arm/mp_machdep.c
==============================================================================
--- head/sys/arm/arm/mp_machdep.c	Fri Dec  6 03:46:38 2019	(r355438)
+++ head/sys/arm/arm/mp_machdep.c	Fri Dec  6 03:48:35 2019	(r355439)
@@ -106,8 +106,6 @@ check_ap(void)
 	return (-2);
 }
 
-extern unsigned char _end[];
-
 /* Initialize and fire up non-boot processors */
 void
 cpu_mp_start(void)

Modified: head/sys/arm/arm/unwind.c
==============================================================================
--- head/sys/arm/arm/unwind.c	Fri Dec  6 03:46:38 2019	(r355438)
+++ head/sys/arm/arm/unwind.c	Fri Dec  6 03:48:35 2019	(r355439)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/linker.h>
 
+#include <machine/machdep.h>
 #include <machine/stack.h>
 
 #include "linker_if.h"
@@ -61,12 +62,6 @@ __FBSDID("$FreeBSD$");
 #define	EXIDX_CANTUNWIND	1
 
 /*
- * These are set in the linker script. Their addresses will be
- * either the start or end of the exception table or index.
- */
-extern int exidx_start, exidx_end;
-
-/*
  * Entry types.
  * These are the only entry types that have been seen in the kernel.
  */
@@ -154,9 +149,9 @@ find_index(uint32_t addr, int search_modules)
 	int32_t prel31_addr;
 	uint32_t func_addr;
 
-	start = (struct unwind_idx *)&exidx_start;
-	idx_start = (caddr_t)&exidx_start;
-	idx_end = (caddr_t)&exidx_end;
+	start = (struct unwind_idx *)&_exidx_start;
+	idx_start = (caddr_t)&_exidx_start;
+	idx_end = (caddr_t)&_exidx_end;
 
 	/* This may acquire a lock */
 	if (search_modules) {

Modified: head/sys/arm/include/machdep.h
==============================================================================
--- head/sys/arm/include/machdep.h	Fri Dec  6 03:46:38 2019	(r355438)
+++ head/sys/arm/include/machdep.h	Fri Dec  6 03:48:35 2019	(r355439)
@@ -61,4 +61,24 @@ void arm_add_efi_map_entries(struct efi_map_header *ef
     struct mem_region *mr, int *mrcnt);
 #endif
 
+/*
+ * Symbols created by ldscript.arm which are accessible in the kernel as global
+ * symbols. They have uint8 type because they mark the byte location where the
+ * corresponding data starts or ends (in the end case, it's the next byte
+ * following the data, so the data size is end-start).  These are listed below
+ * in the order they occur within the kernel (i.e., the address of each variable
+ * should be greater than any of the ones before it).
+ */
+extern uint8_t _start;		/* Kernel entry point in locore.S */
+extern uint8_t _etext;		/* text segment end */
+extern uint8_t _extab_start;	/* unwind table start */
+extern uint8_t _exidx_start;	/* unwind index start */
+extern uint8_t _exidx_end;	/* unwind index end */
+extern uint8_t _start_ctors;	/* ctors data start */
+extern uint8_t _stop_ctors;	/* ctors data end */
+extern uint8_t _edata;		/* data segment end */
+extern uint8_t __bss_start;	/* bss segment start */
+extern uint8_t _ebss;		/* bss segment end */
+extern uint8_t _end;		/* End of kernel (text+ctors+unwind+data+bss) */
+
 #endif /* !_MACHINE_MACHDEP_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912060348.xB63mZu3089242>