From owner-svn-src-all@freebsd.org Fri Dec 6 03:48:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40EB01B4F98; Fri, 6 Dec 2019 03:48:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Tdq80ywnz3xVT; Fri, 6 Dec 2019 03:48:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045F4234B2; Fri, 6 Dec 2019 03:48:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB63mZHq089245; Fri, 6 Dec 2019 03:48:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB63mZu3089242; Fri, 6 Dec 2019 03:48:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912060348.xB63mZu3089242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 6 Dec 2019 03:48:35 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 355439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2019 03:48:36 -0000 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 #include +#include #include #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_ */