Subject: port-sun3/8830: sun3x/pmap.c cannot compile after pmap_enter() API change
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 11/19/1999 18:18:39
>Number:         8830
>Category:       port-sun3
>Synopsis:       sun3x/pmap.c cannot compile after pmap_enter() API change
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-sun3-maintainer (NetBSD/sun3 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 19 18:18:00 1999
>Last-Modified:
>Originator:     Izumi Tsutsui
>Organization:
Izumi Tsutsui	Himeji City, JAPAN
>Release:        NetBSD-current 19991119
>Environment:
System: NetBSD 1.4P sun3/80

>Description:
pmap_enter() API change causes variable name conflicts
in sun3x/pmap.c:pmap_enter() so it cannot compile.

>How-To-Repeat:
config and build a sun3x kernel:

[...]
cc  -O2 -fno-defer-pop -msoft-float -Werror -Wall -Wstrict-prototypes \
-Wmissing-prototypes  -Wpointer-arith -Wno-main -nostdinc -I. \
-I../../../../arch -I../../../.. -I../../../../../gnu/sys \
-undef -D__NetBSD__ -Dm68k -Dmc68000 -D_KERNEL -Dsun3 -D_SUN3X_ \
-DLKM -DDIAGNOSTIC -DNKMEMCLUSTERS="(2 * 2048 * 1024 / CLBYTES)" \
-DMAXUSERS=8  -c ../../../../arch/sun3/sun3x/pmap.c
cc1: warnings being treated as errors
../../../../arch/sun3/sun3x/pmap.c: In function `pmap_enter':
../../../../arch/sun3/sun3x/pmap.c:1695: warning: declaration of `flags' shadows a parameter
*** Error code 1

Stop.

>Fix:
Change local 'flags' variable name.

diff -u -r1.1.1.4 pmap.c
--- pmap.c	1999/11/19 21:32:27	1.1.1.4
+++ pmap.c	1999/11/20 02:03:16
@@ -1682,7 +1682,7 @@
 	boolean_t insert, managed; /* Marks the need for PV insertion.*/
 	u_short nidx;            /* PV list index                     */
 	int s;                   /* Used for splimp()/splx()          */
-	int flags;               /* Mapping flags. eg. Cache inhibit  */
+	int mflags;              /* Mapping flags. eg. Cache inhibit  */
 	u_int a_idx, b_idx, pte_idx; /* table indices                 */
 	a_tmgr_t *a_tbl;         /* A: long descriptor table manager  */
 	b_tmgr_t *b_tbl;         /* B: short descriptor table manager */
@@ -1701,7 +1701,7 @@
 		return (KERN_SUCCESS);
 	}
 
-	flags  = (pa & ~MMU_PAGE_MASK);
+	mflags  = (pa & ~MMU_PAGE_MASK);
 	pa    &= MMU_PAGE_MASK;
 
 	/*
@@ -1710,7 +1710,7 @@
 	 * device and hence it would be disasterous to cache its contents.
 	 */
 	if ((managed = is_managed(pa)) == FALSE)
-		flags |= PMAP_NC;
+		mflags |= PMAP_NC;
 
 	/*
 	 * For user mappings we walk along the MMU tables of the given
@@ -2000,7 +2000,7 @@
 	 * bits found on the lower order of the physical address.)
 	 * mark the PTE as a cache inhibited page.
 	 */
-	if (flags & PMAP_NC)
+	if (mflags & PMAP_NC)
 		c_pte->attr.raw |= MMU_SHORT_PTE_CI;
 
 	/*
>Audit-Trail:
>Unformatted: