From dfe1112fa878c5d8fa0605d1de10c96ecc993569 Mon Sep 17 00:00:00 2001 From: rlibby Date: Fri, 21 Jul 2017 17:11:36 +0000 Subject: [PATCH] __pcpu: gcc -Wredundant-decls Pollution from counter.h made __pcpu visible in amd64/pmap.c. Delete the existing extern decl of __pcpu in amd64/pmap.c and avoid referring to that symbol, instead accessing the pcpu region via PCPU_SET macros. Also delete an unused extern decl of __pcpu from mp_x86.c. Reviewed by: kib Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11666 --- sys/amd64/amd64/pmap.c | 6 ++---- sys/x86/x86/mp_x86.c | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 05572ebd0ab2..5b0bdfdd1c1e 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -274,8 +274,6 @@ pmap_modified_bit(pmap_t pmap) return (mask); } -extern struct pcpu __pcpu[]; - #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -1063,8 +1061,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN; kernel_pmap->pm_pcids[i].pm_gen = 1; } - __pcpu[0].pc_pcid_next = PMAP_PCID_KERN + 1; - __pcpu[0].pc_pcid_gen = 1; + PCPU_SET(pcid_next, PMAP_PCID_KERN + 1); + PCPU_SET(pcid_gen, 1); /* * pcpu area for APs is zeroed during AP startup. * pc_pcid_next and pc_pcid_gen are initialized by AP diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 63146dc0173b..e69a7d704f09 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -90,8 +90,6 @@ int mcount_lock; int mp_naps; /* # of Applications processors */ int boot_cpu_id = -1; /* designated BSP */ -extern struct pcpu __pcpu[]; - /* AP uses this during bootstrap. Do not staticize. */ char *bootSTK; int bootAP;