summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-04-03 22:20:03 +0000
committerjdp <jdp@FreeBSD.org>1999-04-03 22:20:03 +0000
commit60ad9560502beabab095c9441389f5ad42ab0d86 (patch)
treec740f0812cd3e34726c1c768f6008d375c5d68a5 /sys/amd64
parentdd18b40e3fd648d6d36b7b384929832ec0177168 (diff)
downloadFreeBSD-src-60ad9560502beabab095c9441389f5ad42ab0d86.zip
FreeBSD-src-60ad9560502beabab095c9441389f5ad42ab0d86.tar.gz
Restore support for executing BSD/OS binaries on the i386 by passing
the address of the ps_strings structure to the process via %ebx. For other kinds of binaries, %ebx is still zeroed as before. Submitted by: Thomas Stephens <tas@stephens.org> Reviewed by: jdp
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c8
-rw-r--r--sys/amd64/include/reg.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 41584f5..6ed3182 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.326 1999/02/13 17:45:15 bde Exp $
+ * $Id: machdep.c,v 1.327 1999/03/06 04:46:18 wollman Exp $
*/
#include "apm.h"
@@ -806,10 +806,11 @@ cpu_halt(void)
* Clear registers on exec
*/
void
-setregs(p, entry, stack)
+setregs(p, entry, stack, ps_strings)
struct proc *p;
u_long entry;
u_long stack;
+ u_long ps_strings;
{
struct trapframe *regs = p->p_md.md_regs;
struct pcb *pcb = &p->p_addr->u_pcb;
@@ -836,6 +837,9 @@ setregs(p, entry, stack)
regs->tf_es = _udatasel;
regs->tf_cs = _ucodesel;
+ /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */
+ regs->tf_ebx = ps_strings;
+
/* reset %fs and %gs as well */
pcb->pcb_fs = _udatasel;
pcb->pcb_gs = _udatasel;
diff --git a/sys/amd64/include/reg.h b/sys/amd64/include/reg.h
index 3e97fc1..28466a8 100644
--- a/sys/amd64/include/reg.h
+++ b/sys/amd64/include/reg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)reg.h 5.5 (Berkeley) 1/18/91
- * $Id: reg.h,v 1.15 1997/06/07 04:36:06 bde Exp $
+ * $Id: reg.h,v 1.16 1998/09/14 22:43:40 jdp Exp $
*/
#ifndef _MACHINE_REG_H_
@@ -124,7 +124,7 @@ struct fpreg {
*/
int set_fpregs __P((struct proc *, struct fpreg *));
int set_regs __P((struct proc *p, struct reg *regs));
-void setregs __P((struct proc *, u_long, u_long));
+void setregs __P((struct proc *, u_long, u_long, u_long));
#endif
#endif /* !_MACHINE_REG_H_ */
OpenPOWER on IntegriCloud