Subject: port-mac68k/2871: Eliminate many compiler warnings in sys/arch/mac68k w/DEBUG
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik Bertelsen <erik@aarhus1.uni-c.dk>
List: netbsd-bugs
Date: 10/20/1996 18:25:38
>Number:         2871
>Category:       port-mac68k
>Synopsis:       Eliminate many compiler warnings in arch/mac68k w/DEBUG
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 20 08:50:01 1996
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        1.2-current, 20. oct. 1996
>Environment:
	
NetBSD cx.ebe.dk 1.2A NetBSD 1.2A (EBECX) #48: Wed Oct 16 02:23:11 MET DST 1996     erik@cx.ebe.dk:/home/src/sys/arch/mac68k/compile/EBECX mac68k
>Description:
	With options DEBUG, mac68k sources still causes compilation warnings.
	Most of these involve printf's and mismatches between format
	specifications and actual argument types.
>How-To-Repeat:
	Build a kernel with options DEBUG, watch compilation messages.
>Fix:

Index: dev/nubus.c
===================================================================
RCS file: /usr/cvs-base/mac68k/dev/nubus.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 nubus.c
*** nubus.c	1996/10/19 20:20:29	1.1.1.2
--- nubus.c	1996/10/20 09:47:13
***************
*** 166,172 ****
  #ifdef DEBUG
  	if (nubus_debug & NDB_PROBE) {
  		pa = pmap_extract(pmap_kernel(), (vm_offset_t) rom_probe - 1);
! 		printf("probing slot %d, first probe at 0x%x (PA 0x%p).\n",
  		    slot, rom_probe - 1, pa);
  	}
  #endif
--- 166,172 ----
  #ifdef DEBUG
  	if (nubus_debug & NDB_PROBE) {
  		pa = pmap_extract(pmap_kernel(), (vm_offset_t) rom_probe - 1);
! 		printf("probing slot %d, first probe at 0x%p (PA 0x%lx).\n",
  		    slot, rom_probe - 1, pa);
  	}
  #endif
***************
*** 231,237 ****
  	hdr = IncPtr(fmt, hdr, -hdr_size);
  #ifdef DEBUG
  	if (nubus_debug & NDB_PROBE)
! 		printf("fmt->top is 0x%p, that minus 0x%x puts us at 0x%p.\n",
  			fmt->top, hdr_size, hdr);
  #if 0
  	for (i=1 ; i < 8 ; i++) {
--- 231,237 ----
  	hdr = IncPtr(fmt, hdr, -hdr_size);
  #ifdef DEBUG
  	if (nubus_debug & NDB_PROBE)
! 		printf("fmt->top is 0x%lx, that minus 0x%x puts us at 0x%lx.\n",
  			fmt->top, hdr_size, hdr);
  #if 0
  	for (i=1 ; i < 8 ; i++) {
Index: machdep.c
===================================================================
RCS file: /usr/cvs-base/mac68k/mac68k/machdep.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 machdep.c
*** machdep.c	1996/10/19 20:24:39	1.1.1.2
--- machdep.c	1996/10/20 15:14:07
***************
*** 537,543 ****
  		(void) grow(p, (unsigned) fp);
  #ifdef DEBUG
  	if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
! 		printf("sendsig(%d): sig %d ssp %x usp %x scp %x ft %d\n",
  		    p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft);
  #endif
  	if (useracc((caddr_t) fp, sizeof(struct sigframe), B_WRITE) == 0) {
--- 537,543 ----
  		(void) grow(p, (unsigned) fp);
  #ifdef DEBUG
  	if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
! 		printf("sendsig(%d): sig %d ssp %p usp %p scp %p ft %d\n",
  		    p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft);
  #endif
  	if (useracc((caddr_t) fp, sizeof(struct sigframe), B_WRITE) == 0) {
***************
*** 607,613 ****
  	}
  #ifdef DEBUG
  	if ((sigdebug & SDB_FPSTATE) && *(char *) &kfp->sf_state.ss_fpstate)
! 		printf("sendsig(%d): copy out FP state (%x) to %x\n",
  		    p->p_pid, *(u_int *) & kfp->sf_state.ss_fpstate,
  		    &kfp->sf_state.ss_fpstate);
  #endif
--- 607,613 ----
  	}
  #ifdef DEBUG
  	if ((sigdebug & SDB_FPSTATE) && *(char *) &kfp->sf_state.ss_fpstate)
! 		printf("sendsig(%d): copy out FP state (%x) to %p\n",
  		    p->p_pid, *(u_int *) & kfp->sf_state.ss_fpstate,
  		    &kfp->sf_state.ss_fpstate);
  #endif
***************
*** 626,632 ****
  	frame->f_regs[SP] = (int) fp;
  #ifdef DEBUG
  	if (sigdebug & SDB_FOLLOW)
! 		printf("sendsig(%d): sig %d scp %x fp %x sc_sp %x sc_ap %x\n",
  		    p->p_pid, sig, kfp->sf_scp, fp,
  		    kfp->sf_sc.sc_sp, kfp->sf_sc.sc_ap);
  #endif
--- 626,632 ----
  	frame->f_regs[SP] = (int) fp;
  #ifdef DEBUG
  	if (sigdebug & SDB_FOLLOW)
! 		printf("sendsig(%d): sig %d scp %p fp %p sc_sp %x sc_ap %x\n",
  		    p->p_pid, sig, kfp->sf_scp, fp,
  		    kfp->sf_sc.sc_sp, kfp->sf_sc.sc_ap);
  #endif
***************
*** 671,677 ****
  	scp = SCARG(uap, sigcntxp);
  #ifdef DEBUG
  	if (sigdebug & SDB_FOLLOW)
! 		printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp);
  #endif
  	if ((int) scp & 1)
  		return (EINVAL);
--- 671,677 ----
  	scp = SCARG(uap, sigcntxp);
  #ifdef DEBUG
  	if (sigdebug & SDB_FOLLOW)
! 		printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
  #endif
  	if ((int) scp & 1)
  		return (EINVAL);
***************
*** 724,730 ****
  		return (EJUSTRETURN);
  #ifdef DEBUG
  	if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
! 		printf("sigreturn(%d): ssp %x usp %x scp %x ft %d\n",
  		    p->p_pid, &flags, scp->sc_sp, SCARG(uap, sigcntxp),
  		    (flags & SS_RTEFRAME) ? tstate.ss_frame.f_format : -1);
  #endif
--- 724,730 ----
  		return (EJUSTRETURN);
  #ifdef DEBUG
  	if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
! 		printf("sigreturn(%d): ssp %p usp %x scp %p ft %d\n",
  		    p->p_pid, &flags, scp->sc_sp, SCARG(uap, sigcntxp),
  		    (flags & SS_RTEFRAME) ? tstate.ss_frame.f_format : -1);
  #endif
***************
*** 764,770 ****
  		m68881_restore(&tstate.ss_fpstate);
  #ifdef DEBUG
  	if ((sigdebug & SDB_FPSTATE) && *(char *) &tstate.ss_fpstate)
! 		printf("sigreturn(%d): copied in FP state (%x) at %x\n",
  		    p->p_pid, *(u_int *) & tstate.ss_fpstate,
  		    &tstate.ss_fpstate);
  	if ((sigdebug & SDB_FOLLOW) ||
--- 764,770 ----
  		m68881_restore(&tstate.ss_fpstate);
  #ifdef DEBUG
  	if ((sigdebug & SDB_FPSTATE) && *(char *) &tstate.ss_fpstate)
! 		printf("sigreturn(%d): copied in FP state (%x) at %p\n",
  		    p->p_pid, *(u_int *) & tstate.ss_fpstate,
  		    &tstate.ss_fpstate);
  	if ((sigdebug & SDB_FOLLOW) ||
***************
*** 1373,1382 ****
  	struct exec_package *epp;
  {
  	int     error = ENOEXEC;
- 	struct exec *execp = epp->ep_hdr;
  
  #ifdef COMPAT_NOMID
! 	if (execp->a_midmag == ZMAGIC)	/* i.e., MID == 0. */
  		return exec_aout_prep_oldzmagic(p, epp);
  #endif
  
--- 1373,1381 ----
  	struct exec_package *epp;
  {
  	int     error = ENOEXEC;
  
  #ifdef COMPAT_NOMID
! 	if (epp->ep_hdr->a_midmag == ZMAGIC)	/* i.e., MID == 0. */
  		return exec_aout_prep_oldzmagic(p, epp);
  #endif
  
Index: pmap.c
===================================================================
RCS file: /usr/cvs-base/mac68k/mac68k/pmap.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 pmap.c
*** pmap.c	1996/10/19 20:25:10	1.1.1.2
--- pmap.c	1996/10/19 20:37:45
***************
*** 379,387 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT) {
! 		printf("pmap_init: Sysseg %x, Sysmap %x, Sysptmap %x\n",
  		       Sysseg, Sysmap, Sysptmap);
! 		printf("  pstart %x, plast %x, vstart %x, vend %x\n",
  		    avail_start, avail_remaining, virtual_avail, virtual_end);
  	}
  #endif
--- 379,387 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT) {
! 		printf("pmap_init: Sysseg %p, Sysmap %p, Sysptmap %p\n",
  		       Sysseg, Sysmap, Sysptmap);
! 		printf("  pstart %lx, plast %x, vstart %lx, vend %lx\n",
  		    avail_start, avail_remaining, virtual_avail, virtual_end);
  	}
  #endif
***************
*** 405,411 ****
  	pmap_attributes = (char *) addr;
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: %x bytes: npages %x s0 %x(%x) tbl %x atr %x\n",
  		       s, npages, Segtabzero, Segtabzeropa,
  		       pv_table, pmap_attributes);
  #endif
--- 405,411 ----
  	pmap_attributes = (char *) addr;
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: %lx bytes: npages %x s0 %p(%p) tbl %p atr %p\n",
  		       s, npages, Segtabzero, Segtabzeropa,
  		       pv_table, pmap_attributes);
  #endif
***************
*** 448,454 ****
  #endif
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: KPT: %d pages from %x to %x\n",
  		       atop(s), addr, addr + s);
  #endif
  
--- 448,454 ----
  #endif
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: KPT: %ld pages from %lx to %lx\n",
  		       atop(s), addr, addr + s);
  #endif
  
***************
*** 478,484 ****
  		panic("pmap_init: cannot map range to pt_map");
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: pt_map [%x - %x)\n", addr, addr2);
  #endif
  
  #if defined(M68040)
--- 478,484 ----
  		panic("pmap_init: cannot map range to pt_map");
  #ifdef DEBUG
  	if (pmapdebug & PDB_INIT)
! 		printf("pmap_init: pt_map [%lx - %lx)\n", addr, addr2);
  #endif
  
  #if defined(M68040)
***************
*** 629,635 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_map(%x, %x, %x, %x)\n", va, spa, epa, prot);
  #endif
  
  	while (spa < epa) {
--- 629,635 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_map(%lx, %lx, %lx, %x)\n", va, spa, epa, prot);
  #endif
  
  	while (spa < epa) {
***************
*** 660,666 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
! 		printf("pmap_create(%x)\n", size);
  #endif
  
  	/*
--- 660,666 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
! 		printf("pmap_create(%lx)\n", size);
  #endif
  
  	/*
***************
*** 691,697 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
! 		printf("pmap_pinit(%x)\n", pmap);
  #endif
  
  	/*
--- 691,697 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
! 		printf("pmap_pinit(%p)\n", pmap);
  #endif
  
  	/*
***************
*** 727,733 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_destroy(%x)\n", pmap);
  #endif
  
  	simple_lock(&pmap->pm_lock);
--- 727,733 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_destroy(%p)\n", pmap);
  #endif
  
  	simple_lock(&pmap->pm_lock);
***************
*** 751,757 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_release(%x)\n", pmap);
  #endif
  
  #ifdef notdef /* DIAGNOSTIC */
--- 751,757 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_release(%p)\n", pmap);
  #endif
  
  #ifdef notdef /* DIAGNOSTIC */
***************
*** 782,788 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_reference(%x)\n", pmap);
  #endif
  
  	simple_lock(&pmap->pm_lock);
--- 782,788 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_reference(%p)\n", pmap);
  #endif
  
  	simple_lock(&pmap->pm_lock);
***************
*** 804,810 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB))
! 		printf("pmap_activate(%x, %x)\n", pmap, pcbp);
  #endif
  
  	PMAP_ACTIVATE(pmap, pcbp, pmap == curproc->p_vmspace->vm_map.pmap);
--- 804,810 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB))
! 		printf("pmap_activate(%p, %p)\n", pmap, pcbp);
  #endif
  
  	PMAP_ACTIVATE(pmap, pcbp, pmap == curproc->p_vmspace->vm_map.pmap);
***************
*** 837,843 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
! 		printf("pmap_remove(%x, %x, %x)\n", pmap, sva, eva);
  #endif
  
  	if (pmap == NULL)
--- 837,843 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
! 		printf("pmap_remove(%p, %lx, %lx)\n", pmap, sva, eva);
  #endif
  
  	if (pmap == NULL)
***************
*** 896,903 ****
  
  #ifdef DEBUG
  	if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
! 	    prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE))
! 		printf("pmap_page_protect(%x, %x)\n", pa, prot);
  #endif
  	if (!pmap_valid_page (pa))
  		return;
--- 896,903 ----
  
  #ifdef DEBUG
  	if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
! 	    (prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE)))
! 		printf("pmap_page_protect(%lx, %x)\n", pa, prot);
  #endif
  	if (!pmap_valid_page (pa))
  		return;
***************
*** 933,939 ****
  			pv = pv->pv_next;
  #ifdef DEBUG
  			if (pmapdebug & PDB_PARANOIA)
! 				printf("%s wired mapping for %x not removed\n",
  					"pmap_page_protect:", pa);
  #endif
  		}
--- 933,939 ----
  			pv = pv->pv_next;
  #ifdef DEBUG
  			if (pmapdebug & PDB_PARANOIA)
! 				printf("%s wired mapping for %lx not removed\n",
  					"pmap_page_protect:", pa);
  #endif
  		}
***************
*** 958,964 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
! 		printf("pmap_protect(%x, %x, %x, %x)\n", pmap, sva, eva, prot);
  #endif
  
  	if (pmap == NULL)
--- 958,964 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
! 		printf("pmap_protect(%p, %lx, %lx, %x)\n", pmap, sva, eva, prot);
  #endif
  
  	if (pmap == NULL)
***************
*** 1073,1079 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
! 		printf("pmap_enter(%x, %x, %x, %x, %x)\n",
  		       pmap, va, pa, prot, wired);
  #endif
  	if (pmap == NULL)
--- 1073,1079 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
! 		printf("pmap_enter(%p, %lx, %lx, %x, %x)\n",
  		       pmap, va, pa, prot, wired);
  #endif
  	if (pmap == NULL)
***************
*** 1104,1110 ****
  	opa = pmap_pte_pa(pte);
  #ifdef DEBUG
  	if (pmapdebug & PDB_ENTER)
! 		printf("enter: pte %x, *pte %x\n", pte, *pte);
  #endif
  
  	/*
--- 1104,1110 ----
  	opa = pmap_pte_pa(pte);
  #ifdef DEBUG
  	if (pmapdebug & PDB_ENTER)
! 		printf("enter: pte %p, *pte %x\n", pte, *pte);
  #endif
  
  	/*
***************
*** 1156,1162 ****
  	if (opa) {
  #ifdef DEBUG
  		if (pmapdebug & PDB_ENTER)
! 			printf("enter: removing old mapping %x\n", va);
  #endif
  		pmap_remove_mapping(pmap, va, pte, PRM_TFLUSH|PRM_CFLUSH);
  #ifdef PMAPSTATS
--- 1156,1162 ----
  	if (opa) {
  #ifdef DEBUG
  		if (pmapdebug & PDB_ENTER)
! 			printf("enter: removing old mapping %lx\n", va);
  #endif
  		pmap_remove_mapping(pmap, va, pte, PRM_TFLUSH|PRM_CFLUSH);
  #ifdef PMAPSTATS
***************
*** 1189,1195 ****
  		s = splimp();
  #ifdef DEBUG
  		if (pmapdebug & PDB_ENTER)
! 			printf("enter: pv at %x: %x/%x/%x\n",
  			       pv, pv->pv_va, pv->pv_pmap, pv->pv_next);
  #endif
  		/*
--- 1189,1195 ----
  		s = splimp();
  #ifdef DEBUG
  		if (pmapdebug & PDB_ENTER)
! 			printf("enter: pv at %p: %lx/%p/%p\n",
  			       pv, pv->pv_va, pv->pv_pmap, pv->pv_next);
  #endif
  		/*
***************
*** 1306,1312 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_change_wiring(%x, %x, %x)\n", pmap, va, wired);
  #endif
  	if (pmap == NULL)
  		return;
--- 1306,1312 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
  #endif
  	if (pmap == NULL)
  		return;
***************
*** 1320,1326 ****
  	 */
  	if (!pmap_ste_v(pmap, va)) {
  		if (pmapdebug & PDB_PARANOIA)
! 			printf("pmap_change_wiring: invalid STE for %x\n", va);
  		return;
  	}
  	/*
--- 1320,1326 ----
  	 */
  	if (!pmap_ste_v(pmap, va)) {
  		if (pmapdebug & PDB_PARANOIA)
! 			printf("pmap_change_wiring: invalid STE for %lx\n", va);
  		return;
  	}
  	/*
***************
*** 1329,1335 ****
  	 */
  	if (!pmap_pte_v(pte)) {
  		if (pmapdebug & PDB_PARANOIA)
! 			printf("pmap_change_wiring: invalid PTE for %x\n", va);
  	}
  #endif
  	/*
--- 1329,1335 ----
  	 */
  	if (!pmap_pte_v(pte)) {
  		if (pmapdebug & PDB_PARANOIA)
! 			printf("pmap_change_wiring: invalid PTE for %lx\n", va);
  	}
  #endif
  	/*
***************
*** 1362,1368 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_extract(%x, %x) -> ", pmap, va);
  #endif
  	pa = 0;
  	if (pmap && pmap_ste_v(pmap, va))
--- 1362,1368 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_extract(%p, %lx) -> ", pmap, va);
  #endif
  	pa = 0;
  	if (pmap && pmap_ste_v(pmap, va))
***************
*** 1371,1377 ****
  		pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("%x\n", pa);
  #endif
  	return(pa);
  }
--- 1371,1377 ----
  		pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("%lx\n", pa);
  #endif
  	return(pa);
  }
***************
*** 1392,1398 ****
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_copy(%x, %x, %x, %x, %x)\n",
  		       dst_pmap, src_pmap, dst_addr, len, src_addr);
  #endif
  }
--- 1392,1398 ----
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_copy(%p, %p, %lx, %lx, %lx)\n",
  		       dst_pmap, src_pmap, dst_addr, len, src_addr);
  #endif
  }
***************
*** 1447,1453 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_zero_page(%x)\n", phys);
  #endif
  	kva = (vm_offset_t) CADDR1;
  	pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE);
--- 1447,1453 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_zero_page(%lx)\n", phys);
  #endif
  	kva = (vm_offset_t) CADDR1;
  	pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE);
***************
*** 1472,1478 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_copy_page(%x, %x)\n", src, dst);
  #endif
  	skva = (vm_offset_t) CADDR1;
  	dkva = (vm_offset_t) CADDR2;
--- 1472,1478 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_copy_page(%lx, %lx)\n", src, dst);
  #endif
  	skva = (vm_offset_t) CADDR1;
  	dkva = (vm_offset_t) CADDR2;
***************
*** 1506,1512 ****
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_pageable(%x, %x, %x, %x)\n",
  		       pmap, sva, eva, pageable);
  #endif
  	/*
--- 1506,1512 ----
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_pageable(%p, %lx, %lx, %x)\n",
  		       pmap, sva, eva, pageable);
  #endif
  	/*
***************
*** 1523,1529 ****
  
  #ifdef DEBUG
  		if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
! 			printf("pmap_pageable(%x, %x, %x, %x)\n",
  			       pmap, sva, eva, pageable);
  #endif
  		if (!pmap_ste_v(pmap, sva))
--- 1523,1529 ----
  
  #ifdef DEBUG
  		if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
! 			printf("pmap_pageable(%p, %lx, %lx, %x)\n",
  			       pmap, sva, eva, pageable);
  #endif
  		if (!pmap_ste_v(pmap, sva))
***************
*** 1536,1542 ****
  			return;
  #ifdef DEBUG
  		if (pv->pv_va != sva || pv->pv_next) {
! 			printf("pmap_pageable: bad PT page va %x next %x\n",
  			       pv->pv_va, pv->pv_next);
  			return;
  		}
--- 1536,1542 ----
  			return;
  #ifdef DEBUG
  		if (pv->pv_va != sva || pv->pv_next) {
! 			printf("pmap_pageable: bad PT page va %lx next %p\n",
  			       pv->pv_va, pv->pv_next);
  			return;
  		}
***************
*** 1547,1558 ****
  		pmap_changebit(pa, PG_M, FALSE);
  #ifdef DEBUG
  		if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
! 			printf("pa %x: flags=%x: not clean\n",
  				pa, PHYS_TO_VM_PAGE(pa)->flags);
  			PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
  		}
  		if (pmapdebug & PDB_PTPAGE)
! 			printf("pmap_pageable: PT page %x(%x) unmodified\n",
  			       sva, *pmap_pte(pmap, sva));
  		if (pmapdebug & PDB_WIRING)
  			pmap_check_wiring("pageable", sva);
--- 1547,1558 ----
  		pmap_changebit(pa, PG_M, FALSE);
  #ifdef DEBUG
  		if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
! 			printf("pa %lx: flags=%x: not clean\n",
  				pa, PHYS_TO_VM_PAGE(pa)->flags);
  			PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
  		}
  		if (pmapdebug & PDB_PTPAGE)
! 			printf("pmap_pageable: PT page %lx(%x) unmodified\n",
  			       sva, *pmap_pte(pmap, sva));
  		if (pmapdebug & PDB_WIRING)
  			pmap_check_wiring("pageable", sva);
***************
*** 1570,1576 ****
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_clear_modify(%x)\n", pa);
  #endif
  	pmap_changebit(pa, PG_M, FALSE);
  }
--- 1570,1576 ----
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_clear_modify(%lx)\n", pa);
  #endif
  	pmap_changebit(pa, PG_M, FALSE);
  }
***************
*** 1586,1592 ****
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_clear_reference(%x)\n", pa);
  #endif
  	pmap_changebit(pa, PG_U, FALSE);
  }
--- 1586,1592 ----
  {
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW)
! 		printf("pmap_clear_reference(%lx)\n", pa);
  #endif
  	pmap_changebit(pa, PG_U, FALSE);
  }
***************
*** 1605,1611 ****
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW) {
  		boolean_t rv = pmap_testbit(pa, PG_U);
! 		printf("pmap_is_referenced(%x) -> %c\n", pa, "FT"[rv]);
  		return(rv);
  	}
  #endif
--- 1605,1611 ----
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW) {
  		boolean_t rv = pmap_testbit(pa, PG_U);
! 		printf("pmap_is_referenced(%lx) -> %c\n", pa, "FT"[rv]);
  		return(rv);
  	}
  #endif
***************
*** 1626,1632 ****
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW) {
  		boolean_t rv = pmap_testbit(pa, PG_M);
! 		printf("pmap_is_modified(%x) -> %c\n", pa, "FT"[rv]);
  		return(rv);
  	}
  #endif
--- 1626,1632 ----
  #ifdef DEBUG
  	if (pmapdebug & PDB_FOLLOW) {
  		boolean_t rv = pmap_testbit(pa, PG_M);
! 		printf("pmap_is_modified(%lx) -> %c\n", pa, "FT"[rv]);
  		return(rv);
  	}
  #endif
***************
*** 1667,1673 ****
  	pt_entry_t opte;
  
  	if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
! 		printf("pmap_remove_mapping(%x, %x, %x, %x)\n",
  		       pmap, va, pte, flags);
  #endif
  
--- 1667,1673 ----
  	pt_entry_t opte;
  
  	if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
! 		printf("pmap_remove_mapping(%p, %lx, %p, %x)\n",
  		       pmap, va, pte, flags);
  #endif
  
***************
*** 1698,1704 ****
  	 */
  #ifdef DEBUG
  	if (pmapdebug & PDB_REMOVE)
! 		printf("remove: invalidating pte at %x\n", pte);
  #endif
  	bits = *pte & (PG_U|PG_M);
  	*pte = PG_NV;
--- 1698,1704 ----
  	 */
  #ifdef DEBUG
  	if (pmapdebug & PDB_REMOVE)
! 		printf("remove: invalidating pte at %p\n", pte);
  #endif
  	bits = *pte & (PG_U|PG_M);
  	*pte = PG_NV;
***************
*** 1779,1785 ****
  #endif
  #ifdef DEBUG
  		if (pmapdebug & (PDB_REMOVE|PDB_PTPAGE))
! 			printf("remove: ste was %x@%x pte was %x@%x\n",
  			       *ste, ste, opte, pmap_pte(pmap, va));
  #endif
  #if defined(M68040)
--- 1779,1785 ----
  #endif
  #ifdef DEBUG
  		if (pmapdebug & (PDB_REMOVE|PDB_PTPAGE))
! 			printf("remove: ste was %x@%p pte was %x@%p\n",
  			       *ste, ste, opte, pmap_pte(pmap, va));
  #endif
  #if defined(M68040)
***************
*** 1802,1808 ****
  		if (ptpmap != pmap_kernel()) {
  #ifdef DEBUG
  			if (pmapdebug & (PDB_REMOVE|PDB_SEGTAB))
! 				printf("remove: stab %x, refcnt %d\n",
  				       ptpmap->pm_stab, ptpmap->pm_sref - 1);
  			if ((pmapdebug & PDB_PARANOIA) &&
  			    ptpmap->pm_stab != (st_entry_t *)trunc_page(ste))
--- 1802,1808 ----
  		if (ptpmap != pmap_kernel()) {
  #ifdef DEBUG
  			if (pmapdebug & (PDB_REMOVE|PDB_SEGTAB))
! 				printf("remove: stab %p, refcnt %d\n",
  				       ptpmap->pm_stab, ptpmap->pm_sref - 1);
  			if ((pmapdebug & PDB_PARANOIA) &&
  			    ptpmap->pm_stab != (st_entry_t *)trunc_page(ste))
***************
*** 1811,1817 ****
  			if (--(ptpmap->pm_sref) == 0) {
  #ifdef DEBUG
  				if (pmapdebug&(PDB_REMOVE|PDB_SEGTAB))
! 					printf("remove: free stab %x\n",
  					       ptpmap->pm_stab);
  #endif
  				kmem_free_wakeup(st_map,
--- 1811,1817 ----
  			if (--(ptpmap->pm_sref) == 0) {
  #ifdef DEBUG
  				if (pmapdebug&(PDB_REMOVE|PDB_SEGTAB))
! 					printf("remove: free stab %p\n",
  					       ptpmap->pm_stab);
  #endif
  				kmem_free_wakeup(st_map,
***************
*** 1918,1924 ****
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_BITS)
! 		printf("pmap_changebit(%x, %x, %s)\n",
  		       pa, bit, setem ? "set" : "clear");
  #endif
  	if (!pmap_valid_page (pa))
--- 1918,1924 ----
  
  #ifdef DEBUG
  	if (pmapdebug & PDB_BITS)
! 		printf("pmap_changebit(%lx, %x, %s)\n",
  		       pa, bit, setem ? "set" : "clear");
  #endif
  	if (!pmap_valid_page (pa))
***************
*** 2017,2023 ****
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_ENTER|PDB_PTPAGE))
! 		printf("pmap_enter_ptpage: pmap %x, va %x\n", pmap, va);
  #endif
  #ifdef PMAPSTATS
  	enter_stats.ptpneeded++;
--- 2017,2023 ----
  
  #ifdef DEBUG
  	if (pmapdebug & (PDB_FOLLOW|PDB_ENTER|PDB_PTPAGE))
! 		printf("pmap_enter_ptpage: pmap %p, va %lx\n", pmap, va);
  #endif
  #ifdef PMAPSTATS
  	enter_stats.ptpneeded++;
***************
*** 2052,2058 ****
  			PMAP_ACTIVATE(pmap, &curproc->p_addr->u_pcb, 1);
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: pmap %x stab %x(%x)\n",
  			       pmap, pmap->pm_stab, pmap->pm_stpa);
  #endif
  	}
--- 2052,2058 ----
  			PMAP_ACTIVATE(pmap, &curproc->p_addr->u_pcb, 1);
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: pmap %p stab %p(%p)\n",
  			       pmap, pmap->pm_stab, pmap->pm_stpa);
  #endif
  	}
***************
*** 2077,2083 ****
  			*ste = (u_int)addr | SG_RW | SG_U | SG_V;
  #ifdef DEBUG
  			if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 				printf("enter: alloc ste2 %d(%x)\n", ix, addr);
  #endif
  		}
  		ste = pmap_ste2(pmap, va);
--- 2077,2083 ----
  			*ste = (u_int)addr | SG_RW | SG_U | SG_V;
  #ifdef DEBUG
  			if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 				printf("enter: alloc ste2 %d(%p)\n", ix, addr);
  #endif
  		}
  		ste = pmap_ste2(pmap, va);
***************
*** 2092,2098 ****
  		ste = (st_entry_t *)((int)ste & ~(NBPG/SG4_LEV3SIZE-1));
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: ste2 %x (%x)\n",
  				pmap_ste2(pmap, va), ste);
  #endif
  	}
--- 2092,2098 ----
  		ste = (st_entry_t *)((int)ste & ~(NBPG/SG4_LEV3SIZE-1));
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: ste2 %p (%p)\n",
  				pmap_ste2(pmap, va), ste);
  #endif
  	}
***************
*** 2135,2141 ****
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) {
  			int ix = pmap_ste(pmap, va) - pmap_ste(pmap, 0);
  
! 			printf("enter: add &Sysptmap[%d]: %x (KPT page %x)\n",
  			       ix, Sysptmap[ix], kpt->kpt_va);
  		}
  #endif
--- 2135,2141 ----
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) {
  			int ix = pmap_ste(pmap, va) - pmap_ste(pmap, 0);
  
! 			printf("enter: add &Sysptmap[%d]: %x (KPT page %lx)\n",
  			       ix, Sysptmap[ix], kpt->kpt_va);
  		}
  #endif
***************
*** 2153,2159 ****
  		pmap->pm_sref++;
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
! 			printf("enter: about to fault UPT pg at %x\n", va);
  #endif
  		s = vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
  		if (s != KERN_SUCCESS) {
--- 2153,2159 ----
  		pmap->pm_sref++;
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
! 			printf("enter: about to fault UPT pg at %lx\n", va);
  #endif
  		s = vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
  		if (s != KERN_SUCCESS) {
***************
*** 2183,2189 ****
  #ifdef DEBUG
  		pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
  		if ((pmapdebug & PDB_PARANOIA) && (*pte & PG_CCB) == 0)
! 			printf("%s PT no CCB: kva=%x ptpa=%x pte@%x=%x\n",
  				pmap == pmap_kernel() ? "Kernel" : "User",
  				va, ptpa, pte, *pte);
  #endif
--- 2183,2189 ----
  #ifdef DEBUG
  		pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
  		if ((pmapdebug & PDB_PARANOIA) && (*pte & PG_CCB) == 0)
! 			printf("%s PT no CCB: kva=%lx ptpa=%lx pte@%p=%x\n",
  				pmap == pmap_kernel() ? "Kernel" : "User",
  				va, ptpa, pte, *pte);
  #endif
***************
*** 2212,2218 ****
  	pv->pv_ptpmap = pmap;
  #ifdef DEBUG
  	if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
! 		printf("enter: new PT page at PA %x, ste at %x\n", ptpa, ste);
  #endif
  
  	/*
--- 2212,2218 ----
  	pv->pv_ptpmap = pmap;
  #ifdef DEBUG
  	if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
! 		printf("enter: new PT page at PA %lx, ste at %p\n", ptpa, ste);
  #endif
  
  	/*
***************
*** 2237,2243 ****
  	if (pmap != pmap_kernel()) {
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: stab %x refcnt %d\n",
  			       pmap->pm_stab, pmap->pm_sref);
  #endif
  	}
--- 2237,2243 ----
  	if (pmap != pmap_kernel()) {
  #ifdef DEBUG
  		if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
! 			printf("enter: stab %p refcnt %d\n",
  			       pmap->pm_stab, pmap->pm_sref);
  #endif
  	}
***************
*** 2262,2270 ****
  {
  	register struct pv_entry *pv;
  
! 	printf("pa %x", pa);
  	for (pv = pa_to_pvh(pa); pv; pv = pv->pv_next)
! 		printf(" -> pmap %x, va %x, ptste %x, ptpmap %x, flags %x",
  		       pv->pv_pmap, pv->pv_va, pv->pv_ptste, pv->pv_ptpmap,
  		       pv->pv_flags);
  	printf("\n");
--- 2262,2270 ----
  {
  	register struct pv_entry *pv;
  
! 	printf("pa %lx", pa);
  	for (pv = pa_to_pvh(pa); pv; pv = pv->pv_next)
! 		printf(" -> pmap %p, va %lx, ptste %p, ptpmap %p, flags %x",
  		       pv->pv_pmap, pv->pv_va, pv->pv_ptste, pv->pv_ptpmap,
  		       pv->pv_flags);
  	printf("\n");
***************
*** 2286,2292 ****
  		return;
  
  	if (!vm_map_lookup_entry(pt_map, va, &entry)) {
! 		printf("wired_check: entry for %x not found\n", va);
  		return;
  	}
  	count = 0;
--- 2286,2292 ----
  		return;
  
  	if (!vm_map_lookup_entry(pt_map, va, &entry)) {
! 		printf("wired_check: entry for %lx not found\n", va);
  		return;
  	}
  	count = 0;
***************
*** 2294,2300 ****
  		if (*pte)
  			count++;
  	if (entry->wired_count != count)
! 		printf("*%s*: %x: w%d/a%d\n",
  		       str, va, entry->wired_count, count);
  }
  #endif
--- 2294,2300 ----
  		if (*pte)
  			count++;
  	if (entry->wired_count != count)
! 		printf("*%s*: %lx: w%d/a%d\n",
  		       str, va, entry->wired_count, count);
  }
  #endif
Index: pram.c
===================================================================
RCS file: /usr/cvs-base/mac68k/mac68k/pram.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 pram.c
*** pram.c	1996/10/19 20:25:24	1.1.1.2
--- pram.c	1996/10/19 20:38:01
***************
*** 36,47 ****
  
  /* #include "stand.h"  */
  #include <sys/types.h>
  #include <machine/viareg.h>
  #include "pram.h"
  #include "macrom.h"
  
  #if DEBUG
! char *convtime(unsigned long t)
  {
    static long daypmon[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
    static char *monstr[] = {"January","February","March","April","May","June",
--- 36,50 ----
  
  /* #include "stand.h"  */
  #include <sys/types.h>
+ #ifdef DEBUG
+ #include <sys/systm.h>
+ #endif
  #include <machine/viareg.h>
  #include "pram.h"
  #include "macrom.h"
  
  #if DEBUG
! static char *convtime(unsigned long t)
  {
    static long daypmon[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
    static char *monstr[] = {"January","February","March","April","May","June",
***************
*** 110,116 ****
      t=0;
    }
  
!   sprintf(s,"%s %d, %d   %d:%d:%d",monstr[month],day,year,hour,minute,seconds);
  
    return s;
  }
--- 113,119 ----
      t=0;
    }
  
!   sprintf(s,"%s %ld, %ld   %ld:%ld:%ld",monstr[month],day,year,hour,minute,seconds);
  
    return s;
  }
***************
*** 127,133 ****
     else
  	timedata = getPramTime();
  #if DEBUG
!    printf("time read from PRAM: 0x%x\n", timedata);
     printf("Date and time: %s\n",convtime(timedata));
  #endif
  
--- 130,136 ----
     else
  	timedata = getPramTime();
  #if DEBUG
!    printf("time read from PRAM: 0x%lx\n", timedata);
     printf("Date and time: %s\n",convtime(timedata));
  #endif
  
Index: trap.c
===================================================================
RCS file: /usr/cvs-base/mac68k/mac68k/trap.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 trap.c
*** trap.c	1996/10/19 20:25:42	1.1.1.2
--- trap.c	1996/10/19 20:38:15
***************
*** 139,145 ****
  #if defined(M68040)
  static int	writeback __P((struct frame *, int));
  #if DEBUG
! static int	dumpssw __P((register u_short));
  #endif
  #endif
  
--- 139,146 ----
  #if defined(M68040)
  static int	writeback __P((struct frame *, int));
  #if DEBUG
! static void dumpssw __P((register u_short));
! static void dumpwb __P((int, u_short, u_int, u_int));
  #endif
  #endif
  
***************
*** 537,543 ****
  		rv = vm_fault(map, va, ftype, FALSE);
  #ifdef DEBUG
  		if (rv && MDB_ISPID(p->p_pid))
! 			printf("vm_fault(%x, %x, %x, 0) -> %x\n",
  				map, va, ftype, rv);
  #endif
  		/*
--- 538,544 ----
  		rv = vm_fault(map, va, ftype, FALSE);
  #ifdef DEBUG
  		if (rv && MDB_ISPID(p->p_pid))
! 			printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
  				map, va, ftype, rv);
  #endif
  		/*
***************
*** 839,845 ****
  }
  
  #ifdef DEBUG
! static int
  dumpssw(ssw)
  	register u_short ssw;
  {
--- 840,846 ----
  }
  
  #ifdef DEBUG
! static void
  dumpssw(ssw)
  	register u_short ssw;
  {
***************
*** 866,872 ****
  	       f7tm[ssw & SSW4_TMMASK]);
  }
  
! int
  dumpwb(num, s, a, d)
  	int num;
  	u_short s;
--- 867,874 ----
  	       f7tm[ssw & SSW4_TMMASK]);
  }
  
! static
! void
  dumpwb(num, s, a, d)
  	int num;
  	u_short s;
***************
*** 883,889 ****
  	if (pa == 0)
  		printf("<invalid address>");
  	else
! 		printf("%x, current value %x", pa, fuword((caddr_t)a));
  	printf("\n");
  }
  #endif
--- 885,891 ----
  	if (pa == 0)
  		printf("<invalid address>");
  	else
! 		printf("%lx, current value %lx", pa, fuword((caddr_t)a));
  	printf("\n");
  }
  #endif
>Audit-Trail:
>Unformatted: