Subject: Jan 8 kernel doesn't quite compile
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: John F. Woods <jfwhome!jfw@uunet.UU.NET>
List: current-users
Date: 01/08/1994 11:17:47
At least, not if you don't have EXEC_DEBUG defined. There are several
places in kern/exec_aout.c and arch/i386/i386/machdep.c where the
NEW_VMCMD macro/function is called with a 0 for the vp argument;
unfortunately, when EXEC_DEBUG is not defined, the macro form of NEW_VMCMD
is used and that 0 gets used as a pointer value (as in "(0)->vp_refcnt++;"
(I think)). Here are diffs to properly type those 0's into guaranteed
pointer values (prototypes are NOT an excuse for slacking off...).
John Woods, jfw@ksr.com (work), jfw@funhouse.com (NetBSD at home)
*** kern/exec_aout.c.orig Sat Jan 8 10:32:28 1994
--- kern/exec_aout.c Sat Jan 8 10:35:23 1994
***************
*** 148,154 ****
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! epp->ep_daddr + execp->a_data, 0, 0,
VM_PROT_READ|VM_PROT_WRITE |VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
--- 148,154 ----
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! epp->ep_daddr + execp->a_data, (struct vnode *)0, 0,
VM_PROT_READ|VM_PROT_WRITE |VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
***************
*** 187,193 ****
bsize = epp->ep_daddr + epp->ep_dsize - baddr;
if (bsize > 0)
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
! 0, 0, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
}
--- 187,193 ----
bsize = epp->ep_daddr + epp->ep_dsize - baddr;
if (bsize > 0)
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
! (struct vnode *)0, 0, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
}
***************
*** 220,226 ****
bsize = epp->ep_daddr + epp->ep_dsize - baddr;
if (bsize > 0)
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
! 0, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
}
--- 220,226 ----
bsize = epp->ep_daddr + epp->ep_dsize - baddr;
if (bsize > 0)
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
! (struct vnode *)0, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
}
***************
*** 261,269 ****
*/
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
! epp->ep_maxsaddr, 0, 0, VM_PROT_NONE);
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
! (epp->ep_minsaddr - epp->ep_ssize), 0, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return 0;
--- 261,269 ----
*/
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
! epp->ep_maxsaddr, (struct vnode *)0, 0, VM_PROT_NONE);
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
! (epp->ep_minsaddr - epp->ep_ssize), (struct vnode *)0, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return 0;
*** arch/i386/i386/machdep.c.orig Sat Jan 8 10:53:30 1994
--- arch/i386/i386/machdep.c Sat Jan 8 10:53:43 1994
***************
*** 1209,1215 ****
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! epp->ep_daddr + execp->a_data, 0, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
--- 1209,1215 ----
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, execp->a_bss,
! epp->ep_daddr + execp->a_data, (struct vnode *)0, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return exec_aout_setup_stack(p, epp);
------------------------------------------------------------------------------