Some of this was sparc-specific, so ifdef __sparc__ it (XXX). Also,

change the alignment of one structure with an MD ifdef. Should
be moved into the netbsd32_machdep parts.
This commit is contained in:
fvdl 2001-06-19 00:36:21 +00:00
parent 8ecba6c681
commit fe75469d65
4 changed files with 30 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32.h,v 1.18 2001/06/06 21:45:56 mrg Exp $ */
/* $NetBSD: netbsd32.h,v 1.19 2001/06/19 00:36:21 fvdl Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -436,7 +436,11 @@ struct netbsd32_stat {
u_int32_t st_flags; /* user defined flags for file */
u_int32_t st_gen; /* file generation number */
int64_t st_qspare[2];
};
}
#ifdef __x86_64__
__attribute__((packed))
#endif
;
/* from <sys/timex.h> */
typedef u_int32_t netbsd32_ntptimevalp_t;
@ -529,7 +533,7 @@ typedef struct firm_event32 {
#define NETBSD32TOX_UAP(name, type) NETBSD32TOX(uap, &ua, name, type);
#define NETBSD32TOX64_UAP(name, type) NETBSD32TOX64(uap, &ua, name, type);
/* hook for coredump() */
/* hook for coredump */
extern int coredump32(struct proc *, struct vnode *);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_ioctl.c,v 1.9 2001/06/14 20:32:44 thorpej Exp $ */
/* $NetBSD: netbsd32_ioctl.c,v 1.10 2001/06/19 00:36:21 fvdl Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -50,8 +50,10 @@
#include <sys/mount.h>
#include <sys/syscallargs.h>
#ifdef __sparc__
#include <machine/fbio.h>
#include <machine/openpromio.h>
#endif
#include <net/if.h>
#include <net/route.h>
@ -67,12 +69,14 @@
#include <compat/netbsd32/netbsd32_syscallargs.h>
/* prototypes for the converters */
#ifdef __sparc__
static __inline void
netbsd32_to_fbcmap(struct netbsd32_fbcmap *, struct fbcmap *, u_long);
static __inline void
netbsd32_to_fbcursor(struct netbsd32_fbcursor *, struct fbcursor *, u_long);
static __inline void
netbsd32_to_opiocdesc(struct netbsd32_opiocdesc *, struct opiocdesc *, u_long);
#endif
static __inline void
netbsd32_to_partinfo(struct netbsd32_partinfo *, struct partinfo *, u_long);
static __inline void
@ -88,12 +92,14 @@ netbsd32_to_sioc_vif_req(struct netbsd32_sioc_vif_req *, struct sioc_vif_req *,
static __inline void
netbsd32_to_sioc_sg_req(struct netbsd32_sioc_sg_req *, struct sioc_sg_req *, u_long);
#ifdef __sparc__
static __inline void
netbsd32_from_fbcmap(struct fbcmap *, struct netbsd32_fbcmap *);
static __inline void
netbsd32_from_fbcursor(struct fbcursor *, struct netbsd32_fbcursor *);
static __inline void
netbsd32_from_opiocdesc(struct opiocdesc *, struct netbsd32_opiocdesc *);
#endif
static __inline void
netbsd32_from_partinfo(struct partinfo *, struct netbsd32_partinfo *);
static __inline void
@ -111,6 +117,8 @@ netbsd32_from_sioc_sg_req(struct sioc_sg_req *, struct netbsd32_sioc_sg_req *);
/* convert to/from different structures */
#ifdef __sparc__
static __inline void
netbsd32_to_fbcmap(s32p, p, cmd)
struct netbsd32_fbcmap *s32p;
@ -155,6 +163,7 @@ netbsd32_to_opiocdesc(s32p, p, cmd)
p->op_buflen = s32p->op_buflen;
p->op_buf = (char *)(u_long)s32p->op_buf;
}
#endif
static __inline void
netbsd32_to_partinfo(s32p, p, cmd)
@ -264,6 +273,8 @@ netbsd32_to_sioc_sg_req(s32p, p, cmd)
* handle ioctl conversions from sparc64 -> netbsd32
*/
#ifdef __sparc__
static __inline void
netbsd32_from_fbcmap(p, s32p)
struct fbcmap *p;
@ -312,6 +323,8 @@ netbsd32_from_opiocdesc(p, s32p)
s32p->op_buf = (netbsd32_charp)(u_long)p->op_buf;
}
#endif
static __inline void
netbsd32_from_partinfo(p, s32p)
struct partinfo *p;
@ -588,6 +601,7 @@ printf("netbsd32_ioctl(%d, %x, %x): %s group %c base %d len %d\n",
*(int *)data32 = -*(int *)data32;
break;
#ifdef __sparc__
/*
* Here are calls that need explicit conversion.
*/
@ -607,6 +621,7 @@ printf("netbsd32_ioctl(%d, %x, %x): %s group %c base %d len %d\n",
IOCTL_STRUCT_CONV_TO(OPIOCSET, opiocdesc);
case OPIOCNEXTPROP32:
IOCTL_STRUCT_CONV_TO(OPIOCNEXTPROP, opiocdesc);
#endif
case DIOCGPART32:
IOCTL_STRUCT_CONV_TO(DIOCGPART, partinfo);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_ioctl.h,v 1.4 2000/08/19 14:38:18 eeh Exp $ */
/* $NetBSD: netbsd32_ioctl.h,v 1.5 2001/06/19 00:36:21 fvdl Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -34,6 +34,7 @@
#define FBIOGINFO _IOR('F', 2, struct fbinfo)
#endif
#ifdef __sparc__
struct netbsd32_fbcmap {
int index; /* first element (0 origin) */
int count; /* number of elements */
@ -74,6 +75,8 @@ struct netbsd32_opiocdesc {
#define OPIOCSET32 _IOW('O', 2, struct netbsd32_opiocdesc) /* set openprom field */
#define OPIOCNEXTPROP32 _IOWR('O', 3, struct netbsd32_opiocdesc) /* get next property */
#endif
#endif /* __sparc__ */
/* from <sys/audioio.h> */
#if 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.59 2001/06/18 02:00:53 christos Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.60 2001/06/19 00:36:21 fvdl Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -96,7 +96,7 @@ extern struct sysent netbsd32_sysent[];
extern const char * const netbsd32_syscallnames[];
#endif
#ifdef __HAVE_SYSCALL_INTERN
void syscall_intern __P((struct proc *));
void netbsd32_syscall_intern __P((struct proc *));
#else
void syscall __P((void));
#endif
@ -124,7 +124,7 @@ const struct emul emul_netbsd32 = {
NULL,
NULL,
#ifdef __HAVE_SYSCALL_INTERN
syscall_intern,
netbsd32_syscall_intern,
#else
syscall,
#endif