Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch New function cpu_startup_hook on arm.
details: https://anonhg.NetBSD.org/src/rev/d5f807f65aef
branches: trunk
changeset: 967702:d5f807f65aef
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Dec 18 21:45:43 2019 +0000
description:
New function cpu_startup_hook on arm.
Called at end of cpu_startup. Can be defined in, e.g., evbarm to do
additional stuff after cpu_startup. Defined as a weak alias to a
function that does nothing, so optional.
ok jmcneill
diffstat:
sys/arch/aarch64/aarch64/aarch64_machdep.c | 12 ++++++++++--
sys/arch/aarch64/include/machdep.h | 5 ++++-
sys/arch/arm/arm32/arm32_machdep.c | 12 ++++++++++--
sys/arch/arm/include/arm32/machdep.h | 5 ++++-
4 files changed, 28 insertions(+), 6 deletions(-)
diffs (104 lines):
diff -r 3bd977458477 -r d5f807f65aef sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c Wed Dec 18 20:38:14 2019 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c Wed Dec 18 21:45:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.34 2019/11/14 17:09:22 maxv Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.35 2019/12/18 21:45:43 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.34 2019/11/14 17:09:22 maxv Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.35 2019/12/18 21:45:43 riastradh Exp $");
#include "opt_arm_debug.h"
#include "opt_ddb.h"
@@ -595,6 +595,14 @@
/* Hello! */
banner();
+
+ cpu_startup_hook();
+}
+
+__weak_alias(cpu_startup_hook,cpu_startup_default)
+void
+cpu_startup_default(void)
+{
}
/*
diff -r 3bd977458477 -r d5f807f65aef sys/arch/aarch64/include/machdep.h
--- a/sys/arch/aarch64/include/machdep.h Wed Dec 18 20:38:14 2019 +0000
+++ b/sys/arch/aarch64/include/machdep.h Wed Dec 18 21:45:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.8 2019/07/16 16:18:56 skrll Exp $ */
+/* $NetBSD: machdep.h,v 1.9 2019/12/18 21:45:43 riastradh Exp $ */
/*
* Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -83,6 +83,9 @@
void parse_mi_bootargs(char *);
void dumpsys(void);
+void cpu_startup_hook(void);
+void cpu_startup_default(void);
+
struct trapframe;
/* fault.c */
diff -r 3bd977458477 -r d5f807f65aef sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c Wed Dec 18 20:38:14 2019 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c Wed Dec 18 21:45:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm32_machdep.c,v 1.128 2019/05/10 16:43:09 skrll Exp $ */
+/* $NetBSD: arm32_machdep.c,v 1.129 2019/12/18 21:45:44 riastradh Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.128 2019/05/10 16:43:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.129 2019/12/18 21:45:44 riastradh Exp $");
#include "opt_arm_debug.h"
#include "opt_arm_start.h"
@@ -353,6 +353,14 @@
#else
tf->tf_spsr = PSR_USR32_MODE;
#endif
+
+ cpu_startup_hook();
+}
+
+__weak_alias(cpu_startup_hook,cpu_startup_default)
+void
+cpu_startup_default(void)
+{
}
/*
diff -r 3bd977458477 -r d5f807f65aef sys/arch/arm/include/arm32/machdep.h
--- a/sys/arch/arm/include/arm32/machdep.h Wed Dec 18 20:38:14 2019 +0000
+++ b/sys/arch/arm/include/arm32/machdep.h Wed Dec 18 21:45:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.29 2019/07/16 14:41:43 skrll Exp $ */
+/* $NetBSD: machdep.h,v 1.30 2019/12/18 21:45:44 riastradh Exp $ */
#ifndef _ARM32_MACHDEP_H_
#define _ARM32_MACHDEP_H_
@@ -73,6 +73,9 @@
struct pmap_devmap;
struct boot_physmem;
+void cpu_startup_hook(void);
+void cpu_startup_default(void);
+
static inline paddr_t
aarch32_kern_vtophys(vaddr_t va)
{
Home |
Main Index |
Thread Index |
Old Index