Subject: Fix for ultrix compatibility on NetBSD 1.0A (current)
To: None <port-pmax@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 11/27/1994 16:32:46
Someone changed the interface from kern_exec.c to back-end exec
handlers, and didn't update the ECOFF back-end.  The following patch
fixes it.  I make no claim that it's really correct, I just did
pattern-matching.  The fix looks reasonable, however, and works for
me.

As far as I know, everything that used to work on the pmax
port before the 1.0 release now works again.

*** src/sys/arch/pmax/pmax/machdep.c.DIST	Wed Nov 23 04:09:33 1994
--- src/sys/arch/pmax/pmax/machdep.c	Sun Nov 27 15:25:15 1994
***************
*** 2141,2155 ****
  }
  
  #ifdef COMPAT_ULTRIX
! void cpu_exec_ecoff_setup(p, epp)
  	struct proc *p;
  	struct exec_package *epp;
  {
  	struct ecoff_aouthdr *eap;
  
! 	eap = (struct ecoff_aouthdr *)
! 	    ((caddr_t)epp->ep_hdr + sizeof(struct ecoff_filehdr));
! 	p->p_md.md_regs[GP] = eap->ea_gp_value;
  }
  
  /*
--- 2141,2163 ----
  }
  
  #ifdef COMPAT_ULTRIX
! exec_setup_fcn cpu_exec_setup;	/* make sure  function has correct type */
! 
! void cpu_exec_ecoff_setup(code, p, epp)
! 	int code;
  	struct proc *p;
  	struct exec_package *epp;
  {
  	struct ecoff_aouthdr *eap;
  
! 	switch(code) {
! 	case EXEC_SETUP_FINISH:
! 		eap = (struct ecoff_aouthdr *)
! 		    ((caddr_t)epp->ep_hdr + sizeof(struct ecoff_filehdr));
! 		p->p_md.md_regs[GP] = eap->ea_gp_value;
! 		break;
! 	default:
! 	}
  }
  
  /*