Module Name: src
Committed By: chs
Date: Wed Jan 13 16:42:17 UTC 2021
Modified Files:
src/sys/arch/sparc/sparc: pmap.c
Log Message:
in pmap_writetext(), restore the context also when we return early.
To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/sys/arch/sparc/sparc/pmap.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/sparc/sparc/pmap.c
diff -u src/sys/arch/sparc/sparc/pmap.c:1.370 src/sys/arch/sparc/sparc/pmap.c:1.371
--- src/sys/arch/sparc/sparc/pmap.c:1.370 Mon Jan 11 06:12:43 2021
+++ src/sys/arch/sparc/sparc/pmap.c Wed Jan 13 16:42:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.370 2021/01/11 06:12:43 chs Exp $ */
+/* $NetBSD: pmap.c,v 1.371 2021/01/13 16:42:17 chs Exp $ */
/*
* Copyright (c) 1996
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.370 2021/01/11 06:12:43 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.371 2021/01/13 16:42:17 chs Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -7868,8 +7868,7 @@ pmap_writetext(unsigned char *dst, int c
if (CPU_HAS_SRMMU) {
pte0 = getpte4m(va);
if ((pte0 & SRMMU_TETYPE) != SRMMU_TEPTE) {
- splx(s);
- return;
+ goto out;
}
pte = pte0 | PPROT_WRITE;
setpte4m(va, pte);
@@ -7882,8 +7881,7 @@ pmap_writetext(unsigned char *dst, int c
if (CPU_ISSUN4C || CPU_ISSUN4) {
pte0 = getpte4(va);
if ((pte0 & PG_V) == 0) {
- splx(s);
- return;
+ goto out;
}
pte = pte0 | PG_W;
setpte4(va, pte);
@@ -7892,6 +7890,8 @@ pmap_writetext(unsigned char *dst, int c
}
#endif
cache_flush(dst, 1);
+
+out:
setcontext(ctx);
splx(s);
}