Home | History | Annotate | Line # | Download | only in sunos32
sunos32.h revision 1.2
      1  1.2  thorpej /*	$NetBSD: sunos32.h,v 1.2 2002/07/04 23:32:12 thorpej Exp $	 */
      2  1.1      mrg 
      3  1.1      mrg /*
      4  1.1      mrg  * Copyright (c) 2001 Matthew R. Green
      5  1.1      mrg  * All rights reserved.
      6  1.1      mrg  *
      7  1.1      mrg  * Redistribution and use in source and binary forms, with or without
      8  1.1      mrg  * modification, are permitted provided that the following conditions
      9  1.1      mrg  * are met:
     10  1.1      mrg  * 1. Redistributions of source code must retain the above copyright
     11  1.1      mrg  *    notice, this list of conditions and the following disclaimer.
     12  1.1      mrg  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1      mrg  *    notice, this list of conditions and the following disclaimer in the
     14  1.1      mrg  *    documentation and/or other materials provided with the distribution.
     15  1.1      mrg  * 3. The name of the author may not be used to endorse or promote products
     16  1.1      mrg  *    derived from this software without specific prior written permission.
     17  1.1      mrg  *
     18  1.1      mrg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  1.1      mrg  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.1      mrg  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  1.1      mrg  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  1.1      mrg  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     23  1.1      mrg  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     24  1.1      mrg  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     25  1.1      mrg  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     26  1.1      mrg  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27  1.1      mrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28  1.1      mrg  * SUCH DAMAGE.
     29  1.1      mrg  */
     30  1.1      mrg 
     31  1.1      mrg #ifndef _COMPAT_SUNOS32_SUNOS32_H_
     32  1.1      mrg #define _COMPAT_SUNOS32_SUNOS32_H_
     33  1.1      mrg 
     34  1.1      mrg /*
     35  1.1      mrg  * 32-bit SunOS 4.x compatibility module.
     36  1.1      mrg  */
     37  1.1      mrg 
     38  1.1      mrg #include <compat/sunos/sunos.h>
     39  1.1      mrg 
     40  1.1      mrg /*
     41  1.1      mrg  * Typedefs for pointer-types.
     42  1.1      mrg  */
     43  1.1      mrg /* stime() */
     44  1.1      mrg typedef u_int32_t sunos32_time_tp;
     45  1.1      mrg 
     46  1.1      mrg /* statfs(), fstatfs() */
     47  1.1      mrg typedef u_int32_t sunos32_statfsp_t;
     48  1.1      mrg 
     49  1.1      mrg /* ustat() */
     50  1.1      mrg typedef u_int32_t sunos32_ustatp_t;
     51  1.1      mrg 
     52  1.1      mrg /* uname() */
     53  1.1      mrg typedef u_int32_t sunos32_utsnamep_t;
     54  1.1      mrg 
     55  1.1      mrg /*
     56  1.1      mrg  * general prototypes
     57  1.1      mrg  */
     58  1.1      mrg __BEGIN_DECLS
     59  1.1      mrg /* Defined in arch/<arch>/sunos_machdep.c */
     60  1.2  thorpej void	sunos32_sendsig __P((int, sigset_t *, u_long));
     61  1.1      mrg __END_DECLS
     62  1.1      mrg 
     63  1.1      mrg /*
     64  1.1      mrg  * here are some macros to convert between sunos32 and sparc64 types.
     65  1.1      mrg  * note that they do *NOT* act like good macros and put ()'s around all
     66  1.1      mrg  * arguments cuz this _breaks_ SCARG().
     67  1.1      mrg  */
     68  1.1      mrg #define SUNOS32TO64(s32uap, uap, name) \
     69  1.1      mrg 	    SCARG(uap, name) = SCARG(s32uap, name)
     70  1.1      mrg #define SUNOS32TOP(s32uap, uap, name, type) \
     71  1.1      mrg 	    SCARG(uap, name) = (type *)(u_long)(u_int)SCARG(s32uap, name)
     72  1.1      mrg #define SUNOS32TOX(s32uap, uap, name, type) \
     73  1.1      mrg 	    SCARG(uap, name) = (type)SCARG(s32uap, name)
     74  1.1      mrg #define SUNOS32TOX64(s32uap, uap, name, type) \
     75  1.1      mrg 	    SCARG(uap, name) = (type)(u_long)SCARG(s32uap, name)
     76  1.1      mrg 
     77  1.1      mrg /* and some standard versions */
     78  1.1      mrg #define	SUNOS32TO64_UAP(name)		SUNOS32TO64(uap, &ua, name);
     79  1.1      mrg #define	SUNOS32TOP_UAP(name, type)	SUNOS32TOP(uap, &ua, name, type);
     80  1.1      mrg #define	SUNOS32TOX_UAP(name, type)	SUNOS32TOX(uap, &ua, name, type);
     81  1.1      mrg #define	SUNOS32TOX64_UAP(name, type)	SUNOS32TOX64(uap, &ua, name, type);
     82  1.1      mrg 
     83  1.1      mrg #define SUNOS32_CHECK_ALT_EXIST(p, sgp, path) \
     84  1.1      mrg     emul_find(p, sgp, p->p_emul->e_path, (char *)(u_long)path, (const char **)&(path), CHECK_ALT_FL_EXISTS)
     85  1.1      mrg 
     86  1.1      mrg #define SUNOS32_CHECK_ALT_CREAT(p, sgp, path) \
     87  1.1      mrg     emul_find(p, sgp, p->p_emul->e_path, (char *)(u_long)path, (const char **)&(path), CHECK_ALT_FL_CREAT)
     88  1.1      mrg 
     89  1.1      mrg #endif /* _COMPAT_SUNOS32_SUNOS32_H_ */
     90