Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2020 11:09:07 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368631 - in stable/12/sys/arm: arm include
Message-ID:  <202012141109.0BEB97qF035777@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Mon Dec 14 11:09:07 2020
New Revision: 368631
URL: https://svnweb.freebsd.org/changeset/base/368631

Log:
  MFC r368161:
  
    Store MPIDR register in pcpu.

Modified:
  stable/12/sys/arm/arm/machdep.c
  stable/12/sys/arm/arm/mp_machdep.c
  stable/12/sys/arm/include/pcpu.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/arm/machdep.c
==============================================================================
--- stable/12/sys/arm/arm/machdep.c	Mon Dec 14 10:16:59 2020	(r368630)
+++ stable/12/sys/arm/arm/machdep.c	Mon Dec 14 11:09:07 2020	(r368631)
@@ -377,6 +377,8 @@ DELAY(int usec)
 void
 cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
 {
+
+	pcpu->pc_mpidr = 0xffffffff;
 }
 
 void
@@ -761,6 +763,7 @@ pcpu0_init(void)
 	set_curthread(&thread0);
 #endif
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
+	pcpup->pc_mpidr = cp15_mpidr_get() & 0xFFFFFF;
 	PCPU_SET(curthread, &thread0);
 }
 

Modified: stable/12/sys/arm/arm/mp_machdep.c
==============================================================================
--- stable/12/sys/arm/arm/mp_machdep.c	Mon Dec 14 10:16:59 2020	(r368630)
+++ stable/12/sys/arm/arm/mp_machdep.c	Mon Dec 14 11:09:07 2020	(r368631)
@@ -162,6 +162,7 @@ init_secondary(int cpu)
 		;
 
 	pcpu_init(pc, cpu, sizeof(struct pcpu));
+	pc->pc_mpidr = cp15_mpidr_get() & 0xFFFFFF;
 	dpcpu_init(dpcpu[cpu - 1], cpu);
 #if __ARM_ARCH >= 6 && defined(DDB)
 	dbg_monitor_init_secondary();

Modified: stable/12/sys/arm/include/pcpu.h
==============================================================================
--- stable/12/sys/arm/include/pcpu.h	Mon Dec 14 10:16:59 2020	(r368630)
+++ stable/12/sys/arm/include/pcpu.h	Mon Dec 14 11:09:07 2020	(r368631)
@@ -66,7 +66,8 @@ struct vmspace;
 	int pc_bp_harden_kind;						\
 	uint32_t pc_original_actlr;					\
 	uint64_t pc_clock;						\
-	char __pad[139]
+	uint32_t pc_mpidr;						\
+	char __pad[135]
 #else
 #define PCPU_MD_FIELDS							\
 	char __pad[93]



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