-/* $OpenBSD: hpux_compat.c,v 1.7 1997/02/23 21:40:55 downsj Exp $ */
-/* $NetBSD: hpux_compat.c,v 1.23 1996/01/06 12:44:11 thorpej Exp $ */
+/* $OpenBSD: hpux_compat.c,v 1.8 1997/03/26 08:11:04 downsj Exp $ */
+/* $NetBSD: hpux_compat.c,v 1.30 1997/03/16 10:13:12 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
/*80*/ BERR,BERR, 11
};
-extern char hpux_sigcode[], hpux_esigcode[];
+extern char sigcode[], esigcode[];
extern struct sysent hpux_sysent[];
extern char *hpux_syscallnames[];
/* hpux_to_bsd_uoff() is found in hpux_machdep.c */
-/* hpux_dumpu() is found in hpux_machdep.c */
-
/*
* Ancient HP-UX system calls. Some 9.x executables even use them!
*/
-/* $OpenBSD: hpux_exec.c,v 1.7 1997/02/23 21:40:56 downsj Exp $ */
-/* $NetBSD: hpux_exec.c,v 1.3 1996/01/06 12:44:13 thorpej Exp $ */
+/* $OpenBSD: hpux_exec.c,v 1.8 1997/03/26 08:11:06 downsj Exp $ */
+/* $NetBSD: hpux_exec.c,v 1.8 1997/03/16 10:14:44 thorpej Exp $ */
/*
- * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
+ * Copyright (c) 1995, 1997 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1993, 1994 Christopher G. Demetriou
*
* Redistribution and use in source and binary forms, with or without
#include <machine/hpux_machdep.h>
const char hpux_emul_path[] = "/emul/hpux";
-extern char hpux_sigcode[], hpux_esigcode[];
+extern char sigcode[], esigcode[];
extern struct sysent hpux_sysent[];
extern char *hpux_syscallnames[];
extern int bsdtohpuxerrnomap[];
struct emul emul_hpux = {
"hpux",
bsdtohpuxerrnomap,
- sendsig,
+ hpux_sendsig,
HPUX_SYS_syscall,
HPUX_SYS_MAXSYSCALL,
hpux_sysent,
hpux_syscallnames,
0,
copyargs,
- setregs,
+ hpux_setregs,
NULL,
- hpux_sigcode,
- hpux_esigcode,
+ sigcode,
+ esigcode,
};
int
if (sysid != MID_HPUX)
return (ENOEXEC);
+ /*
+ * HP-UX is a 4k page size system, and executables assume
+ * this.
+ */
+ if (NBPG != HPUX_LDPGSZ)
+ return (ENOEXEC);
+
switch (magic) {
case OMAGIC:
error = exec_hpux_prep_omagic(p, epp);
epp->ep_taddr = 0;
epp->ep_tsize = execp->ha_text;
- epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX_LDPGSZ);
epp->ep_dsize = execp->ha_data + execp->ha_bss;
epp->ep_entry = execp->ha_entry;
struct hpux_exec *execp = epp->ep_hdr;
long bsize, baddr;
long nontext;
- int (*vm_func) __P((struct proc *, struct exec_vmcmd *));
/*
* Check if vnode is in open for writing, because we want to
epp->ep_taddr = 0;
epp->ep_tsize = execp->ha_text;
- epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX_LDPGSZ);
epp->ep_dsize = execp->ha_data + execp->ha_bss;
epp->ep_entry = execp->ha_entry;
- /*
- * If our __LDPGSZ doesn't match HP-UX's, we can't demand-page
- * the executable.
- */
- if (__LDPGSZ == HPUX__LDPGSZ)
- vm_func = vmcmd_map_pagedvn;
- else
- vm_func = vmcmd_map_readvn;
-
/* set up command for text segment */
- NEW_VMCMD(&epp->ep_vmcmds, vm_func, execp->ha_text,
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->ha_text,
epp->ep_taddr, epp->ep_vp, HPUX_TXTOFF(*execp, ZMAGIC),
VM_PROT_READ|VM_PROT_EXECUTE);
/* set up command for data segment */
- NEW_VMCMD(&epp->ep_vmcmds, vm_func, execp->ha_data,
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->ha_data,
epp->ep_daddr, epp->ep_vp, HPUX_DATAOFF(*execp, ZMAGIC),
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
epp->ep_taddr = 0;
epp->ep_tsize = execp->ha_text;
- epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX_LDPGSZ);
epp->ep_dsize = execp->ha_data + execp->ha_bss;
epp->ep_entry = execp->ha_entry;
-/* $OpenBSD: hpux_exec.h,v 1.3 1996/08/02 20:34:54 niklas Exp $ */
-/* $NetBSD: hpux_exec.h,v 1.6 1995/11/28 08:39:45 thorpej Exp $ */
+/* $OpenBSD: hpux_exec.h,v 1.4 1997/03/26 08:11:07 downsj Exp $ */
+/* $NetBSD: hpux_exec.h,v 1.7 1997/03/16 10:16:02 thorpej Exp $ */
/*
* Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
#define HPUX_MAGIC_DL 0x010d /* dynamic load library */
#define HPUX_MAGIC_SHL 0x010e /* shared library */
-#define HPUX__LDPGSZ 4096 /* align to this */
-#define HPUX__LDPGSHIFT 12 /* log2(HPUX__LDPGSZ) */
+#define HPUX_LDPGSZ 4096 /* align to this */
+#define HPUX_LDPGSHIFT 12 /* log2(HPUX_LDPGSZ) */
-#define HPUX__SEGMENT_ROUND(x) \
- (((x) + HPUX__LDPGSZ - 1) & ~(HPUX__LDPGSZ - 1))
+#define HPUX_SEGMENT_ROUND(x) \
+ (((x) + HPUX_LDPGSZ - 1) & ~(HPUX_LDPGSZ - 1))
#define HPUX_TXTOFF(x, m) \
((((m) == ZMAGIC) || \
((m) == HPUX_MAGIC_SHL) || \
((m) == HPUX_MAGIC_DL)) ? \
- HPUX__LDPGSZ : HPUX_EXEC_HDR_SIZE)
+ HPUX_LDPGSZ : HPUX_EXEC_HDR_SIZE)
#define HPUX_DATAOFF(x, m) \
((((m) == ZMAGIC) || \
((m) == HPUX_MAGIC_SHL) || \
((m) == HPUX_MAGIC_DL)) ? \
- (HPUX__LDPGSZ + HPUX__SEGMENT_ROUND((x).ha_text)) : \
+ (HPUX_LDPGSZ + HPUX_SEGMENT_ROUND((x).ha_text)) : \
(HPUX_EXEC_HDR_SIZE + (x).ha_text))
#define HPUX_PASOFF(x, m) \
((((m) == ZMAGIC) || \
((m) == HPUX_MAGIC_SHL) || \
((m) == HPUX_MAGIC_DL)) ? \
- (HPUX__LDPGSZ + HPUX__SEGMENT_ROUND((x).ha_text) + \
- HPUX__SEGMENT_ROUND((x).ha_data)) : \
+ (HPUX_LDPGSZ + HPUX_SEGMENT_ROUND((x).ha_text) + \
+ HPUX_SEGMENT_ROUND((x).ha_data)) : \
(HPUX_EXEC_HDR_SIZE + (x).ha_text + (x).ha_data))
#define HPUX_SYMOFF(x, m) (HPUX_PASOFF((x), (m)) + (x).ha_pascal)
syscallarg(struct hpux_stat *) sb;
};
+struct hpux_sys_sigreturn_args {
+ syscallarg(struct hpuxsigcontext *) sigcntxp;
+};
+
struct hpux_sys_sigvec_args {
syscallarg(int) signo;
syscallarg(struct sigvec *) nsv;
int hpux_sys_fstat __P((struct proc *, void *, register_t *));
int sys_select __P((struct proc *, void *, register_t *));
int sys_fsync __P((struct proc *, void *, register_t *));
-int sys_sigreturn __P((struct proc *, void *, register_t *));
+int hpux_sys_sigreturn __P((struct proc *, void *, register_t *));
int hpux_sys_sigvec __P((struct proc *, void *, register_t *));
int hpux_sys_sigblock __P((struct proc *, void *, register_t *));
int hpux_sys_sigsetmask __P((struct proc *, void *, register_t *));
#include <sys/syscallargs.h>
#include <compat/hpux/hpux.h>
#include <compat/hpux/hpux_syscallargs.h>
+#include <machine/hpux_machdep.h>
#define s(type) sizeof(type)
sys_nosys }, /* 101 = unimplemented */
{ 0, 0,
sys_nosys }, /* 102 = unimplemented */
- { 1, s(struct sys_sigreturn_args),
- sys_sigreturn }, /* 103 = sigreturn */
+ { 1, s(struct hpux_sys_sigreturn_args),
+ hpux_sys_sigreturn }, /* 103 = sigreturn */
{ 0, 0,
sys_nosys }, /* 104 = unimplemented */
{ 0, 0,
- $OpenBSD: syscalls.master,v 1.4 1996/08/25 12:19:51 deraadt Exp $
-; $NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp $
+ $OpenBSD: syscalls.master,v 1.5 1997/03/26 08:11:09 downsj Exp $
+; $NetBSD: syscalls.master,v 1.13 1997/03/16 03:48:04 thorpej Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
-; NetBSD COMPAT_HPUX system call name/number "master" file.
+; OpenBSD COMPAT_HPUX system call name/number "master" file.
; (See syscalls.conf to see what it is processed into.)
;
; Fields: number type [type-dependent ...]
#include <compat/hpux/hpux.h>
#include <compat/hpux/hpux_syscallargs.h>
+#include <machine/hpux_machdep.h>
+
0 NOARGS { int sys_nosys(void); } syscall
1 NOARGS { int sys_exit(int rval); }
2 STD { int hpux_sys_fork(void); }
100 UNIMPL
101 UNIMPL
102 UNIMPL
-103 NOARGS { int sys_sigreturn(struct sigcontext *sigcntxp); }
+103 STD { int hpux_sys_sigreturn(struct hpuxsigcontext \
+ *sigcntxp); }
104 UNIMPL
105 UNIMPL
106 UNIMPL