Module Name: src
Committed By: skrll
Date: Thu Apr 16 09:28:52 UTC 2020
Modified Files:
src/sys/arch/hppa/hppa: hppa_machdep.c
src/sys/arch/hppa/include: cpu.h
Log Message:
Fix cur{lwp,cpu} and other bits for MODULES
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hppa/hppa/hppa_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/include/cpu.h
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/hppa/hppa/hppa_machdep.c
diff -u src/sys/arch/hppa/hppa/hppa_machdep.c:1.30 src/sys/arch/hppa/hppa/hppa_machdep.c:1.31
--- src/sys/arch/hppa/hppa/hppa_machdep.c:1.30 Sat Nov 23 19:40:35 2019
+++ src/sys/arch/hppa/hppa/hppa_machdep.c Thu Apr 16 09:28:52 2020
@@ -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 @@ cpu_need_resched(struct cpu_info *ci, st
setsoftast(l);
}
}
+
+#ifdef MODULAR
+struct lwp *
+hppa_curlwp(void)
+{
+ return curlwp;
+}
+
+struct cpu_info *
+hppa_curcpu(void)
+{
+ return curcpu();
+}
+#endif
+
Index: src/sys/arch/hppa/include/cpu.h
diff -u src/sys/arch/hppa/include/cpu.h:1.9 src/sys/arch/hppa/include/cpu.h:1.10
--- src/sys/arch/hppa/include/cpu.h:1.9 Thu Dec 5 08:00:05 2019
+++ src/sys/arch/hppa/include/cpu.h Thu Apr 16 09:28:52 2020
@@ -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 @@ struct cpu_info {
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 @@ extern int hppa_ncpu;
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 @@ hppa_curcpu(void)
return ci;
}
-#define curcpu() hppa_curcpu()
+#define curcpu() _hppa_curcpu()
+#endif
#else /* MULTIPROCESSOR */
@@ -349,7 +359,7 @@ hppa_curcpu(void)
#define cpu_number() 0
static __inline struct lwp *
-hppa_curlwp(void)
+_hppa_curlwp(void)
{
struct lwp *l;
@@ -358,7 +368,7 @@ hppa_curlwp(void)
return l;
}
-#define curlwp hppa_curlwp()
+#define curlwp _hppa_curlwp()
#endif /* MULTIPROCESSOR */