1/* $NetBSD: osf1_cvt.h,v 1.10 2005/12/11 12:20:23 christos Exp $ */
2
3/*
4 * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 *    must display the following acknowledgement:
16 *      This product includes software developed by Christopher G. Demetriou
17 *	for the NetBSD Project.
18 * 4. The name of the author may not be used to endorse or promote products
19 *    derived from this software without specific prior written permission
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef _COMPAT_OSF1_OSF1_CVT_H_
34#define _COMPAT_OSF1_OSF1_CVT_H_
35
36#include <sys/param.h>
37#include <sys/proc.h>
38#include <sys/mount.h>
39#include <sys/resource.h>
40#include <sys/signal.h>
41#include <sys/stat.h>
42#include <sys/fcntl.h>
43
44#include <compat/common/compat_util.h>
45
46#define	osf1_cvt_dev_from_native(dev)					\
47    osf1_makedev(major(dev), minor(dev))
48#define	osf1_cvt_dev_to_native(dev)					\
49    makedev(osf1_major(dev), osf1_minor(dev))
50
51void	osf1_cvt_flock_from_native(const struct flock *nf,
52				   struct osf1_flock *of);
53int	osf1_cvt_flock_to_native(const struct osf1_flock *of,
54				 struct flock *nf);
55struct msghdr;
56int	osf1_cvt_msghdr_xopen_to_native(const struct osf1_msghdr_xopen *omh,
57					struct msghdr *nmh);
58int	osf1_cvt_pathconf_name_to_native(int oname, int *bnamep);
59void	osf1_cvt_rusage_from_native(const struct rusage *nru,
60				    struct osf1_rusage *oru);
61void	osf1_cvt_sigaction_from_native(const struct sigaction *nsa,
62				       struct osf1_sigaction *osa);
63int	osf1_cvt_sigaction_to_native(const struct osf1_sigaction *osa,
64				     struct sigaction *nsa);
65void	osf1_cvt_sigset_from_native(const sigset_t *nss, osf1_sigset_t *oss);
66int	osf1_cvt_sigset_to_native(const osf1_sigset_t *oss, sigset_t *nss);
67void	osf1_cvt_stat_from_native(const struct stat *nst,
68				  struct osf1_stat *ost);
69void	osf1_cvt_stat2_from_native(const struct stat *nst,
70				  struct osf1_stat2 *ost);
71void	osf1_cvt_statfs_from_native(const struct statvfs *nsfs,
72				    struct osf1_statfs *osfs);
73
74extern const int native_to_osf1_errno[];
75extern const int osf1_to_native_signo[];
76extern const int native_to_osf1_signo[];
77
78extern const struct emul_flags_xtab osf1_access_flags_xtab[];
79extern const struct emul_flags_xtab osf1_fcntl_getsetfd_flags_rxtab[];
80extern const struct emul_flags_xtab osf1_fcntl_getsetfd_flags_xtab[];
81extern const struct emul_flags_xtab osf1_fcntl_getsetfl_flags_rxtab[];
82extern const struct emul_flags_xtab osf1_fcntl_getsetfl_flags_xtab[];
83extern const struct emul_flags_xtab osf1_mmap_flags_xtab[];
84extern const struct emul_flags_xtab osf1_mmap_prot_xtab[];
85extern const struct emul_flags_xtab osf1_nfs_mount_flags_xtab[];
86extern const struct emul_flags_xtab osf1_open_flags_rxtab[];
87extern const struct emul_flags_xtab osf1_open_flags_xtab[];
88extern const struct emul_flags_xtab osf1_reboot_opt_xtab[];
89extern const struct emul_flags_xtab osf1_sendrecv_msg_flags_xtab[];
90extern const struct emul_flags_xtab osf1_sigaction_flags_rxtab[];
91extern const struct emul_flags_xtab osf1_sigaction_flags_xtab[];
92extern const struct emul_flags_xtab osf1_sigaltstack_flags_rxtab[];
93extern const struct emul_flags_xtab osf1_sigaltstack_flags_xtab[];
94extern const struct emul_flags_xtab osf1_wait_options_xtab[];
95
96#endif /* _COMPAT_OSF1_OSF1_CVT_H_ */
97