Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/aarch64/aarch64 Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/f7929fad7fd6
branches:  netbsd-9
changeset: 465983:f7929fad7fd6
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Dec 08 14:37:29 2019 +0000

description:
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

diffstat:

 sys/arch/aarch64/aarch64/kobj_machdep.c |  24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (59 lines):

diff -r c46827401954 -r f7929fad7fd6 sys/arch/aarch64/aarch64/kobj_machdep.c
--- a/sys/arch/aarch64/aarch64/kobj_machdep.c   Sun Dec 08 14:36:21 2019 +0000
+++ b/sys/arch/aarch64/aarch64/kobj_machdep.c   Sun Dec 08 14:37:29 2019 +0000
@@ -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 <ryo%nerv.org@localhost>
@@ -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 @@
        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;
 }



Home | Main Index | Thread Index | Old Index