Module Name: src
Committed By: martin
Date: Sun Dec 8 14:37:29 UTC 2019
Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: kobj_machdep.c
Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #513):
sys/arch/aarch64/aarch64/kobj_machdep.c: revision 1.3
Flush insn / data caches after loading modules
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/sys/arch/aarch64/aarch64/kobj_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/aarch64/aarch64/kobj_machdep.c
diff -u src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.2 src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.2.8.1
--- src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.2 Sun Aug 19 20:02:22 2018
+++ src/sys/arch/aarch64/aarch64/kobj_machdep.c Sun Dec 8 14:37:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: kobj_machdep.c,v 1.2 2018/08/19 20:02:22 ryo Exp $ */
+/* $NetBSD: kobj_machdep.c,v 1.2.8.1 2019/12/08 14:37:29 martin Exp $ */
/*
* Copyright (c) 2018 Ryo Shimizu <[email protected]>
@@ -27,19 +27,21 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kobj_machdep.c,v 1.2 2018/08/19 20:02:22 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kobj_machdep.c,v 1.2.8.1 2019/12/08 14:37:29 martin Exp $");
#define ELFSIZE ARCH_ELFSIZE
#include "opt_ddb.h"
#include <sys/param.h>
+#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/exec.h>
#include <sys/exec_elf.h>
#include <sys/errno.h>
#include <sys/queue.h>
#include <sys/tree.h>
+#include <sys/xcall.h>
#include <aarch64/cpufunc.h>
@@ -357,8 +359,26 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
return 0;
}
+static void
+kobj_idcache_wbinv_all(void)
+{
+ cpu_idcache_wbinv_all();
+}
+
int
kobj_machdep(kobj_t ko, void *base, size_t size, bool load)
{
+ uint64_t where;
+
+ if (load) {
+ if (cold) {
+ kobj_idcache_wbinv_all();
+ } else {
+ where = xc_broadcast(0,
+ (xcfunc_t)kobj_idcache_wbinv_all, NULL, NULL);
+ xc_wait(where);
+ }
+ }
+
return 0;
}