Module Name:    src
Committed By:   skrll
Date:           Fri Aug 28 13:15:05 UTC 2020

Modified Files:
        src/sys/arch/arm/arm: armv6_start.S
        src/sys/arch/arm/arm32: arm32_machdep.c

Log Message:
Use C rather than assembly


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/arm/armv6_start.S
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/arm/arm32/arm32_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/armv6_start.S
diff -u src/sys/arch/arm/arm/armv6_start.S:1.25 src/sys/arch/arm/arm/armv6_start.S:1.26
--- src/sys/arch/arm/arm/armv6_start.S:1.25	Fri Aug 28 13:00:29 2020
+++ src/sys/arch/arm/arm/armv6_start.S	Fri Aug 28 13:15:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv6_start.S,v 1.25 2020/08/28 13:00:29 skrll Exp $	*/
+/*	$NetBSD: armv6_start.S,v 1.26 2020/08/28 13:15:05 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2017, 2018 The NetBSD Foundation, Inc.
@@ -897,21 +897,6 @@ armv7_mpcontinuation:
 	mov	r0, R_INDEX
 	bl	cpu_init_secondary_processor
 
-	/* r0 = &cpu_info_store[0] */
-	movw	r0, #:lower16:cpu_info_store
-	movt	r0, #:upper16:cpu_info_store
-
-	mov	r4, #CPU_INFO_SIZE
-	mul	r5, r4, R_INDEX
-	add	r0, r5
-
-	mrc	p15, 0, r1, c0, c0, 0	// MIDR get
-	str	r1, [r0, #CI_MIDR]
-	mrc	p15, 0, r1, c0, c0, 5	// MPIDR get
-	str	r1, [r0, #CI_MPIDR]
-
-	bl	arm_cpu_topology_set
-
 	/*
 	 * Wait for cpu_boot_secondary_processors
 	 */

Index: src/sys/arch/arm/arm32/arm32_machdep.c
diff -u src/sys/arch/arm/arm32/arm32_machdep.c:1.136 src/sys/arch/arm/arm32/arm32_machdep.c:1.137
--- src/sys/arch/arm/arm32/arm32_machdep.c:1.136	Fri Jul 10 12:25:09 2020
+++ src/sys/arch/arm/arm32/arm32_machdep.c	Fri Aug 28 13:15:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_machdep.c,v 1.136 2020/07/10 12:25:09 skrll Exp $	*/
+/*	$NetBSD: arm32_machdep.c,v 1.137 2020/08/28 13:15:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.136 2020/07/10 12:25:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.137 2020/08/28 13:15:05 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_arm_start.h"
@@ -78,6 +78,7 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_machde
 
 #include <arm/locore.h>
 
+#include <arm/cpu_topology.h>
 #include <arm/arm32/machdep.h>
 
 #include <machine/bootconfig.h>
@@ -771,13 +772,25 @@ cpu_init_secondary_processor(int cpuinde
 	VPRINTS(")");
 #endif
 
+	struct cpu_info * ci = &cpu_info_store[cpuindex];
+
+	VPRINTS(" ci = ");
+	VPRINTX((int)ci);
+
+	ci->ci_midr = armreg_midr_read();
+	ci->ci_mpidr = armreg_mpidr_read();
+
+	arm_cpu_topology_set(ci, ci->ci_mpidr);
+
 	VPRINTS(" hatched|=");
 	VPRINTX(__BIT(cpuindex));
 	VPRINTS("\n\r");
 
 	cpu_set_hatched(cpuindex);
 
-	/* return to assembly to wait for cpu_boot_secondary_processors */
+	/*
+	 * return to assembly to wait for cpu_boot_secondary_processors
+	 */
 }
 
 void

Reply via email to