Subject: port-sparc/3604: pmap_enk* calls wrong pmap_changeprot
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik E. Fair <fair@atomic.clock.org>
List: netbsd-bugs
Date: 05/10/1997 18:45:59
>Number:         3604
>Category:       port-sparc
>Synopsis:       pmap_enk*() in pmap.c calls pmap_changeprot()
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 10 18:50:01 1997
>Last-Modified:
>Originator:     Erik E. Fair
>Organization:
International Organization of Internet Clock Watchers
>Release:        NetBSD-current, May 10, 1997
>Environment:

System: NetBSD atomic.clock.org 1.2D NetBSD 1.2D (GENERIC) #42: Wed Apr 23 08:06:27 PDT 1997 root@atomic.clock.org:/usr/src/sys/arch/sparc/compile/GENERIC sparc


>Description:
	pmap_enk4m (and pmap_enk4_4c) call pmap_changeprot, when
	they should call pmap_changeprot4m (and pmap_changeprot4_4c)
	because by the time you get into the appropriate pmap_enk*
	routine, you already know which type of architecture you're
	on, and don't need to indirect through the function pointers.

	In addition, I missed one diagnostic message from pr # port-sparc/3602

>How-To-Repeat:
	code inspection
>Fix:
	
*** pmap.c.orig0	Sat May 10 15:59:12 1997
--- pmap.c	Sat May 10 18:33:39 1997
***************
*** 614,626 ****
  
  #ifdef DEBUG
  	if (pm->pm_regmap == NULL || rm == NULL)
! 		panic("setpte4m: no regmap entry");
  #endif
  	sm = &rm->rg_segmap[VA_VSEG(va)];
  
  #ifdef DEBUG
  	if (rm->rg_segmap == NULL || sm == NULL || sm->sg_pte == NULL)
! 		panic("setpte4m: no segmap for va %p", (caddr_t)va);
  #endif
  	sm->sg_pte[VA_SUN4M_VPG(va)] = pte; /* set new pte */
  }
--- 614,626 ----
  
  #ifdef DEBUG
  	if (pm->pm_regmap == NULL || rm == NULL)
! 		panic("setptesw4m: no regmap entry");
  #endif
  	sm = &rm->rg_segmap[VA_VSEG(va)];
  
  #ifdef DEBUG
  	if (rm->rg_segmap == NULL || sm == NULL || sm->sg_pte == NULL)
! 		panic("setptesw4m: no segmap for va %p", (caddr_t)va);
  #endif
  	sm->sg_pte[VA_SUN4M_VPG(va)] = pte; /* set new pte */
  }
***************
*** 4992,4998 ****
  		    (pteproto & (PG_PFNUM|PG_TYPE))) {
  			/* just changing protection and/or wiring */
  			splx(s);
! 			pmap_changeprot(pm, va, prot, wired);
  			return;
  		}
  
--- 4992,4998 ----
  		    (pteproto & (PG_PFNUM|PG_TYPE))) {
  			/* just changing protection and/or wiring */
  			splx(s);
! 			pmap_changeprot4_4c(pm, va, prot, wired);
  			return;
  		}
  
***************
*** 5356,5362 ****
  		if ((tpte & SRMMU_PPNMASK) == (pteproto & SRMMU_PPNMASK)) {
  			/* just changing protection and/or wiring */
  			splx(s);
! 			pmap_changeprot(pm, va, prot, wired);
  			return;
  		}
  
--- 5356,5362 ----
  		if ((tpte & SRMMU_PPNMASK) == (pteproto & SRMMU_PPNMASK)) {
  			/* just changing protection and/or wiring */
  			splx(s);
! 			pmap_changeprot4m(pm, va, prot, wired);
  			return;
  		}
  
>Audit-Trail:
>Unformatted: