The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/freebsd32/freebsd32.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2001 Doug Rabson
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   24  * SUCH DAMAGE.
   25  *
   26  * $FreeBSD: releng/11.2/sys/compat/freebsd32/freebsd32.h 328454 2018-01-26 23:49:31Z jhb $
   27  */
   28 
   29 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
   30 #define _COMPAT_FREEBSD32_FREEBSD32_H_
   31 
   32 #include <sys/procfs.h>
   33 #include <sys/socket.h>
   34 #include <sys/user.h>
   35 
   36 #define PTRIN(v)        (void *)(uintptr_t) (v)
   37 #define PTROUT(v)       (u_int32_t)(uintptr_t) (v)
   38 
   39 #define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
   40 #define PTRIN_CP(src,dst,fld) \
   41         do { (dst).fld = PTRIN((src).fld); } while (0)
   42 #define PTROUT_CP(src,dst,fld) \
   43         do { (dst).fld = PTROUT((src).fld); } while (0)
   44 
   45 /*
   46  * Being a newer port, 32-bit FreeBSD/MIPS uses 64-bit time_t.
   47  */
   48 #ifdef __mips__
   49 typedef int64_t time32_t;
   50 #else
   51 typedef int32_t time32_t;
   52 #endif
   53 
   54 struct timeval32 {
   55         time32_t tv_sec;
   56         int32_t tv_usec;
   57 };
   58 #define TV_CP(src,dst,fld) do {                 \
   59         CP((src).fld,(dst).fld,tv_sec);         \
   60         CP((src).fld,(dst).fld,tv_usec);        \
   61 } while (0)
   62 
   63 struct timespec32 {
   64         time32_t tv_sec;
   65         int32_t tv_nsec;
   66 };
   67 #define TS_CP(src,dst,fld) do {                 \
   68         CP((src).fld,(dst).fld,tv_sec);         \
   69         CP((src).fld,(dst).fld,tv_nsec);        \
   70 } while (0)
   71 
   72 struct itimerspec32 {
   73         struct timespec32  it_interval;
   74         struct timespec32  it_value;
   75 };
   76 #define ITS_CP(src, dst) do {                   \
   77         TS_CP((src), (dst), it_interval);       \
   78         TS_CP((src), (dst), it_value);          \
   79 } while (0)
   80 
   81 struct rusage32 {
   82         struct timeval32 ru_utime;
   83         struct timeval32 ru_stime;
   84         int32_t ru_maxrss;
   85         int32_t ru_ixrss;
   86         int32_t ru_idrss;
   87         int32_t ru_isrss;
   88         int32_t ru_minflt;
   89         int32_t ru_majflt;
   90         int32_t ru_nswap;
   91         int32_t ru_inblock;
   92         int32_t ru_oublock;
   93         int32_t ru_msgsnd;
   94         int32_t ru_msgrcv;
   95         int32_t ru_nsignals;
   96         int32_t ru_nvcsw;
   97         int32_t ru_nivcsw;
   98 };
   99 
  100 struct wrusage32 {
  101         struct rusage32 wru_self;
  102         struct rusage32 wru_children;
  103 };
  104 
  105 struct itimerval32 {
  106         struct timeval32 it_interval;
  107         struct timeval32 it_value;
  108 };
  109 
  110 #define FREEBSD4_MNAMELEN        (88 - 2 * sizeof(int32_t)) /* size of on/from name bufs */
  111 
  112 /* 4.x version */
  113 struct statfs32 {
  114         int32_t f_spare2;
  115         int32_t f_bsize;
  116         int32_t f_iosize;
  117         int32_t f_blocks;
  118         int32_t f_bfree;
  119         int32_t f_bavail;
  120         int32_t f_files;
  121         int32_t f_ffree;
  122         fsid_t  f_fsid;
  123         uid_t   f_owner;
  124         int32_t f_type;
  125         int32_t f_flags;
  126         int32_t f_syncwrites;
  127         int32_t f_asyncwrites;
  128         char    f_fstypename[MFSNAMELEN];
  129         char    f_mntonname[FREEBSD4_MNAMELEN];
  130         int32_t f_syncreads;
  131         int32_t f_asyncreads;
  132         int16_t f_spares1;
  133         char    f_mntfromname[FREEBSD4_MNAMELEN];
  134         int16_t f_spares2 __packed;
  135         int32_t f_spare[2];
  136 };
  137 
  138 struct iovec32 {
  139         u_int32_t iov_base;
  140         int     iov_len;
  141 };
  142 
  143 struct msghdr32 {
  144         u_int32_t        msg_name;
  145         socklen_t        msg_namelen;
  146         u_int32_t        msg_iov;
  147         int              msg_iovlen;
  148         u_int32_t        msg_control;
  149         socklen_t        msg_controllen;
  150         int              msg_flags;
  151 };
  152 
  153 struct stat32 {
  154         dev_t   st_dev;
  155         ino_t   st_ino;
  156         mode_t  st_mode;
  157         nlink_t st_nlink;
  158         uid_t   st_uid;
  159         gid_t   st_gid;
  160         dev_t   st_rdev;
  161         struct timespec32 st_atim;
  162         struct timespec32 st_mtim;
  163         struct timespec32 st_ctim;
  164         off_t   st_size;
  165         int64_t st_blocks;
  166         u_int32_t st_blksize;
  167         u_int32_t st_flags;
  168         u_int32_t st_gen;
  169         int32_t st_lspare;
  170         struct timespec32 st_birthtim;
  171         unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
  172         unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
  173 };
  174 
  175 struct ostat32 {
  176         __uint16_t st_dev;
  177         ino_t   st_ino;
  178         mode_t  st_mode;
  179         nlink_t st_nlink;
  180         __uint16_t st_uid;
  181         __uint16_t st_gid;
  182         __uint16_t st_rdev;
  183         __int32_t st_size;
  184         struct timespec32 st_atim;
  185         struct timespec32 st_mtim;
  186         struct timespec32 st_ctim;
  187         __int32_t st_blksize;
  188         __int32_t st_blocks;
  189         u_int32_t st_flags;
  190         __uint32_t st_gen;
  191 };
  192 
  193 struct jail32_v0 {
  194         u_int32_t       version;
  195         uint32_t        path;
  196         uint32_t        hostname;
  197         u_int32_t       ip_number;
  198 };
  199 
  200 struct jail32 {
  201         uint32_t        version;
  202         uint32_t        path;
  203         uint32_t        hostname;
  204         uint32_t        jailname;
  205         uint32_t        ip4s;
  206         uint32_t        ip6s;
  207         uint32_t        ip4;
  208         uint32_t        ip6;
  209 };
  210 
  211 struct sigaction32 {
  212         u_int32_t       sa_u;
  213         int             sa_flags;
  214         sigset_t        sa_mask;
  215 };
  216 
  217 struct thr_param32 {
  218         uint32_t start_func;
  219         uint32_t arg;
  220         uint32_t stack_base;
  221         uint32_t stack_size;
  222         uint32_t tls_base;
  223         uint32_t tls_size;
  224         uint32_t child_tid;
  225         uint32_t parent_tid;
  226         int32_t  flags;
  227         uint32_t rtp;
  228         uint32_t spare[3];
  229 };
  230 
  231 struct i386_ldt_args32 {
  232         uint32_t start;
  233         uint32_t descs;
  234         uint32_t num;
  235 };
  236 
  237 struct mq_attr32 {
  238         int     mq_flags;
  239         int     mq_maxmsg;
  240         int     mq_msgsize;
  241         int     mq_curmsgs;
  242         int     __reserved[4];
  243 };
  244 
  245 struct kinfo_proc32 {
  246         int     ki_structsize;
  247         int     ki_layout;
  248         uint32_t ki_args;
  249         uint32_t ki_paddr;
  250         uint32_t ki_addr;
  251         uint32_t ki_tracep;
  252         uint32_t ki_textvp;
  253         uint32_t ki_fd;
  254         uint32_t ki_vmspace;
  255         uint32_t ki_wchan;
  256         pid_t   ki_pid;
  257         pid_t   ki_ppid;
  258         pid_t   ki_pgid;
  259         pid_t   ki_tpgid;
  260         pid_t   ki_sid;
  261         pid_t   ki_tsid;
  262         short   ki_jobc;
  263         short   ki_spare_short1;
  264         dev_t   ki_tdev;
  265         sigset_t ki_siglist;
  266         sigset_t ki_sigmask;
  267         sigset_t ki_sigignore;
  268         sigset_t ki_sigcatch;
  269         uid_t   ki_uid;
  270         uid_t   ki_ruid;
  271         uid_t   ki_svuid;
  272         gid_t   ki_rgid;
  273         gid_t   ki_svgid;
  274         short   ki_ngroups;
  275         short   ki_spare_short2;
  276         gid_t   ki_groups[KI_NGROUPS];
  277         uint32_t ki_size;
  278         int32_t ki_rssize;
  279         int32_t ki_swrss;
  280         int32_t ki_tsize;
  281         int32_t ki_dsize;
  282         int32_t ki_ssize;
  283         u_short ki_xstat;
  284         u_short ki_acflag;
  285         fixpt_t ki_pctcpu;
  286         u_int   ki_estcpu;
  287         u_int   ki_slptime;
  288         u_int   ki_swtime;
  289         u_int   ki_cow;
  290         u_int64_t ki_runtime;
  291         struct  timeval32 ki_start;
  292         struct  timeval32 ki_childtime;
  293         int     ki_flag;
  294         int     ki_kiflag;
  295         int     ki_traceflag;
  296         char    ki_stat;
  297         signed char ki_nice;
  298         char    ki_lock;
  299         char    ki_rqindex;
  300         u_char  ki_oncpu_old;
  301         u_char  ki_lastcpu_old;
  302         char    ki_tdname[TDNAMLEN+1];
  303         char    ki_wmesg[WMESGLEN+1];
  304         char    ki_login[LOGNAMELEN+1];
  305         char    ki_lockname[LOCKNAMELEN+1];
  306         char    ki_comm[COMMLEN+1];
  307         char    ki_emul[KI_EMULNAMELEN+1];
  308         char    ki_loginclass[LOGINCLASSLEN+1];
  309         char    ki_moretdname[MAXCOMLEN-TDNAMLEN+1];
  310         char    ki_sparestrings[46];
  311         int     ki_spareints[KI_NSPARE_INT];
  312         int     ki_oncpu;
  313         int     ki_lastcpu;
  314         int     ki_tracer;
  315         int     ki_flag2;
  316         int     ki_fibnum;
  317         u_int   ki_cr_flags;
  318         int     ki_jid;
  319         int     ki_numthreads;
  320         lwpid_t ki_tid;
  321         struct  priority ki_pri;
  322         struct  rusage32 ki_rusage;
  323         struct  rusage32 ki_rusage_ch;
  324         uint32_t ki_pcb;
  325         uint32_t ki_kstack;
  326         uint32_t ki_udata;
  327         uint32_t ki_tdaddr;
  328         uint32_t ki_spareptrs[KI_NSPARE_PTR];   /* spare room for growth */
  329         int     ki_sparelongs[KI_NSPARE_LONG];
  330         int     ki_sflag;
  331         int     ki_tdflags;
  332 };
  333 
  334 struct kinfo_sigtramp32 {
  335         uint32_t ksigtramp_start;
  336         uint32_t ksigtramp_end;
  337         uint32_t ksigtramp_spare[4];
  338 };
  339 
  340 struct kld32_file_stat_1 {
  341         int     version;        /* set to sizeof(struct kld_file_stat_1) */
  342         char    name[MAXPATHLEN];
  343         int     refs;
  344         int     id;
  345         uint32_t address;       /* load address */
  346         uint32_t size;          /* size in bytes */
  347 };
  348 
  349 struct kld32_file_stat {
  350         int     version;        /* set to sizeof(struct kld_file_stat) */
  351         char    name[MAXPATHLEN];
  352         int     refs;
  353         int     id;
  354         uint32_t address;       /* load address */
  355         uint32_t size;          /* size in bytes */
  356         char    pathname[MAXPATHLEN];
  357 };
  358 
  359 struct procctl_reaper_pids32 {
  360         u_int   rp_count;
  361         u_int   rp_pad0[15];
  362         uint32_t rp_pids;
  363 };
  364 
  365 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Cache object: 0729233bf2efce8879fe52a5f3cb43dc


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.