Reformat the enum of syscall argument types.

List enum values on separate lines to minimize diffs as new types are
added.  Split the enum values up into groups and use some simple sorting
within groups (scalar enums are sorted by size, then base, all other
groups are generally sorted alphabetically).

No functional change.
This commit is contained in:
John Baldwin 2018-03-29 00:12:50 +00:00
parent eee0738944
commit c830069674

View File

@ -69,32 +69,144 @@
* IN (meaning that the data is passed *into* the system call).
*/
enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Stat11, Ioctl,
Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval,
Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open,
Fcntlflag, Rusage, RusageWho, BinString, Shutdown, Resource, Rlimit,
Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2,
CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd,
Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel,
Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype,
Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich,
Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam,
PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, Msghdr,
enum Argtype {
None = 1,
CloudABIAdvice, CloudABIClockID, CloudABIFDSFlags,
CloudABIFDStat, CloudABIFileStat, CloudABIFileType,
CloudABIFSFlags, CloudABILookup, CloudABIMFlags, CloudABIMProt,
CloudABIMSFlags, CloudABIOFlags, CloudABISDFlags,
CloudABISignal, CloudABISockStat, CloudABISSFlags,
CloudABITimestamp, CloudABIULFlags, CloudABIWhence };
/* Scalar integers. */
Socklent,
Octal,
Int,
UInt,
Hex,
Long,
LongHex,
Sizet,
Quad,
QuadHex,
/* Encoded scalar values. */
Accessmode,
Acltype,
Atfd,
Atflags,
CapFcntlRights,
Extattrnamespace,
Fadvice,
Fcntl,
Fcntlflag,
FileFlags,
Flockop,
Getfsstatmode,
Idtype,
Ioctl,
Kldsymcmd,
Kldunloadflags,
Madvice,
Minherit,
Msgflags,
Mlockall,
Mmapflags,
Mountflags,
Mprot,
Msync,
Open,
Pathconf,
Pipe2,
Procctl,
Priowhich,
Ptraceop,
Quotactlcmd,
Reboothowto,
Resource,
Rforkflags,
Rtpriofunc,
RusageWho,
Schedpolicy,
Shutdown,
Signal,
Sigprocmask,
Sockdomain,
Sockoptlevel,
Sockoptname,
Sockprotocol,
Socktype,
Sysarch,
Umtxop,
Waitoptions,
Whence,
/* Pointers to non-structures. */
Ptr,
BinString,
CapRights,
ExecArgs,
ExecEnv,
ExitStatus,
Fd_set,
IntArray,
Iovec,
Name,
PipeFds,
PSig,
PQuadHex,
PUInt,
Readlinkres,
StringArray,
/* Pointers to structures. */
Itimerval,
Kevent,
Kevent11,
LinuxSockArgs,
Msghdr,
Pollfd,
Rlimit,
Rusage,
Schedparam,
Sctpsndrcvinfo,
Sigaction,
Siginfo,
Sigset,
Sockaddr,
Stat,
Stat11,
StatFs,
Timespec,
Timespec2,
Timeval,
Timeval2,
Utrace,
CloudABIAdvice,
CloudABIClockID,
CloudABIFDSFlags,
CloudABIFDStat,
CloudABIFileStat,
CloudABIFileType,
CloudABIFSFlags,
CloudABILookup,
CloudABIMFlags,
CloudABIMProt,
CloudABIMSFlags,
CloudABIOFlags,
CloudABISDFlags,
CloudABISignal,
CloudABISockStat,
CloudABISSFlags,
CloudABITimestamp,
CloudABIULFlags,
CloudABIWhence,
MAX_ARG_TYPE,
};
#define ARG_MASK 0xff
#define OUT 0x100
#define IN /*0x20*/0
_Static_assert(ARG_MASK > MAX_ARG_TYPE,
"ARG_MASK overlaps with Argtype values");
struct syscall_args {
enum Argtype type;
int offset;