Module Name: src
Committed By: mrg
Date: Tue Feb 6 09:22:58 UTC 2018
Modified Files:
src/sys/arch/sparc/sparc: pmap.c
Log Message:
workaround a problem -Warray-bounds triggers but isn't a problem
in practise, as described from this old commment:
/*
* Set up pm_regmap for kernel to point NUREG *below* the beginning
* of kernel regmap storage. Since the kernel only uses regions
* above NUREG, we save storage space and can index kernel and
* user regions in the same way.
*/
To generate a diff of this commit:
cvs rdiff -u -r1.362 -r1.363 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.362 src/sys/arch/sparc/sparc/pmap.c:1.363
--- src/sys/arch/sparc/sparc/pmap.c:1.362 Tue Jan 16 08:23:17 2018
+++ src/sys/arch/sparc/sparc/pmap.c Tue Feb 6 09:22:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.362 2018/01/16 08:23:17 mrg Exp $ */
+/* $NetBSD: pmap.c,v 1.363 2018/02/06 09:22:57 mrg Exp $ */
/*
* Copyright (c) 1996
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.362 2018/01/16 08:23:17 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.363 2018/02/06 09:22:57 mrg Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -3214,7 +3214,10 @@ pmap_bootstrap4_4c(void *top, int nctx,
* above NUREG, we save storage space and can index kernel and
* user regions in the same way.
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
kernel_pmap_store.pm_regmap = kernel_regmap_store - NUREG;
+#pragma GCC diagnostic pop
for (i = NKREG; --i >= 0;) {
#if defined(SUN4_MMU3L)
kernel_regmap_store[i].rg_smeg = reginval;
@@ -3592,7 +3595,10 @@ pmap_bootstrap4m(void *top)
* above NUREG, we save storage space and can index kernel and
* user regions in the same way.
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
kernel_pmap_store.pm_regmap = kernel_regmap_store - NUREG;
+#pragma GCC diagnostic pop
memset(kernel_regmap_store, 0, NKREG * sizeof(struct regmap));
memset(kernel_segmap_store, 0, NKREG * NSEGRG * sizeof(struct segmap));
for (i = NKREG; --i >= 0;) {