Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hppa Fix cur{lwp,cpu} and other bits for MODULES
details: https://anonhg.NetBSD.org/src/rev/135aa15c24dd
branches: trunk
changeset: 1009202:135aa15c24dd
user: skrll <skrll%NetBSD.org@localhost>
date: Thu Apr 16 09:28:52 2020 +0000
description:
Fix cur{lwp,cpu} and other bits for MODULES
diffstat:
sys/arch/hppa/hppa/hppa_machdep.c | 19 +++++++++++++++++--
sys/arch/hppa/include/cpu.h | 22 ++++++++++++++++------
2 files changed, 33 insertions(+), 8 deletions(-)
diffs (107 lines):
diff -r aea098415301 -r 135aa15c24dd sys/arch/hppa/hppa/hppa_machdep.c
--- a/sys/arch/hppa/hppa/hppa_machdep.c Thu Apr 16 08:59:16 2020 +0000
+++ b/sys/arch/hppa/hppa/hppa_machdep.c Thu Apr 16 09:28:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hppa_machdep.c,v 1.30 2019/11/23 19:40:35 ad Exp $ */
+/* $NetBSD: hppa_machdep.c,v 1.31 2020/04/16 09:28:52 skrll Exp $ */
/*-
* Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.30 2019/11/23 19:40:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.31 2020/04/16 09:28:52 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -303,3 +303,18 @@
setsoftast(l);
}
}
+
+#ifdef MODULAR
+struct lwp *
+hppa_curlwp(void)
+{
+ return curlwp;
+}
+
+struct cpu_info *
+hppa_curcpu(void)
+{
+ return curcpu();
+}
+#endif
+
diff -r aea098415301 -r 135aa15c24dd sys/arch/hppa/include/cpu.h
--- a/sys/arch/hppa/include/cpu.h Thu Apr 16 08:59:16 2020 +0000
+++ b/sys/arch/hppa/include/cpu.h Thu Apr 16 09:28:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.9 2019/12/05 08:00:05 skrll Exp $ */
+/* $NetBSD: cpu.h,v 1.10 2020/04/16 09:28:52 skrll Exp $ */
/* $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $ */
@@ -316,12 +316,20 @@
void cpu_proc_fork(struct proc *, struct proc *);
-#ifdef MULTIPROCESSOR
+struct lwp *hppa_curlwp(void);
+struct cpu_info *hppa_curcpu(void);
+#if defined(_MODULE)
+#define curcpu() hppa_curcpu()
+#define curlwp hppa_curlwp()
+#endif
+
+#if defined(MULTIPROCESSOR) || defined(_MODULE)
/* Number of CPUs in the system */
extern int hppa_ncpu;
#define HPPA_MAXCPUS 4
+
#define cpu_number() (curcpu()->ci_cpuid)
#define CPU_IS_PRIMARY(ci) ((ci)->ci_cpuid == 0)
@@ -330,8 +338,9 @@
void cpu_boot_secondary_processors(void);
+#if !defined(_MODULE)
static __inline struct cpu_info *
-hppa_curcpu(void)
+_hppa_curcpu(void)
{
struct cpu_info *ci;
@@ -340,7 +349,8 @@
return ci;
}
-#define curcpu() hppa_curcpu()
+#define curcpu() _hppa_curcpu()
+#endif
#else /* MULTIPROCESSOR */
@@ -349,7 +359,7 @@
#define cpu_number() 0
static __inline struct lwp *
-hppa_curlwp(void)
+_hppa_curlwp(void)
{
struct lwp *l;
@@ -358,7 +368,7 @@
return l;
}
-#define curlwp hppa_curlwp()
+#define curlwp _hppa_curlwp()
#endif /* MULTIPROCESSOR */
Home |
Main Index |
Thread Index |
Old Index