Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm Use C rather than assembly



details:   https://anonhg.NetBSD.org/src/rev/6437d9d8f136
branches:  trunk
changeset: 943194:6437d9d8f136
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Aug 28 13:15:05 2020 +0000

description:
Use C rather than assembly

diffstat:

 sys/arch/arm/arm/armv6_start.S     |  17 +----------------
 sys/arch/arm/arm32/arm32_machdep.c |  19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 19 deletions(-)

diffs (84 lines):

diff -r 0a119d25e9c8 -r 6437d9d8f136 sys/arch/arm/arm/armv6_start.S
--- a/sys/arch/arm/arm/armv6_start.S    Fri Aug 28 13:13:55 2020 +0000
+++ b/sys/arch/arm/arm/armv6_start.S    Fri Aug 28 13:15:05 2020 +0000
@@ -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 @@
        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
         */
diff -r 0a119d25e9c8 -r 6437d9d8f136 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Fri Aug 28 13:13:55 2020 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Fri Aug 28 13:15:05 2020 +0000
@@ -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 @@
 
 #include <arm/locore.h>
 
+#include <arm/cpu_topology.h>
 #include <arm/arm32/machdep.h>
 
 #include <machine/bootconfig.h>
@@ -771,13 +772,25 @@
        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



Home | Main Index | Thread Index | Old Index