diff --git a/bjm.c b/bjm.c index 6fe6f5a4..1c0872ac 100644 --- a/bjm.c +++ b/bjm.c @@ -69,26 +69,9 @@ struct module_info long usecount; }; -static const struct xlat qm_which[] = { - XLAT(0), - XLAT(QM_MODULES), - XLAT(QM_DEPS), - XLAT(QM_REFS), - XLAT(QM_SYMBOLS), - XLAT(QM_INFO), - XLAT_END -}; +#include "xlat/qm_which.h" -static const struct xlat modflags[] = { - XLAT(MOD_UNINITIALIZED), - XLAT(MOD_RUNNING), - XLAT(MOD_DELETED), - XLAT(MOD_AUTOCLEAN), - XLAT(MOD_VISITED), - XLAT(MOD_USED_ONCE), - XLAT(MOD_JUST_FREED), - XLAT_END -}; +#include "xlat/modflags.h" int sys_query_module(struct tcb *tcp) @@ -204,11 +187,7 @@ sys_init_module(struct tcb *tcp) #define MODULE_INIT_IGNORE_MODVERSIONS 1 #define MODULE_INIT_IGNORE_VERMAGIC 2 -static const struct xlat module_init_flags[] = { - XLAT(MODULE_INIT_IGNORE_MODVERSIONS), - XLAT(MODULE_INIT_IGNORE_VERMAGIC), - XLAT_END -}; +#include "xlat/module_init_flags.h" int sys_finit_module(struct tcb *tcp) diff --git a/block.c b/block.c index 58f42158..b281b1af 100644 --- a/block.c +++ b/block.c @@ -79,11 +79,7 @@ struct blk_user_trace_setup { #define BLKSECDISCARD _IO(0x12,125) #endif -static const struct xlat blkpg_ops[] = { - XLAT(BLKPG_ADD_PARTITION), - XLAT(BLKPG_DEL_PARTITION), - XLAT_END -}; +#include "xlat/blkpg_ops.h" static void print_blkpg_req(struct tcb *tcp, struct blkpg_ioctl_arg *blkpg) diff --git a/desc.c b/desc.c index a180f887..9e39a92f 100644 --- a/desc.c +++ b/desc.c @@ -38,181 +38,23 @@ # include #endif -static const struct xlat fcntlcmds[] = { - XLAT(F_DUPFD), - XLAT(F_GETFD), - XLAT(F_SETFD), - XLAT(F_GETFL), - XLAT(F_SETFL), - XLAT(F_GETLK), - XLAT(F_SETLK), - XLAT(F_SETLKW), - XLAT(F_GETOWN), - XLAT(F_SETOWN), -#ifdef F_RSETLK - XLAT(F_RSETLK), -#endif -#ifdef F_RSETLKW - XLAT(F_RSETLKW), -#endif -#ifdef F_RGETLK - XLAT(F_RGETLK), -#endif -#ifdef F_CNVT - XLAT(F_CNVT), -#endif -#ifdef F_SETSIG - XLAT(F_SETSIG), -#endif -#ifdef F_GETSIG - XLAT(F_GETSIG), -#endif -#ifdef F_CHKFL - XLAT(F_CHKFL), -#endif -#ifdef F_DUP2FD - XLAT(F_DUP2FD), -#endif -#ifdef F_ALLOCSP - XLAT(F_ALLOCSP), -#endif -#ifdef F_ISSTREAM - XLAT(F_ISSTREAM), -#endif -#ifdef F_PRIV - XLAT(F_PRIV), -#endif -#ifdef F_NPRIV - XLAT(F_NPRIV), -#endif -#ifdef F_QUOTACL - XLAT(F_QUOTACL), -#endif -#ifdef F_BLOCKS - XLAT(F_BLOCKS), -#endif -#ifdef F_BLKSIZE - XLAT(F_BLKSIZE), -#endif -#ifdef F_GETOWN - XLAT(F_GETOWN), -#endif -#ifdef F_SETOWN - XLAT(F_SETOWN), -#endif -#ifdef F_REVOKE - XLAT(F_REVOKE), -#endif -#ifdef F_SETLK - XLAT(F_SETLK), -#endif -#ifdef F_SETLKW - XLAT(F_SETLKW), -#endif -#ifdef F_GETLK - XLAT(F_GETLK), -#endif -#ifdef F_SETLK64 - XLAT(F_SETLK64), -#endif -#ifdef F_SETLKW64 - XLAT(F_SETLKW64), -#endif -#ifdef F_GETLK64 - XLAT(F_GETLK64), -#endif -#ifdef F_SHARE - XLAT(F_SHARE), -#endif -#ifdef F_UNSHARE - XLAT(F_UNSHARE), -#endif -#ifdef F_SETLEASE - XLAT(F_SETLEASE), -#endif -#ifdef F_GETLEASE - XLAT(F_GETLEASE), -#endif -#ifdef F_NOTIFY - XLAT(F_NOTIFY), -#endif -#ifdef F_DUPFD_CLOEXEC - XLAT(F_DUPFD_CLOEXEC), -#endif - XLAT_END -}; +#include "xlat/fcntlcmds.h" -static const struct xlat fdflags[] = { -#ifdef FD_CLOEXEC - XLAT(FD_CLOEXEC), -#endif - XLAT_END -}; +#include "xlat/fdflags.h" #ifdef LOCK_SH -static const struct xlat flockcmds[] = { - XLAT(LOCK_SH), - XLAT(LOCK_EX), - XLAT(LOCK_NB), - XLAT(LOCK_UN), - XLAT_END -}; +#include "xlat/flockcmds.h" #endif /* LOCK_SH */ -static const struct xlat lockfcmds[] = { - XLAT(F_RDLCK), - XLAT(F_WRLCK), - XLAT(F_UNLCK), -#ifdef F_EXLCK - XLAT(F_EXLCK), -#endif -#ifdef F_SHLCK - XLAT(F_SHLCK), -#endif - XLAT_END -}; +#include "xlat/lockfcmds.h" #ifdef F_NOTIFY -static const struct xlat notifyflags[] = { -#ifdef DN_ACCESS - XLAT(DN_ACCESS), -#endif -#ifdef DN_MODIFY - XLAT(DN_MODIFY), -#endif -#ifdef DN_CREATE - XLAT(DN_CREATE), -#endif -#ifdef DN_DELETE - XLAT(DN_DELETE), -#endif -#ifdef DN_RENAME - XLAT(DN_RENAME), -#endif -#ifdef DN_ATTRIB - XLAT(DN_ATTRIB), -#endif -#ifdef DN_MULTISHOT - XLAT(DN_MULTISHOT), -#endif - XLAT_END -}; +#include "xlat/notifyflags.h" #endif -static const struct xlat perf_event_open_flags[] = { -#ifdef PERF_FLAG_FD_NO_GROUP - XLAT(PERF_FLAG_FD_NO_GROUP), -#endif -#ifdef PERF_FLAG_FD_OUTPUT - XLAT(PERF_FLAG_FD_OUTPUT), -#endif -#ifdef PERF_FLAG_PID_CGROUP - XLAT(PERF_FLAG_PID_CGROUP), -#endif - XLAT_END -}; +#include "xlat/perf_event_open_flags.h" /* * Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined @@ -622,61 +464,9 @@ sys_osf_select(struct tcb *tcp) } #endif -static const struct xlat epollctls[] = { -#ifdef EPOLL_CTL_ADD - XLAT(EPOLL_CTL_ADD), -#endif -#ifdef EPOLL_CTL_MOD - XLAT(EPOLL_CTL_MOD), -#endif -#ifdef EPOLL_CTL_DEL - XLAT(EPOLL_CTL_DEL), -#endif - XLAT_END -}; +#include "xlat/epollctls.h" -static const struct xlat epollevents[] = { -#ifdef EPOLLIN - XLAT(EPOLLIN), -#endif -#ifdef EPOLLPRI - XLAT(EPOLLPRI), -#endif -#ifdef EPOLLOUT - XLAT(EPOLLOUT), -#endif -#ifdef EPOLLRDNORM - XLAT(EPOLLRDNORM), -#endif -#ifdef EPOLLRDBAND - XLAT(EPOLLRDBAND), -#endif -#ifdef EPOLLWRNORM - XLAT(EPOLLWRNORM), -#endif -#ifdef EPOLLWRBAND - XLAT(EPOLLWRBAND), -#endif -#ifdef EPOLLMSG - XLAT(EPOLLMSG), -#endif -#ifdef EPOLLERR - XLAT(EPOLLERR), -#endif -#ifdef EPOLLHUP - XLAT(EPOLLHUP), -#endif -#ifdef EPOLLRDHUP - XLAT(EPOLLRDHUP), -#endif -#ifdef EPOLLONESHOT - XLAT(EPOLLONESHOT), -#endif -#ifdef EPOLLET - XLAT(EPOLLET), -#endif - XLAT_END -}; +#include "xlat/epollevents.h" /* Not aliased to printargs_ld: we want it to have a distinct address */ int @@ -685,15 +475,7 @@ sys_epoll_create(struct tcb *tcp) return printargs_ld(tcp); } -static const struct xlat epollflags[] = { -#ifdef EPOLL_CLOEXEC - XLAT(EPOLL_CLOEXEC), -#endif -#ifdef EPOLL_NONBLOCK - XLAT(EPOLL_NONBLOCK), -#endif - XLAT_END -}; +#include "xlat/epollflags.h" int sys_epoll_create1(struct tcb *tcp) diff --git a/fanotify.c b/fanotify.c index c8a7e370..6eeb9bc8 100644 --- a/fanotify.c +++ b/fanotify.c @@ -1,20 +1,9 @@ #include "defs.h" #include -static const struct xlat fan_classes[] = { - XLAT(FAN_CLASS_NOTIF), - XLAT(FAN_CLASS_CONTENT), - XLAT(FAN_CLASS_PRE_CONTENT), - XLAT_END -}; +#include "xlat/fan_classes.h" -static const struct xlat fan_init_flags[] = { - XLAT(FAN_CLOEXEC), - XLAT(FAN_NONBLOCK), - XLAT(FAN_UNLIMITED_QUEUE), - XLAT(FAN_UNLIMITED_MARKS), - XLAT_END -}; +#include "xlat/fan_init_flags.h" int sys_fanotify_init(struct tcb *tcp) @@ -37,32 +26,9 @@ sys_fanotify_init(struct tcb *tcp) return 0; } -static const struct xlat fan_mark_flags[] = { - XLAT(FAN_MARK_ADD), - XLAT(FAN_MARK_REMOVE), - XLAT(FAN_MARK_DONT_FOLLOW), - XLAT(FAN_MARK_ONLYDIR), - XLAT(FAN_MARK_MOUNT), - XLAT(FAN_MARK_IGNORED_MASK), - XLAT(FAN_MARK_IGNORED_SURV_MODIFY), - XLAT(FAN_MARK_FLUSH), - XLAT_END -}; +#include "xlat/fan_mark_flags.h" -static const struct xlat fan_event_flags[] = { - XLAT(FAN_ACCESS), - XLAT(FAN_MODIFY), - XLAT(FAN_CLOSE), - XLAT(FAN_CLOSE_WRITE), - XLAT(FAN_CLOSE_NOWRITE), - XLAT(FAN_OPEN), - XLAT(FAN_Q_OVERFLOW), - XLAT(FAN_OPEN_PERM), - XLAT(FAN_ACCESS_PERM), - XLAT(FAN_ONDIR), - XLAT(FAN_EVENT_ON_CHILD), - XLAT_END -}; +#include "xlat/fan_event_flags.h" int sys_fanotify_mark(struct tcb *tcp) diff --git a/file.c b/file.c index b6cc135f..74f6adfd 100644 --- a/file.c +++ b/file.c @@ -211,119 +211,9 @@ struct kernel_dirent { char d_name[1]; }; -const struct xlat open_access_modes[] = { - XLAT(O_RDONLY), - XLAT(O_WRONLY), - XLAT(O_RDWR), -#ifdef O_ACCMODE - XLAT(O_ACCMODE), -#endif - XLAT_END -}; +#include "xlat/open_access_modes.h" -const struct xlat open_mode_flags[] = { - XLAT(O_CREAT), - XLAT(O_EXCL), - XLAT(O_NOCTTY), - XLAT(O_TRUNC), - XLAT(O_APPEND), - XLAT(O_NONBLOCK), -#ifdef O_SYNC - XLAT(O_SYNC), -#endif -#ifdef O_ASYNC - XLAT(O_ASYNC), -#endif -#ifdef O_DSYNC - XLAT(O_DSYNC), -#endif -#ifdef O_RSYNC - XLAT(O_RSYNC), -#endif -#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) - XLAT(O_NDELAY), -#endif -#ifdef O_PRIV - XLAT(O_PRIV), -#endif -#ifdef O_DIRECT - XLAT(O_DIRECT), -#endif -#ifdef O_LARGEFILE -# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */ -# undef O_LARGEFILE -# ifdef SPARC64 -# define O_LARGEFILE 0x40000 -# elif defined X86_64 || defined S390X -# define O_LARGEFILE 0100000 -# endif -# endif -# ifdef O_LARGEFILE - XLAT(O_LARGEFILE), -# endif -#endif -#ifdef O_DIRECTORY - XLAT(O_DIRECTORY), -#endif -#ifdef O_NOFOLLOW - XLAT(O_NOFOLLOW), -#endif -#ifdef O_NOATIME - XLAT(O_NOATIME), -#endif -#ifdef O_CLOEXEC - XLAT(O_CLOEXEC), -#endif -#ifdef O_PATH - XLAT(O_PATH), -#endif -#ifdef FNDELAY - XLAT(FNDELAY), -#endif -#ifdef FAPPEND - XLAT(FAPPEND), -#endif -#ifdef FMARK - XLAT(FMARK), -#endif -#ifdef FDEFER - XLAT(FDEFER), -#endif -#ifdef FASYNC - XLAT(FASYNC), -#endif -#ifdef FSHLOCK - XLAT(FSHLOCK), -#endif -#ifdef FEXLOCK - XLAT(FEXLOCK), -#endif -#ifdef FCREAT - XLAT(FCREAT), -#endif -#ifdef FTRUNC - XLAT(FTRUNC), -#endif -#ifdef FEXCL - XLAT(FEXCL), -#endif -#ifdef FNBIO - XLAT(FNBIO), -#endif -#ifdef FSYNC - XLAT(FSYNC), -#endif -#ifdef FNOCTTY - XLAT(FNOCTTY), -#endif -#ifdef O_SHLOCK - XLAT(O_SHLOCK), -#endif -#ifdef O_EXLOCK - XLAT(O_EXLOCK), -#endif - XLAT_END -}; +#include "xlat/open_mode_flags.h" #ifndef AT_FDCWD # define AT_FDCWD -100 @@ -421,23 +311,7 @@ sys_openat(struct tcb *tcp) } #if defined(SPARC) || defined(SPARC64) -static const struct xlat openmodessol[] = { - { 0, "O_RDWR" }, - { 1, "O_RDONLY" }, - { 2, "O_WRONLY" }, - { 0x80, "O_NONBLOCK" }, - { 8, "O_APPEND" }, - { 0x100, "O_CREAT" }, - { 0x200, "O_TRUNC" }, - { 0x400, "O_EXCL" }, - { 0x800, "O_NOCTTY" }, - { 0x10, "O_SYNC" }, - { 0x40, "O_DSYNC" }, - { 0x8000, "O_RSYNC" }, - { 4, "O_NDELAY" }, - { 0x1000, "O_PRIV" }, - XLAT_END -}; +#include "xlat/openmodessol.h" int solaris_open(struct tcb *tcp) @@ -467,19 +341,7 @@ sys_creat(struct tcb *tcp) return 0; } -static const struct xlat access_flags[] = { - XLAT(F_OK), - XLAT(R_OK), - XLAT(W_OK), - XLAT(X_OK), -#ifdef EFF_ONLY_OK - XLAT(EFF_ONLY_OK), -#endif -#ifdef EX_OK - XLAT(EX_OK), -#endif - XLAT_END -}; +#include "xlat/access_flags.h" static int decode_access(struct tcb *tcp, int offset) @@ -515,18 +377,7 @@ sys_umask(struct tcb *tcp) return RVAL_OCTAL; } -const struct xlat whence_codes[] = { - XLAT(SEEK_SET), - XLAT(SEEK_CUR), - XLAT(SEEK_END), -#ifdef SEEK_DATA - XLAT(SEEK_DATA), -#endif -#ifdef SEEK_HOLE - XLAT(SEEK_HOLE), -#endif - XLAT_END -}; +#include "xlat/whence_codes.h" /* Linux kernel has exactly one version of lseek: * fs/read_write.c::SYSCALL_DEFINE3(lseek, unsigned, fd, off_t, offset, unsigned, origin) @@ -667,16 +518,7 @@ sys_ftruncate64(struct tcb *tcp) /* several stats */ -static const struct xlat modetypes[] = { - XLAT(S_IFREG), - XLAT(S_IFSOCK), - XLAT(S_IFIFO), - XLAT(S_IFLNK), - XLAT(S_IFDIR), - XLAT(S_IFBLK), - XLAT(S_IFCHR), - XLAT_END -}; +#include "xlat/modetypes.h" static const char * sprintmode(int mode) @@ -907,9 +749,7 @@ printstat_powerpc32(struct tcb *tcp, long addr) } #endif /* POWERPC64 */ -static const struct xlat fileflags[] = { - XLAT_END -}; +#include "xlat/fileflags.h" static void realprintstat(struct tcb *tcp, struct stat *statbuf) @@ -1338,14 +1178,7 @@ sys_stat64(struct tcb *tcp) # define AT_EMPTY_PATH 0x1000 #endif -static const struct xlat at_flags[] = { - XLAT(AT_SYMLINK_NOFOLLOW), - XLAT(AT_REMOVEDIR), - XLAT(AT_SYMLINK_FOLLOW), - XLAT(AT_NO_AUTOMOUNT), - XLAT(AT_EMPTY_PATH), - XLAT_END -}; +#include "xlat/at_flags.h" int sys_newfstatat(struct tcb *tcp) @@ -1511,27 +1344,7 @@ sys_xmknod(struct tcb *tcp) # include -static const struct xlat aclcmds[] = { -# ifdef SETACL - XLAT(SETACL), -# endif -# ifdef GETACL - XLAT(GETACL), -# endif -# ifdef GETACLCNT - XLAT(GETACLCNT), -# endif -# ifdef ACL_GET - XLAT(ACL_GET), -# endif -# ifdef ACL_SET - XLAT(ACL_SET), -# endif -# ifdef ACL_CNT - XLAT(ACL_CNT), -# endif - XLAT_END -}; +#include "xlat/aclcmds.h" int sys_acl(struct tcb *tcp) @@ -1572,18 +1385,7 @@ sys_facl(struct tcb *tcp) return 0; } -static const struct xlat aclipc[] = { -# ifdef IPC_SHM - XLAT(IPC_SHM), -# endif -# ifdef IPC_SEM - XLAT(IPC_SEM), -# endif -# ifdef IPC_MSG - XLAT(IPC_MSG), -# endif - XLAT_END -}; +#include "xlat/aclipc.h" int sys_aclipc(struct tcb *tcp) @@ -1609,38 +1411,7 @@ sys_aclipc(struct tcb *tcp) #endif /* SPARC[64] */ -static const struct xlat fsmagic[] = { - { 0x73757245, "CODA_SUPER_MAGIC" }, - { 0x012ff7b7, "COH_SUPER_MAGIC" }, - { 0x1373, "DEVFS_SUPER_MAGIC" }, - { 0x1cd1, "DEVPTS_SUPER_MAGIC" }, - { 0x414A53, "EFS_SUPER_MAGIC" }, - { 0xef51, "EXT2_OLD_SUPER_MAGIC" }, - { 0xef53, "EXT2_SUPER_MAGIC" }, - { 0x137d, "EXT_SUPER_MAGIC" }, - { 0xf995e849, "HPFS_SUPER_MAGIC" }, - { 0x9660, "ISOFS_SUPER_MAGIC" }, - { 0x137f, "MINIX_SUPER_MAGIC" }, - { 0x138f, "MINIX_SUPER_MAGIC2" }, - { 0x2468, "MINIX2_SUPER_MAGIC" }, - { 0x2478, "MINIX2_SUPER_MAGIC2" }, - { 0x4d44, "MSDOS_SUPER_MAGIC" }, - { 0x564c, "NCP_SUPER_MAGIC" }, - { 0x6969, "NFS_SUPER_MAGIC" }, - { 0x9fa0, "PROC_SUPER_MAGIC" }, - { 0x002f, "QNX4_SUPER_MAGIC" }, - { 0x52654973, "REISERFS_SUPER_MAGIC" }, - { 0x02011994, "SHMFS_SUPER_MAGIC" }, - { 0x517b, "SMB_SUPER_MAGIC" }, - { 0x012ff7b6, "SYSV2_SUPER_MAGIC" }, - { 0x012ff7b5, "SYSV4_SUPER_MAGIC" }, - { 0x00011954, "UFS_MAGIC" }, - { 0x54190100, "UFS_CIGAM" }, - { 0x012ff7b4, "XENIX_SUPER_MAGIC" }, - { 0x012fd16d, "XIAFS_SUPER_MAGIC" }, - { 0x62656572, "SYSFS_MAGIC" }, - XLAT_END -}; +#include "xlat/fsmagic.h" static const char * sprintfstype(int magic) @@ -2255,18 +2026,7 @@ sys_readdir(struct tcb *tcp) return 0; } -static const struct xlat direnttypes[] = { - XLAT(DT_UNKNOWN), - XLAT(DT_FIFO), - XLAT(DT_CHR), - XLAT(DT_DIR), - XLAT(DT_BLK), - XLAT(DT_REG), - XLAT(DT_LNK), - XLAT(DT_SOCK), - XLAT(DT_WHT), - XLAT_END -}; +#include "xlat/direnttypes.h" int sys_getdents(struct tcb *tcp) @@ -2478,13 +2238,7 @@ sys_aiocancel(struct tcb *tcp) #endif /* HAVE_SYS_ASYNCH_H */ -static const struct xlat xattrflags[] = { -#ifdef XATTR_CREATE - XLAT(XATTR_CREATE), - XLAT(XATTR_REPLACE), -#endif - XLAT_END -}; +#include "xlat/xattrflags.h" static void print_xattr_val(struct tcb *tcp, int failed, @@ -2647,15 +2401,7 @@ sys_fremovexattr(struct tcb *tcp) return 0; } -static const struct xlat advise[] = { - XLAT(POSIX_FADV_NORMAL), - XLAT(POSIX_FADV_RANDOM), - XLAT(POSIX_FADV_SEQUENTIAL), - XLAT(POSIX_FADV_WILLNEED), - XLAT(POSIX_FADV_DONTNEED), - XLAT(POSIX_FADV_NOREUSE), - XLAT_END -}; +#include "xlat/advise.h" int sys_fadvise64(struct tcb *tcp) @@ -2687,12 +2433,7 @@ sys_fadvise64_64(struct tcb *tcp) return 0; } -static const struct xlat sync_file_range_flags[] = { - XLAT(SYNC_FILE_RANGE_WAIT_BEFORE), - XLAT(SYNC_FILE_RANGE_WRITE), - XLAT(SYNC_FILE_RANGE_WAIT_AFTER), - XLAT_END -}; +#include "xlat/sync_file_range_flags.h" int sys_sync_file_range(struct tcb *tcp) @@ -2741,11 +2482,7 @@ sys_fallocate(struct tcb *tcp) #ifndef SWAP_FLAG_DISCARD # define SWAP_FLAG_DISCARD 0x10000 #endif -static const struct xlat swap_flags[] = { - XLAT(SWAP_FLAG_PREFER), - XLAT(SWAP_FLAG_DISCARD), - XLAT_END -}; +#include "xlat/swap_flags.h" int sys_swapon(struct tcb *tcp) diff --git a/generate_xlat_in.sh b/generate_xlat_in.sh new file mode 100755 index 00000000..b5a633f9 --- /dev/null +++ b/generate_xlat_in.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +convert() { + sed -n '/^\(static \)\?const struct xlat '"$n"'\[\] = {$/,/^};$/{ + s/^[[:space:]]*XLAT(\([^)]\+\)).*/\1/p + s/^[[:space:]]*{[[:space:]]*(\?\(1<<[^),[:space:]]\+\).*/\1/p + s/.*not NULL-terminated.*/#unterminated/p + s/^\([[:space:]]*{.*\)/\1/p + s/^\t*\( *[/*].*\)/\1/p}' "$f" >> xlat/"$n".in + sed -i '/^\(static \)\?const struct xlat '"$n"'\[\] = {$/,/^};$/c #include "xlat/'"$n"'.h"' "$f" +} + +for f; do + for n in $(sed -n 's/^\(static \)\?const struct xlat \([a-z0-9_]\+\)\[\] = {$/\2/p' "$f"); do + case "$n" in + cacheflush_flags|struct_user_offsets) # skip + ;; + ioprio_class|ioprio_who|mtd_mode_options|personality_options|syslog_action_type|ubi_volume_props|ubi_volume_types) + echo '#unconditional' > xlat/"$n".in + convert + ;; + *) + > xlat/"$n".in + convert + ;; + esac + done +done diff --git a/inotify.c b/inotify.c index 03689b50..0c451eae 100644 --- a/inotify.c +++ b/inotify.c @@ -2,38 +2,9 @@ #include #include -static const struct xlat inotify_flags[] = { - XLAT(IN_ACCESS), - XLAT(IN_MODIFY), - XLAT(IN_ATTRIB), - XLAT(IN_CLOSE), - XLAT(IN_CLOSE_WRITE), - XLAT(IN_CLOSE_NOWRITE), - XLAT(IN_OPEN), - XLAT(IN_MOVE), - XLAT(IN_MOVED_FROM), - XLAT(IN_MOVED_TO), - XLAT(IN_CREATE), - XLAT(IN_DELETE), - XLAT(IN_DELETE_SELF), - XLAT(IN_MOVE_SELF), - XLAT(IN_UNMOUNT), - XLAT(IN_Q_OVERFLOW), - XLAT(IN_IGNORED), - XLAT(IN_ONLYDIR), - XLAT(IN_DONT_FOLLOW), - XLAT(IN_EXCL_UNLINK), - XLAT(IN_MASK_ADD), - XLAT(IN_ISDIR), - XLAT(IN_ONESHOT), - XLAT_END -}; +#include "xlat/inotify_flags.h" -static const struct xlat inotify_init_flags[] = { - XLAT(O_NONBLOCK), - XLAT(O_CLOEXEC), - XLAT_END -}; +#include "xlat/inotify_init_flags.h" int sys_inotify_add_watch(struct tcb *tcp) diff --git a/io.c b/io.c index f5458f78..fea12188 100644 --- a/io.c +++ b/io.c @@ -317,21 +317,7 @@ sys_sendfile64(struct tcb *tcp) return 0; } -static const struct xlat splice_flags[] = { -#ifdef SPLICE_F_MOVE - XLAT(SPLICE_F_MOVE), -#endif -#ifdef SPLICE_F_NONBLOCK - XLAT(SPLICE_F_NONBLOCK), -#endif -#ifdef SPLICE_F_MORE - XLAT(SPLICE_F_MORE), -#endif -#ifdef SPLICE_F_GIFT - XLAT(SPLICE_F_GIFT), -#endif - XLAT_END -}; +#include "xlat/splice_flags.h" int sys_tee(struct tcb *tcp) diff --git a/ioprio.c b/ioprio.c index 52c5a28b..6826e56d 100644 --- a/ioprio.c +++ b/ioprio.c @@ -6,12 +6,7 @@ enum { IOPRIO_WHO_USER }; -static const struct xlat ioprio_who[] = { - XLAT(IOPRIO_WHO_PROCESS), - XLAT(IOPRIO_WHO_PGRP), - XLAT(IOPRIO_WHO_USER), - XLAT_END -}; +#include "xlat/ioprio_who.h" enum { IOPRIO_CLASS_NONE, @@ -20,13 +15,7 @@ enum { IOPRIO_CLASS_IDLE }; -static const struct xlat ioprio_class[] = { - XLAT(IOPRIO_CLASS_NONE), - XLAT(IOPRIO_CLASS_RT), - XLAT(IOPRIO_CLASS_BE), - XLAT(IOPRIO_CLASS_IDLE), - XLAT_END -}; +#include "xlat/ioprio_class.h" #define IOPRIO_CLASS_SHIFT (13) #define IOPRIO_PRIO_MASK ((1ul << IOPRIO_CLASS_SHIFT) - 1) diff --git a/ipc.c b/ipc.c index f1af8562..b863ecf7 100644 --- a/ipc.c +++ b/ipc.c @@ -63,84 +63,21 @@ extern void printsigevent(struct tcb *tcp, long arg); -static const struct xlat msgctl_flags[] = { - XLAT(IPC_RMID), - XLAT(IPC_SET), - XLAT(IPC_STAT), - XLAT(IPC_INFO), - XLAT(MSG_STAT), - XLAT(MSG_INFO), - XLAT_END -}; +#include "xlat/msgctl_flags.h" -static const struct xlat semctl_flags[] = { - XLAT(IPC_RMID), - XLAT(IPC_SET), - XLAT(IPC_STAT), - XLAT(IPC_INFO), - XLAT(SEM_STAT), - XLAT(SEM_INFO), - XLAT(GETPID), - XLAT(GETVAL), - XLAT(GETALL), - XLAT(GETNCNT), - XLAT(GETZCNT), - XLAT(SETVAL), - XLAT(SETALL), - XLAT_END -}; +#include "xlat/semctl_flags.h" -static const struct xlat shmctl_flags[] = { - XLAT(IPC_RMID), - XLAT(IPC_SET), - XLAT(IPC_STAT), - XLAT(IPC_INFO), - XLAT(SHM_STAT), - XLAT(SHM_INFO), -#ifdef SHM_LOCK - XLAT(SHM_LOCK), -#endif -#ifdef SHM_UNLOCK - XLAT(SHM_UNLOCK), -#endif - XLAT_END -}; +#include "xlat/shmctl_flags.h" -static const struct xlat resource_flags[] = { - XLAT(IPC_CREAT), - XLAT(IPC_EXCL), - XLAT(IPC_NOWAIT), - XLAT_END -}; +#include "xlat/resource_flags.h" -static const struct xlat shm_resource_flags[] = { - XLAT(IPC_CREAT), - XLAT(IPC_EXCL), -#ifdef SHM_HUGETLB - XLAT(SHM_HUGETLB), -#endif - XLAT_END -}; +#include "xlat/shm_resource_flags.h" -static const struct xlat shm_flags[] = { - XLAT(SHM_REMAP), - XLAT(SHM_RDONLY), - XLAT(SHM_RND), - XLAT_END -}; +#include "xlat/shm_flags.h" -static const struct xlat ipc_msg_flags[] = { - XLAT(MSG_NOERROR), - XLAT(MSG_EXCEPT), - XLAT(IPC_NOWAIT), - XLAT_END -}; +#include "xlat/ipc_msg_flags.h" -static const struct xlat semop_flags[] = { - XLAT(SEM_UNDO), - XLAT(IPC_NOWAIT), - XLAT_END -}; +#include "xlat/semop_flags.h" int sys_msgget(struct tcb *tcp) { diff --git a/kexec.c b/kexec.c index e2019375..f96c2dd1 100644 --- a/kexec.c +++ b/kexec.c @@ -1,26 +1,9 @@ #include "defs.h" #include -static const struct xlat kexec_arch_values[] = { - XLAT(KEXEC_ARCH_DEFAULT), - XLAT(KEXEC_ARCH_386), - XLAT(KEXEC_ARCH_X86_64), - XLAT(KEXEC_ARCH_PPC), - XLAT(KEXEC_ARCH_PPC64), - XLAT(KEXEC_ARCH_IA_64), - XLAT(KEXEC_ARCH_ARM), - XLAT(KEXEC_ARCH_S390), - XLAT(KEXEC_ARCH_SH), - XLAT(KEXEC_ARCH_MIPS_LE), - XLAT(KEXEC_ARCH_MIPS), - XLAT_END -}; +#include "xlat/kexec_arch_values.h" -static const struct xlat kexec_flags[] = { - XLAT(KEXEC_ON_CRASH), - XLAT(KEXEC_PRESERVE_CONTEXT), - XLAT_END -}; +#include "xlat/kexec_flags.h" static void print_kexec_segments(struct tcb *tcp, unsigned long addr, unsigned long len) diff --git a/keyctl.c b/keyctl.c index fa4b7f58..a12bd54c 100644 --- a/keyctl.c +++ b/keyctl.c @@ -3,17 +3,7 @@ typedef int32_t key_serial_t; -static const struct xlat key_spec[] = { - XLAT(KEY_SPEC_THREAD_KEYRING), - XLAT(KEY_SPEC_PROCESS_KEYRING), - XLAT(KEY_SPEC_SESSION_KEYRING), - XLAT(KEY_SPEC_USER_KEYRING), - XLAT(KEY_SPEC_USER_SESSION_KEYRING), - XLAT(KEY_SPEC_GROUP_KEYRING), - XLAT(KEY_SPEC_REQKEY_AUTH_KEY), - XLAT(KEY_SPEC_REQUESTOR_KEYRING), - XLAT_END -}; +#include "xlat/key_spec.h" static void print_keyring_serial_number(key_serial_t id) @@ -275,37 +265,7 @@ keyctl_get_persistent(struct tcb *tcp, int uid, key_serial_t id) #define KEY_OTH_SETATTR 0x00000020 #define KEY_OTH_ALL 0x0000003f -static const struct xlat key_perms[] = { - XLAT(KEY_POS_VIEW), - XLAT(KEY_POS_READ), - XLAT(KEY_POS_WRITE), - XLAT(KEY_POS_SEARCH), - XLAT(KEY_POS_LINK), - XLAT(KEY_POS_SETATTR), - XLAT(KEY_POS_ALL), - XLAT(KEY_USR_VIEW), - XLAT(KEY_USR_READ), - XLAT(KEY_USR_WRITE), - XLAT(KEY_USR_SEARCH), - XLAT(KEY_USR_LINK), - XLAT(KEY_USR_SETATTR), - XLAT(KEY_USR_ALL), - XLAT(KEY_GRP_VIEW), - XLAT(KEY_GRP_READ), - XLAT(KEY_GRP_WRITE), - XLAT(KEY_GRP_SEARCH), - XLAT(KEY_GRP_LINK), - XLAT(KEY_GRP_SETATTR), - XLAT(KEY_GRP_ALL), - XLAT(KEY_OTH_VIEW), - XLAT(KEY_OTH_READ), - XLAT(KEY_OTH_WRITE), - XLAT(KEY_OTH_SEARCH), - XLAT(KEY_OTH_LINK), - XLAT(KEY_OTH_SETATTR), - XLAT(KEY_OTH_ALL), - XLAT_END -}; +#include "xlat/key_perms.h" static int keyctl_setperm_key(struct tcb *tcp, key_serial_t id, uint32_t perm) @@ -319,18 +279,7 @@ keyctl_setperm_key(struct tcb *tcp, key_serial_t id, uint32_t perm) return 0; } -static const struct xlat key_reqkeys[] = { - XLAT(KEY_REQKEY_DEFL_NO_CHANGE), - XLAT(KEY_REQKEY_DEFL_DEFAULT), - XLAT(KEY_REQKEY_DEFL_THREAD_KEYRING), - XLAT(KEY_REQKEY_DEFL_PROCESS_KEYRING), - XLAT(KEY_REQKEY_DEFL_SESSION_KEYRING), - XLAT(KEY_REQKEY_DEFL_USER_KEYRING), - XLAT(KEY_REQKEY_DEFL_USER_SESSION_KEYRING), - XLAT(KEY_REQKEY_DEFL_GROUP_KEYRING), - XLAT(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), - XLAT_END -}; +#include "xlat/key_reqkeys.h" static int keyctl_set_reqkey_keyring(struct tcb *tcp, int reqkey) @@ -342,32 +291,7 @@ keyctl_set_reqkey_keyring(struct tcb *tcp, int reqkey) return 0; } -static const struct xlat keyctl_commands[] = { - XLAT(KEYCTL_GET_KEYRING_ID), - XLAT(KEYCTL_JOIN_SESSION_KEYRING), - XLAT(KEYCTL_UPDATE), - XLAT(KEYCTL_REVOKE), - XLAT(KEYCTL_CHOWN), - XLAT(KEYCTL_SETPERM), - XLAT(KEYCTL_DESCRIBE), - XLAT(KEYCTL_CLEAR), - XLAT(KEYCTL_LINK), - XLAT(KEYCTL_UNLINK), - XLAT(KEYCTL_SEARCH), - XLAT(KEYCTL_READ), - XLAT(KEYCTL_INSTANTIATE), - XLAT(KEYCTL_NEGATE), - XLAT(KEYCTL_SET_REQKEY_KEYRING), - XLAT(KEYCTL_SET_TIMEOUT), - XLAT(KEYCTL_ASSUME_AUTHORITY), - XLAT(KEYCTL_GET_SECURITY), - XLAT(KEYCTL_SESSION_TO_PARENT), - XLAT(KEYCTL_REJECT), - XLAT(KEYCTL_INSTANTIATE_IOV), - XLAT(KEYCTL_INVALIDATE), - XLAT(KEYCTL_GET_PERSISTENT), - XLAT_END -}; +#include "xlat/keyctl_commands.h" int sys_keyctl(struct tcb *tcp) diff --git a/loop.c b/loop.c index 495e3e2b..20145b0d 100644 --- a/loop.c +++ b/loop.c @@ -31,30 +31,9 @@ #include -static const struct xlat loop_flags_options[] = { - XLAT(LO_FLAGS_READ_ONLY), -#if HAVE_DECL_LO_FLAGS_AUTOCLEAR - XLAT(LO_FLAGS_AUTOCLEAR), -#endif -#if HAVE_DECL_LO_FLAGS_PARTSCAN - XLAT(LO_FLAGS_PARTSCAN), -#endif - XLAT_END -}; +#include "xlat/loop_flags_options.h" -static const struct xlat loop_crypt_type_options[] = { - XLAT(LO_CRYPT_NONE), - XLAT(LO_CRYPT_XOR), - XLAT(LO_CRYPT_DES), - XLAT(LO_CRYPT_FISH2), - XLAT(LO_CRYPT_BLOW), - XLAT(LO_CRYPT_CAST128), - XLAT(LO_CRYPT_IDEA), - XLAT(LO_CRYPT_DUMMY), - XLAT(LO_CRYPT_SKIPJACK), - XLAT(LO_CRYPT_CRYPTOAPI), - XLAT_END -}; +#include "xlat/loop_crypt_type_options.h" int loop_ioctl(struct tcb *tcp, long code, long arg) { diff --git a/mem.c b/mem.c index ce5ce51e..31e51f02 100644 --- a/mem.c +++ b/mem.c @@ -53,120 +53,9 @@ sys_brk(struct tcb *tcp) return RVAL_HEX; } -static const struct xlat mmap_prot[] = { - XLAT(PROT_NONE), - XLAT(PROT_READ), - XLAT(PROT_WRITE), - XLAT(PROT_EXEC), -#ifdef PROT_SEM - XLAT(PROT_SEM), -#endif -#ifdef PROT_GROWSDOWN - XLAT(PROT_GROWSDOWN), -#endif -#ifdef PROT_GROWSUP - XLAT(PROT_GROWSUP), -#endif -#ifdef PROT_SAO - XLAT(PROT_SAO), -#endif - XLAT_END -}; +#include "xlat/mmap_prot.h" -static const struct xlat mmap_flags[] = { - XLAT(MAP_SHARED), - XLAT(MAP_PRIVATE), - XLAT(MAP_FIXED), -#ifdef MAP_ANONYMOUS - XLAT(MAP_ANONYMOUS), -#endif -#ifdef MAP_32BIT - XLAT(MAP_32BIT), -#endif -#ifdef MAP_RENAME - XLAT(MAP_RENAME), -#endif -#ifdef MAP_NORESERVE - XLAT(MAP_NORESERVE), -#endif -#ifdef MAP_POPULATE - XLAT(MAP_POPULATE), -#endif -#ifdef MAP_NONBLOCK - XLAT(MAP_NONBLOCK), -#endif - /* - * XXX - this was introduced in SunOS 4.x to distinguish between - * the old pre-4.x "mmap()", which: - * - * only let you map devices with an "mmap" routine (e.g., - * frame buffers) in; - * - * required you to specify the mapping address; - * - * returned 0 on success and -1 on failure; - * - * memory and which, and the 4.x "mmap()" which: - * - * can map plain files; - * - * can be asked to pick where to map the file; - * - * returns the address where it mapped the file on success - * and -1 on failure. - * - * It's not actually used in source code that calls "mmap()"; the - * "mmap()" routine adds it for you. - * - * It'd be nice to come up with some way of eliminating it from - * the flags, e.g. reporting calls *without* it as "old_mmap()" - * and calls with it as "mmap()". - */ -#ifdef _MAP_NEW - XLAT(_MAP_NEW), -#endif -#ifdef MAP_GROWSDOWN - XLAT(MAP_GROWSDOWN), -#endif -#ifdef MAP_DENYWRITE - XLAT(MAP_DENYWRITE), -#endif -#ifdef MAP_EXECUTABLE - XLAT(MAP_EXECUTABLE), -#endif -#ifdef MAP_INHERIT - XLAT(MAP_INHERIT), -#endif -#ifdef MAP_FILE - XLAT(MAP_FILE), -#endif -#ifdef MAP_LOCKED - XLAT(MAP_LOCKED), -#endif - /* FreeBSD ones */ -#if defined(MAP_ANON) && (!defined(MAP_ANONYMOUS) || MAP_ANON != MAP_ANONYMOUS) - XLAT(MAP_ANON), -#endif -#ifdef MAP_HASSEMAPHORE - XLAT(MAP_HASSEMAPHORE), -#endif -#ifdef MAP_STACK - XLAT(MAP_STACK), -#endif -#ifdef MAP_HUGETLB - XLAT(MAP_HUGETLB), -#endif -#if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 - XLAT(MAP_UNINITIALIZED), -#endif -#ifdef MAP_NOSYNC - XLAT(MAP_NOSYNC), -#endif -#ifdef MAP_NOCORE - XLAT(MAP_NOCORE), -#endif - XLAT_END -}; +#include "xlat/mmap_flags.h" static int print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset) @@ -315,13 +204,7 @@ sys_mprotect(struct tcb *tcp) return 0; } -static const struct xlat mremap_flags[] = { - XLAT(MREMAP_MAYMOVE), -#ifdef MREMAP_FIXED - XLAT(MREMAP_FIXED), -#endif - XLAT_END -}; +#include "xlat/mremap_flags.h" int sys_mremap(struct tcb *tcp) @@ -339,57 +222,7 @@ sys_mremap(struct tcb *tcp) return RVAL_HEX; } -static const struct xlat madvise_cmds[] = { -#ifdef MADV_NORMAL - XLAT(MADV_NORMAL), -#endif -#ifdef MADV_RANDOM - XLAT(MADV_RANDOM), -#endif -#ifdef MADV_SEQUENTIAL - XLAT(MADV_SEQUENTIAL), -#endif -#ifdef MADV_WILLNEED - XLAT(MADV_WILLNEED), -#endif -#ifdef MADV_DONTNEED - XLAT(MADV_DONTNEED), -#endif -#ifdef MADV_REMOVE - XLAT(MADV_REMOVE), -#endif -#ifdef MADV_DONTFORK - XLAT(MADV_DONTFORK), -#endif -#ifdef MADV_DOFORK - XLAT(MADV_DOFORK), -#endif -#ifdef MADV_HWPOISON - XLAT(MADV_HWPOISON), -#endif -#ifdef MADV_SOFT_OFFLINE - XLAT(MADV_SOFT_OFFLINE), -#endif -#ifdef MADV_MERGEABLE - XLAT(MADV_MERGEABLE), -#endif -#ifdef MADV_UNMERGEABLE - XLAT(MADV_UNMERGEABLE), -#endif -#ifdef MADV_HUGEPAGE - XLAT(MADV_HUGEPAGE), -#endif -#ifdef MADV_NOHUGEPAGE - XLAT(MADV_NOHUGEPAGE), -#endif -#ifdef MADV_DONTDUMP - XLAT(MADV_DONTDUMP), -#endif -#ifdef MADV_DODUMP - XLAT(MADV_DODUMP), -#endif - XLAT_END -}; +#include "xlat/madvise_cmds.h" int sys_madvise(struct tcb *tcp) @@ -401,15 +234,7 @@ sys_madvise(struct tcb *tcp) return 0; } -static const struct xlat mlockall_flags[] = { -#ifdef MCL_CURRENT - XLAT(MCL_CURRENT), -#endif -#ifdef MCL_FUTURE - XLAT(MCL_FUTURE), -#endif - XLAT_END -}; +#include "xlat/mlockall_flags.h" int sys_mlockall(struct tcb *tcp) @@ -422,14 +247,7 @@ sys_mlockall(struct tcb *tcp) #ifdef MS_ASYNC -static const struct xlat mctl_sync[] = { -#ifdef MS_SYNC - XLAT(MS_SYNC), -#endif - XLAT(MS_ASYNC), - XLAT(MS_INVALIDATE), - XLAT_END -}; +#include "xlat/mctl_sync.h" int sys_msync(struct tcb *tcp) @@ -449,20 +267,9 @@ sys_msync(struct tcb *tcp) #ifdef MC_SYNC -static const struct xlat mctl_funcs[] = { - XLAT(MC_LOCK), - XLAT(MC_LOCKAS), - XLAT(MC_SYNC), - XLAT(MC_UNLOCK), - XLAT(MC_UNLOCKAS), - XLAT_END -}; +#include "xlat/mctl_funcs.h" -static const struct xlat mctl_lockas[] = { - XLAT(MCL_CURRENT), - XLAT(MCL_FUTURE), - XLAT_END -}; +#include "xlat/mctl_lockas.h" int sys_mctl(struct tcb *tcp) @@ -566,32 +373,13 @@ sys_remap_file_pages(struct tcb *tcp) #define MPOL_MF_MOVE (1<<1) #define MPOL_MF_MOVE_ALL (1<<2) -static const struct xlat policies[] = { - XLAT(MPOL_DEFAULT), - XLAT(MPOL_PREFERRED), - XLAT(MPOL_BIND), - XLAT(MPOL_INTERLEAVE), - XLAT_END -}; +#include "xlat/policies.h" -static const struct xlat mbindflags[] = { - XLAT(MPOL_MF_STRICT), - XLAT(MPOL_MF_MOVE), - XLAT(MPOL_MF_MOVE_ALL), - XLAT_END -}; +#include "xlat/mbindflags.h" -static const struct xlat mempolicyflags[] = { - XLAT(MPOL_F_NODE), - XLAT(MPOL_F_ADDR), - XLAT_END -}; +#include "xlat/mempolicyflags.h" -static const struct xlat move_pages_flags[] = { - XLAT(MPOL_MF_MOVE), - XLAT(MPOL_MF_MOVE_ALL), - XLAT_END -}; +#include "xlat/move_pages_flags.h" static void get_nodes(struct tcb *tcp, unsigned long ptr, unsigned long maxnodes, int err) diff --git a/mtd.c b/mtd.c index 9f8cae18..5d3f7791 100644 --- a/mtd.c +++ b/mtd.c @@ -41,48 +41,15 @@ # include #endif -static const struct xlat mtd_mode_options[] = { - XLAT(MTD_OPS_PLACE_OOB), - XLAT(MTD_OPS_AUTO_OOB), - XLAT(MTD_OPS_RAW), - XLAT_END -}; +#include "xlat/mtd_mode_options.h" -static const struct xlat mtd_type_options[] = { - XLAT(MTD_ABSENT), - XLAT(MTD_RAM), - XLAT(MTD_ROM), - XLAT(MTD_NORFLASH), - XLAT(MTD_NANDFLASH), - XLAT(MTD_DATAFLASH), - XLAT(MTD_UBIVOLUME), - XLAT(MTD_MLCNANDFLASH), - XLAT_END -}; +#include "xlat/mtd_type_options.h" -static const struct xlat mtd_flags_options[] = { - XLAT(MTD_WRITEABLE), - XLAT(MTD_BIT_WRITEABLE), - XLAT(MTD_NO_ERASE), - XLAT(MTD_POWERUP_LOCK), - XLAT_END -}; +#include "xlat/mtd_flags_options.h" -static const struct xlat mtd_otp_options[] = { - XLAT(MTD_OTP_OFF), - XLAT(MTD_OTP_FACTORY), - XLAT(MTD_OTP_USER), - XLAT_END -}; +#include "xlat/mtd_otp_options.h" -static const struct xlat mtd_nandecc_options[] = { - XLAT(MTD_NANDECC_OFF), - XLAT(MTD_NANDECC_PLACE), - XLAT(MTD_NANDECC_AUTOPLACE), - XLAT(MTD_NANDECC_PLACEONLY), - XLAT(MTD_NANDECC_AUTOPL_USR), - XLAT_END -}; +#include "xlat/mtd_nandecc_options.h" int mtd_ioctl(struct tcb *tcp, long code, long arg) { @@ -286,16 +253,9 @@ int mtd_ioctl(struct tcb *tcp, long code, long arg) } } -static const struct xlat ubi_volume_types[] = { - XLAT(UBI_DYNAMIC_VOLUME), - XLAT(UBI_STATIC_VOLUME), - XLAT_END -}; +#include "xlat/ubi_volume_types.h" -static const struct xlat ubi_volume_props[] = { - XLAT(UBI_VOL_PROP_DIRECT_WRITE), - XLAT_END -}; +#include "xlat/ubi_volume_props.h" int ubi_ioctl(struct tcb *tcp, long code, long arg) { diff --git a/net.c b/net.c index e0b225e2..ab33ab4e 100644 --- a/net.c +++ b/net.c @@ -94,1150 +94,52 @@ # define PF_UNSPEC AF_UNSPEC #endif -static const struct xlat domains[] = { -#ifdef PF_UNSPEC - XLAT(PF_UNSPEC), -#endif -#ifdef PF_LOCAL - XLAT(PF_LOCAL), -#endif -#ifdef PF_UNIX - XLAT(PF_UNIX), -#endif -#ifdef PF_INET - XLAT(PF_INET), -#endif -#ifdef PF_AX25 - XLAT(PF_AX25), -#endif -#ifdef PF_IPX - XLAT(PF_IPX), -#endif -#ifdef PF_APPLETALK - XLAT(PF_APPLETALK), -#endif -#ifdef PF_NETROM - XLAT(PF_NETROM), -#endif -#ifdef PF_BRIDGE - XLAT(PF_BRIDGE), -#endif -#ifdef PF_ATMPVC - XLAT(PF_ATMPVC), -#endif -#ifdef PF_X25 - XLAT(PF_X25), -#endif -#ifdef PF_INET6 - XLAT(PF_INET6), -#endif -#ifdef PF_ROSE - XLAT(PF_ROSE), -#endif -#ifdef PF_DECnet - XLAT(PF_DECnet), -#endif -#ifdef PF_NETBEUI - XLAT(PF_NETBEUI), -#endif -#ifdef PF_SECURITY - XLAT(PF_SECURITY), -#endif -#ifdef PF_KEY - XLAT(PF_KEY), -#endif -#ifdef PF_NETLINK - XLAT(PF_NETLINK), -#endif -#ifdef PF_ROUTE - XLAT(PF_ROUTE), -#endif -#ifdef PF_PACKET - XLAT(PF_PACKET), -#endif -#ifdef PF_ASH - XLAT(PF_ASH), -#endif -#ifdef PF_ECONET - XLAT(PF_ECONET), -#endif -#ifdef PF_ATMSVC - XLAT(PF_ATMSVC), -#endif -#ifdef PF_RDS - XLAT(PF_RDS), -#endif -#ifdef PF_SNA - XLAT(PF_SNA), -#endif -#ifdef PF_IRDA - XLAT(PF_IRDA), -#endif -#ifdef PF_PPPOX - XLAT(PF_PPPOX), -#endif -#ifdef PF_WANPIPE - XLAT(PF_WANPIPE), -#endif -#ifdef PF_LLC - XLAT(PF_LLC), -#endif -#ifdef PF_CAN - XLAT(PF_CAN), -#endif -#ifdef PF_TIPC - XLAT(PF_TIPC), -#endif -#ifdef PF_BLUETOOTH - XLAT(PF_BLUETOOTH), -#endif -#ifdef PF_IUCV - XLAT(PF_IUCV), -#endif -#ifdef PF_RXRPC - XLAT(PF_RXRPC), -#endif -#ifdef PF_ISDN - XLAT(PF_ISDN), -#endif -#ifdef PF_PHONET - XLAT(PF_PHONET), -#endif -#ifdef PF_IEEE802154 - XLAT(PF_IEEE802154), -#endif -#ifdef PF_CAIF - XLAT(PF_CAIF), -#endif -#ifdef PF_ALG - XLAT(PF_ALG), -#endif -#ifdef PF_NFC - XLAT(PF_NFC), -#endif -#ifdef PF_VSOCK - XLAT(PF_VSOCK), -#endif - XLAT_END -}; -const struct xlat addrfams[] = { -#ifdef AF_UNSPEC - XLAT(AF_UNSPEC), -#endif -#ifdef AF_LOCAL - XLAT(AF_LOCAL), -#endif -#ifdef AF_UNIX - XLAT(AF_UNIX), -#endif -#ifdef AF_INET - XLAT(AF_INET), -#endif -#ifdef AF_AX25 - XLAT(AF_AX25), -#endif -#ifdef AF_IPX - XLAT(AF_IPX), -#endif -#ifdef AF_APPLETALK - XLAT(AF_APPLETALK), -#endif -#ifdef AF_NETROM - XLAT(AF_NETROM), -#endif -#ifdef AF_BRIDGE - XLAT(AF_BRIDGE), -#endif -#ifdef AF_ATMPVC - XLAT(AF_ATMPVC), -#endif -#ifdef AF_X25 - XLAT(AF_X25), -#endif -#ifdef AF_INET6 - XLAT(AF_INET6), -#endif -#ifdef AF_ROSE - XLAT(AF_ROSE), -#endif -#ifdef AF_DECnet - XLAT(AF_DECnet), -#endif -#ifdef AF_NETBEUI - XLAT(AF_NETBEUI), -#endif -#ifdef AF_SECURITY - XLAT(AF_SECURITY), -#endif -#ifdef AF_KEY - XLAT(AF_KEY), -#endif -#ifdef AF_NETLINK - XLAT(AF_NETLINK), -#endif -#ifdef AF_ROUTE - XLAT(AF_ROUTE), -#endif -#ifdef AF_PACKET - XLAT(AF_PACKET), -#endif -#ifdef AF_ASH - XLAT(AF_ASH), -#endif -#ifdef AF_ECONET - XLAT(AF_ECONET), -#endif -#ifdef AF_ATMSVC - XLAT(AF_ATMSVC), -#endif -#ifdef AF_RDS - XLAT(AF_RDS), -#endif -#ifdef AF_SNA - XLAT(AF_SNA), -#endif -#ifdef AF_IRDA - XLAT(AF_IRDA), -#endif -#ifdef AF_PPPOX - XLAT(AF_PPPOX), -#endif -#ifdef AF_WANPIPE - XLAT(AF_WANPIPE), -#endif -#ifdef AF_LLC - XLAT(AF_LLC), -#endif -#ifdef AF_CAN - XLAT(AF_CAN), -#endif -#ifdef AF_TIPC - XLAT(AF_TIPC), -#endif -#ifdef AF_BLUETOOTH - XLAT(AF_BLUETOOTH), -#endif -#ifdef AF_IUCV - XLAT(AF_IUCV), -#endif -#ifdef AF_RXRPC - XLAT(AF_RXRPC), -#endif -#ifdef AF_ISDN - XLAT(AF_ISDN), -#endif -#ifdef AF_PHONET - XLAT(AF_PHONET), -#endif -#ifdef AF_IEEE802154 - XLAT(AF_IEEE802154), -#endif -#ifdef AF_CAIF - XLAT(AF_CAIF), -#endif -#ifdef AF_ALG - XLAT(AF_ALG), -#endif -#ifdef AF_NFC - XLAT(AF_NFC), -#endif -#ifdef AF_VSOCK - XLAT(AF_VSOCK), -#endif - XLAT_END -}; -static const struct xlat socktypes[] = { - XLAT(SOCK_STREAM), - XLAT(SOCK_DGRAM), -#ifdef SOCK_RAW - XLAT(SOCK_RAW), -#endif -#ifdef SOCK_RDM - XLAT(SOCK_RDM), -#endif -#ifdef SOCK_SEQPACKET - XLAT(SOCK_SEQPACKET), -#endif -#ifdef SOCK_DCCP - XLAT(SOCK_DCCP), -#endif -#ifdef SOCK_PACKET - XLAT(SOCK_PACKET), -#endif - XLAT_END -}; -static const struct xlat sock_type_flags[] = { -#ifdef SOCK_CLOEXEC - XLAT(SOCK_CLOEXEC), -#endif -#ifdef SOCK_NONBLOCK - XLAT(SOCK_NONBLOCK), -#endif - XLAT_END -}; +#include "xlat/domains.h" +#include "xlat/addrfams.h" +#include "xlat/socktypes.h" +#include "xlat/sock_type_flags.h" #ifndef SOCK_TYPE_MASK # define SOCK_TYPE_MASK 0xf #endif -static const struct xlat socketlayers[] = { -#if defined(SOL_IP) - XLAT(SOL_IP), -#endif -#if defined(SOL_ICMP) - XLAT(SOL_ICMP), -#endif -#if defined(SOL_TCP) - XLAT(SOL_TCP), -#endif -#if defined(SOL_UDP) - XLAT(SOL_UDP), -#endif -#if defined(SOL_IPV6) - XLAT(SOL_IPV6), -#endif -#if defined(SOL_ICMPV6) - XLAT(SOL_ICMPV6), -#endif -#if defined(SOL_SCTP) - XLAT(SOL_SCTP), -#endif -#if defined(SOL_UDPLITE) - XLAT(SOL_UDPLITE), -#endif -#if defined(SOL_RAW) - XLAT(SOL_RAW), -#endif -#if defined(SOL_IPX) - XLAT(SOL_IPX), -#endif -#if defined(SOL_AX25) - XLAT(SOL_AX25), -#endif -#if defined(SOL_ATALK) - XLAT(SOL_ATALK), -#endif -#if defined(SOL_NETROM) - XLAT(SOL_NETROM), -#endif -#if defined(SOL_ROSE) - XLAT(SOL_ROSE), -#endif -#if defined(SOL_DECNET) - XLAT(SOL_DECNET), -#endif -#if defined(SOL_X25) - XLAT(SOL_X25), -#endif -#if defined(SOL_PACKET) - XLAT(SOL_PACKET), -#endif -#if defined(SOL_ATM) - XLAT(SOL_ATM), -#endif -#if defined(SOL_AAL) - XLAT(SOL_AAL), -#endif -#if defined(SOL_IRDA) - XLAT(SOL_IRDA), -#endif -#if defined(SOL_NETBEUI) - XLAT(SOL_NETBEUI), -#endif -#if defined(SOL_LLC) - XLAT(SOL_LLC), -#endif -#if defined(SOL_DCCP) - XLAT(SOL_DCCP), -#endif -#if defined(SOL_NETLINK) - XLAT(SOL_NETLINK), -#endif -#if defined(SOL_TIPC) - XLAT(SOL_TIPC), -#endif -#if defined(SOL_RXRPC) - XLAT(SOL_RXRPC), -#endif -#if defined(SOL_PPPOL2TP) - XLAT(SOL_PPPOL2TP), -#endif -#if defined(SOL_BLUETOOTH) - XLAT(SOL_BLUETOOTH), -#endif -#if defined(SOL_PNPIPE) - XLAT(SOL_PNPIPE), -#endif -#if defined(SOL_RDS) - XLAT(SOL_RDS), -#endif -#if defined(SOL_IUVC) - XLAT(SOL_IUCV), -#endif -#if defined(SOL_CAIF) - XLAT(SOL_CAIF), -#endif - XLAT(SOL_SOCKET), /* Never used! */ - /* The SOL_* array should remain not NULL-terminated. */ -}; +#include "xlat/socketlayers.h" /*** WARNING: DANGER WILL ROBINSON: NOTE "socketlayers" array above falls into "inet_protocols" array below!!!! This is intended!!! ***/ -static const struct xlat inet_protocols[] = { - XLAT(IPPROTO_IP), - XLAT(IPPROTO_ICMP), - XLAT(IPPROTO_TCP), - XLAT(IPPROTO_UDP), -#ifdef IPPROTO_IGMP - XLAT(IPPROTO_IGMP), -#endif -#ifdef IPPROTO_GGP - XLAT(IPPROTO_GGP), -#endif -#ifdef IPPROTO_IPIP - XLAT(IPPROTO_IPIP), -#endif -#ifdef IPPROTO_EGP - XLAT(IPPROTO_EGP), -#endif -#ifdef IPPROTO_PUP - XLAT(IPPROTO_PUP), -#endif -#ifdef IPPROTO_IDP - XLAT(IPPROTO_IDP), -#endif -#ifdef IPPROTO_TP - XLAT(IPPROTO_TP), -#endif -#ifdef IPPROTO_DCCP - XLAT(IPPROTO_DCCP), -#endif -#ifdef IPPROTO_IPV6 - XLAT(IPPROTO_IPV6), -#endif -#ifdef IPPROTO_ROUTING - XLAT(IPPROTO_ROUTING), -#endif -#ifdef IPPROTO_FRAGMENT - XLAT(IPPROTO_FRAGMENT), -#endif -#ifdef IPPROTO_RSVP - XLAT(IPPROTO_RSVP), -#endif -#ifdef IPPROTO_GRE - XLAT(IPPROTO_GRE), -#endif -#ifdef IPPROTO_ESP - XLAT(IPPROTO_ESP), -#endif -#ifdef IPPROTO_AH - XLAT(IPPROTO_AH), -#endif -#ifdef IPPROTO_ICMPV6 - XLAT(IPPROTO_ICMPV6), -#endif -#ifdef IPPROTO_NONE - XLAT(IPPROTO_NONE), -#endif -#ifdef IPPROTO_DSTOPTS - XLAT(IPPROTO_DSTOPTS), -#endif -#ifdef IPPROTO_HELLO - XLAT(IPPROTO_HELLO), -#endif -#ifdef IPPROTO_ND - XLAT(IPPROTO_ND), -#endif -#ifdef IPPROTO_MTP - XLAT(IPPROTO_MTP), -#endif -#ifdef IPPROTO_ENCAP - XLAT(IPPROTO_ENCAP), -#endif -#ifdef IPPROTO_PIM - XLAT(IPPROTO_PIM), -#endif -#ifdef IPPROTO_COMP - XLAT(IPPROTO_COMP), -#endif -#ifdef IPPROTO_SCTP - XLAT(IPPROTO_SCTP), -#endif -#ifdef IPPROTO_UDPLITE - XLAT(IPPROTO_UDPLITE), -#endif -#ifdef IPPROTO_RAW - XLAT(IPPROTO_RAW), -#endif -#ifdef IPPROTO_MAX - XLAT(IPPROTO_MAX), -#endif - XLAT_END -}; +#include "xlat/inet_protocols.h" #ifdef PF_NETLINK -static const struct xlat netlink_protocols[] = { -#ifdef NETLINK_ROUTE - XLAT(NETLINK_ROUTE), -#endif -#ifdef NETLINK_UNUSED - XLAT(NETLINK_UNUSED), -#endif -#ifdef NETLINK_USERSOCK - XLAT(NETLINK_USERSOCK), -#endif -#ifdef NETLINK_FIREWALL - XLAT(NETLINK_FIREWALL), -#endif -#ifdef NETLINK_SOCK_DIAG - XLAT(NETLINK_SOCK_DIAG), -#endif -#ifdef NETLINK_NFLOG - XLAT(NETLINK_NFLOG), -#endif -#ifdef NETLINK_XFRM - XLAT(NETLINK_XFRM), -#endif -#ifdef NETLINK_SELINUX - XLAT(NETLINK_SELINUX), -#endif -#ifdef NETLINK_ISCSI - XLAT(NETLINK_ISCSI), -#endif -#ifdef NETLINK_AUDIT - XLAT(NETLINK_AUDIT), -#endif -#ifdef NETLINK_FIB_LOOKUP - XLAT(NETLINK_FIB_LOOKUP), -#endif -#ifdef NETLINK_CONNECTOR - XLAT(NETLINK_CONNECTOR), -#endif -#ifdef NETLINK_NETFILTER - XLAT(NETLINK_NETFILTER), -#endif -#ifdef NETLINK_IP6_FW - XLAT(NETLINK_IP6_FW), -#endif -#ifdef NETLINK_DNRTMSG - XLAT(NETLINK_DNRTMSG), -#endif -#ifdef NETLINK_KOBJECT_UEVENT - XLAT(NETLINK_KOBJECT_UEVENT), -#endif -#ifdef NETLINK_GENERIC - XLAT(NETLINK_GENERIC), -#endif -#ifdef NETLINK_SCSITRANSPORT - XLAT(NETLINK_SCSITRANSPORT), -#endif -#ifdef NETLINK_ECRYPTFS - XLAT(NETLINK_ECRYPTFS), -#endif -#ifdef NETLINK_RDMA - XLAT(NETLINK_RDMA), -#endif -#ifdef NETLINK_CRYPTO - XLAT(NETLINK_CRYPTO), -#endif - XLAT_END -}; +#include "xlat/netlink_protocols.h" #endif -static const struct xlat msg_flags[] = { - XLAT(MSG_OOB), -#ifdef MSG_PEEK - XLAT(MSG_PEEK), -#endif -#ifdef MSG_DONTROUTE - XLAT(MSG_DONTROUTE), -#endif -#ifdef MSG_CTRUNC - XLAT(MSG_CTRUNC), -#endif -#ifdef MSG_PROBE - XLAT(MSG_PROBE), -#endif -#ifdef MSG_TRUNC - XLAT(MSG_TRUNC), -#endif -#ifdef MSG_DONTWAIT - XLAT(MSG_DONTWAIT), -#endif -#ifdef MSG_EOR - XLAT(MSG_EOR), -#endif -#ifdef MSG_WAITALL - XLAT(MSG_WAITALL), -#endif -#ifdef MSG_FIN - XLAT(MSG_FIN), -#endif -#ifdef MSG_SYN - XLAT(MSG_SYN), -#endif -#ifdef MSG_CONFIRM - XLAT(MSG_CONFIRM), -#endif -#ifdef MSG_RST - XLAT(MSG_RST), -#endif -#ifdef MSG_ERRQUEUE - XLAT(MSG_ERRQUEUE), -#endif -#ifdef MSG_NOSIGNAL - XLAT(MSG_NOSIGNAL), -#endif -#ifdef MSG_MORE - XLAT(MSG_MORE), -#endif -#ifdef MSG_WAITFORONE - XLAT(MSG_WAITFORONE), -#endif -#ifdef MSG_EOF - XLAT(MSG_EOF), -#endif -#ifdef MSG_FASTOPEN - XLAT(MSG_FASTOPEN), -#endif -#ifdef MSG_CMSG_CLOEXEC - XLAT(MSG_CMSG_CLOEXEC), -#endif - XLAT_END -}; +#include "xlat/msg_flags.h" -static const struct xlat sockoptions[] = { -#ifdef SO_ACCEPTCONN - XLAT(SO_ACCEPTCONN), -#endif -#ifdef SO_ALLRAW - XLAT(SO_ALLRAW), -#endif -#ifdef SO_ATTACH_FILTER - XLAT(SO_ATTACH_FILTER), -#endif -#ifdef SO_BINDTODEVICE - XLAT(SO_BINDTODEVICE), -#endif -#ifdef SO_BROADCAST - XLAT(SO_BROADCAST), -#endif -#ifdef SO_BSDCOMPAT - XLAT(SO_BSDCOMPAT), -#endif -#ifdef SO_DEBUG - XLAT(SO_DEBUG), -#endif -#ifdef SO_DETACH_FILTER - XLAT(SO_DETACH_FILTER), -#endif -#ifdef SO_DONTROUTE - XLAT(SO_DONTROUTE), -#endif -#ifdef SO_ERROR - XLAT(SO_ERROR), -#endif -#ifdef SO_ICS - XLAT(SO_ICS), -#endif -#ifdef SO_IMASOCKET - XLAT(SO_IMASOCKET), -#endif -#ifdef SO_KEEPALIVE - XLAT(SO_KEEPALIVE), -#endif -#ifdef SO_LINGER - XLAT(SO_LINGER), -#endif -#ifdef SO_LISTENING - XLAT(SO_LISTENING), -#endif -#ifdef SO_MGMT - XLAT(SO_MGMT), -#endif -#ifdef SO_NO_CHECK - XLAT(SO_NO_CHECK), -#endif -#ifdef SO_OOBINLINE - XLAT(SO_OOBINLINE), -#endif -#ifdef SO_ORDREL - XLAT(SO_ORDREL), -#endif -#ifdef SO_PARALLELSVR - XLAT(SO_PARALLELSVR), -#endif -#ifdef SO_PASSCRED - XLAT(SO_PASSCRED), -#endif -#ifdef SO_PEERCRED - XLAT(SO_PEERCRED), -#endif -#ifdef SO_PEERNAME - XLAT(SO_PEERNAME), -#endif -#ifdef SO_PEERSEC - XLAT(SO_PEERSEC), -#endif -#ifdef SO_PRIORITY - XLAT(SO_PRIORITY), -#endif -#ifdef SO_PROTOTYPE - XLAT(SO_PROTOTYPE), -#endif -#ifdef SO_RCVBUF - XLAT(SO_RCVBUF), -#endif -#ifdef SO_RCVLOWAT - XLAT(SO_RCVLOWAT), -#endif -#ifdef SO_RCVTIMEO - XLAT(SO_RCVTIMEO), -#endif -#ifdef SO_RDWR - XLAT(SO_RDWR), -#endif -#ifdef SO_REUSEADDR - XLAT(SO_REUSEADDR), -#endif -#ifdef SO_REUSEPORT - XLAT(SO_REUSEPORT), -#endif -#ifdef SO_SECURITY_AUTHENTICATION - XLAT(SO_SECURITY_AUTHENTICATION), -#endif -#ifdef SO_SECURITY_ENCRYPTION_NETWORK - XLAT(SO_SECURITY_ENCRYPTION_NETWORK), -#endif -#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT - XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), -#endif -#ifdef SO_SEMA - XLAT(SO_SEMA), -#endif -#ifdef SO_SNDBUF - XLAT(SO_SNDBUF), -#endif -#ifdef SO_SNDLOWAT - XLAT(SO_SNDLOWAT), -#endif -#ifdef SO_SNDTIMEO - XLAT(SO_SNDTIMEO), -#endif -#ifdef SO_TIMESTAMP - XLAT(SO_TIMESTAMP), -#endif -#ifdef SO_TYPE - XLAT(SO_TYPE), -#endif -#ifdef SO_USELOOPBACK - XLAT(SO_USELOOPBACK), -#endif - XLAT_END -}; +#include "xlat/sockoptions.h" #if !defined(SOL_IP) && defined(IPPROTO_IP) #define SOL_IP IPPROTO_IP #endif #ifdef SOL_IP -static const struct xlat sockipoptions[] = { -#ifdef IP_TOS - XLAT(IP_TOS), -#endif -#ifdef IP_TTL - XLAT(IP_TTL), -#endif -#ifdef IP_HDRINCL - XLAT(IP_HDRINCL), -#endif -#ifdef IP_OPTIONS - XLAT(IP_OPTIONS), -#endif -#ifdef IP_ROUTER_ALERT - XLAT(IP_ROUTER_ALERT), -#endif -#ifdef IP_RECVOPTIONS - XLAT(IP_RECVOPTIONS), -#endif -#ifdef IP_RECVOPTS - XLAT(IP_RECVOPTS), -#endif -#ifdef IP_RECVRETOPTS - XLAT(IP_RECVRETOPTS), -#endif -#ifdef IP_RECVDSTADDR - XLAT(IP_RECVDSTADDR), -#endif -#ifdef IP_RETOPTS - XLAT(IP_RETOPTS), -#endif -#ifdef IP_PKTINFO - XLAT(IP_PKTINFO), -#endif -#ifdef IP_PKTOPTIONS - XLAT(IP_PKTOPTIONS), -#endif -#ifdef IP_MTU_DISCOVER - XLAT(IP_MTU_DISCOVER), -#endif -#ifdef IP_RECVERR - XLAT(IP_RECVERR), -#endif -#ifdef IP_RECVTTL - XLAT(IP_RECVTTL), -#endif -#ifdef IP_RECVTOS - XLAT(IP_RECVTOS), -#endif -#ifdef IP_MTU - XLAT(IP_MTU), -#endif -#ifdef IP_MULTICAST_IF - XLAT(IP_MULTICAST_IF), -#endif -#ifdef IP_MULTICAST_TTL - XLAT(IP_MULTICAST_TTL), -#endif -#ifdef IP_MULTICAST_LOOP - XLAT(IP_MULTICAST_LOOP), -#endif -#ifdef IP_ADD_MEMBERSHIP - XLAT(IP_ADD_MEMBERSHIP), -#endif -#ifdef IP_DROP_MEMBERSHIP - XLAT(IP_DROP_MEMBERSHIP), -#endif -#ifdef IP_BROADCAST_IF - XLAT(IP_BROADCAST_IF), -#endif -#ifdef IP_RECVIFINDEX - XLAT(IP_RECVIFINDEX), -#endif -#ifdef IP_MSFILTER - XLAT(IP_MSFILTER), -#endif -#ifdef MCAST_MSFILTER - XLAT(MCAST_MSFILTER), -#endif -#ifdef IP_FREEBIND - XLAT(IP_FREEBIND), -#endif -#ifdef IP_IPSEC_POLICY - XLAT(IP_IPSEC_POLICY), -#endif -#ifdef IP_XFRM_POLICY - XLAT(IP_XFRM_POLICY), -#endif -#ifdef IP_PASSSEC - XLAT(IP_PASSSEC), -#endif -#ifdef IP_TRANSPARENT - XLAT(IP_TRANSPARENT), -#endif -#ifdef IP_ORIGDSTADDR - XLAT(IP_ORIGDSTADDR), -#endif -#ifdef IP_RECVORIGDSTADDR - XLAT(IP_RECVORIGDSTADDR), -#endif -#ifdef IP_MINTTL - XLAT(IP_MINTTL), -#endif -#ifdef IP_NODEFRAG - XLAT(IP_NODEFRAG), -#endif -#ifdef IP_UNBLOCK_SOURCE - XLAT(IP_UNBLOCK_SOURCE), -#endif -#ifdef IP_BLOCK_SOURCE - XLAT(IP_BLOCK_SOURCE), -#endif -#ifdef IP_ADD_SOURCE_MEMBERSHIP - XLAT(IP_ADD_SOURCE_MEMBERSHIP), -#endif -#ifdef IP_DROP_SOURCE_MEMBERSHIP - XLAT(IP_DROP_SOURCE_MEMBERSHIP), -#endif -#ifdef MCAST_JOIN_GROUP - XLAT(MCAST_JOIN_GROUP), -#endif -#ifdef MCAST_BLOCK_SOURCE - XLAT(MCAST_BLOCK_SOURCE), -#endif -#ifdef MCAST_UNBLOCK_SOURCE - XLAT(MCAST_UNBLOCK_SOURCE), -#endif -#ifdef MCAST_LEAVE_GROUP - XLAT(MCAST_LEAVE_GROUP), -#endif -#ifdef MCAST_JOIN_SOURCE_GROUP - XLAT(MCAST_JOIN_SOURCE_GROUP), -#endif -#ifdef MCAST_LEAVE_SOURCE_GROUP - XLAT(MCAST_LEAVE_SOURCE_GROUP), -#endif -#ifdef IP_MULTICAST_ALL - XLAT(IP_MULTICAST_ALL), -#endif -#ifdef IP_UNICAST_IF - XLAT(IP_UNICAST_IF), -#endif - XLAT_END -}; +#include "xlat/sockipoptions.h" #endif /* SOL_IP */ #ifdef SOL_IPV6 -static const struct xlat sockipv6options[] = { -#ifdef IPV6_ADDRFORM - XLAT(IPV6_ADDRFORM), -#endif -#ifdef MCAST_FILTER - XLAT(MCAST_FILTER), -#endif -#ifdef IPV6_PKTOPTIONS - XLAT(IPV6_PKTOPTIONS), -#endif -#ifdef IPV6_MTU - XLAT(IPV6_MTU), -#endif -#ifdef IPV6_V6ONLY - XLAT(IPV6_V6ONLY), -#endif -#ifdef IPV6_PKTINFO - XLAT(IPV6_PKTINFO), -#endif -#ifdef IPV6_HOPLIMIT - XLAT(IPV6_HOPLIMIT), -#endif -#ifdef IPV6_RTHDR - XLAT(IPV6_RTHDR), -#endif -#ifdef IPV6_HOPOPTS - XLAT(IPV6_HOPOPTS), -#endif -#ifdef IPV6_DSTOPTS - XLAT(IPV6_DSTOPTS), -#endif -#ifdef IPV6_FLOWINFO - XLAT(IPV6_FLOWINFO), -#endif -#ifdef IPV6_UNICAST_HOPS - XLAT(IPV6_UNICAST_HOPS), -#endif -#ifdef IPV6_MULTICAST_HOPS - XLAT(IPV6_MULTICAST_HOPS), -#endif -#ifdef IPV6_MULTICAST_LOOP - XLAT(IPV6_MULTICAST_LOOP), -#endif -#ifdef IPV6_MULTICAST_IF - XLAT(IPV6_MULTICAST_IF), -#endif -#ifdef IPV6_MTU_DISCOVER - XLAT(IPV6_MTU_DISCOVER), -#endif -#ifdef IPV6_RECVERR - XLAT(IPV6_RECVERR), -#endif -#ifdef IPV6_FLOWINFO_SEND - XLAT(IPV6_FLOWINFO_SEND), -#endif -#ifdef IPV6_ADD_MEMBERSHIP - XLAT(IPV6_ADD_MEMBERSHIP), -#endif -#ifdef IPV6_DROP_MEMBERSHIP - XLAT(IPV6_DROP_MEMBERSHIP), -#endif -#ifdef IPV6_ROUTER_ALERT - XLAT(IPV6_ROUTER_ALERT), -#endif - XLAT_END -}; +#include "xlat/sockipv6options.h" #endif /* SOL_IPV6 */ #ifdef SOL_IPX -static const struct xlat sockipxoptions[] = { - XLAT(IPX_TYPE), - XLAT_END -}; +#include "xlat/sockipxoptions.h" #endif /* SOL_IPX */ #ifdef SOL_RAW -static const struct xlat sockrawoptions[] = { -#if defined(ICMP_FILTER) - XLAT(ICMP_FILTER), -#endif - XLAT_END -}; +#include "xlat/sockrawoptions.h" #endif /* SOL_RAW */ #ifdef SOL_PACKET -static const struct xlat sockpacketoptions[] = { -#ifdef PACKET_ADD_MEMBERSHIP - XLAT(PACKET_ADD_MEMBERSHIP), -#endif -#ifdef PACKET_DROP_MEMBERSHIP - XLAT(PACKET_DROP_MEMBERSHIP), -#endif -#if defined(PACKET_RECV_OUTPUT) - XLAT(PACKET_RECV_OUTPUT), -#endif -#if defined(PACKET_RX_RING) - XLAT(PACKET_RX_RING), -#endif -#if defined(PACKET_STATISTICS) - XLAT(PACKET_STATISTICS), -#endif -#if defined(PACKET_COPY_THRESH) - XLAT(PACKET_COPY_THRESH), -#endif -#if defined(PACKET_AUXDATA) - XLAT(PACKET_AUXDATA), -#endif -#if defined(PACKET_ORIGDEV) - XLAT(PACKET_ORIGDEV), -#endif -#if defined(PACKET_VERSION) - XLAT(PACKET_VERSION), -#endif -#if defined(PACKET_HDRLEN) - XLAT(PACKET_HDRLEN), -#endif -#if defined(PACKET_RESERVE) - XLAT(PACKET_RESERVE), -#endif -#if defined(PACKET_TX_RING) - XLAT(PACKET_TX_RING), -#endif -#if defined(PACKET_LOSS) - XLAT(PACKET_LOSS), -#endif - XLAT_END -}; +#include "xlat/sockpacketoptions.h" #endif /* SOL_PACKET */ #ifdef SOL_SCTP -static const struct xlat socksctpoptions[] = { -#if defined(SCTP_RTOINFO) - XLAT(SCTP_RTOINFO), -#endif -#if defined(SCTP_ASSOCINFO) - XLAT(SCTP_ASSOCINFO), -#endif -#if defined(SCTP_INITMSG) - XLAT(SCTP_INITMSG), -#endif -#if defined(SCTP_NODELAY) - XLAT(SCTP_NODELAY), -#endif -#if defined(SCTP_AUTOCLOSE) - XLAT(SCTP_AUTOCLOSE), -#endif -#if defined(SCTP_SET_PEER_PRIMARY_ADDR) - XLAT(SCTP_SET_PEER_PRIMARY_ADDR), -#endif -#if defined(SCTP_PRIMARY_ADDR) - XLAT(SCTP_PRIMARY_ADDR), -#endif -#if defined(SCTP_ADAPTATION_LAYER) - XLAT(SCTP_ADAPTATION_LAYER), -#endif -#if defined(SCTP_DISABLE_FRAGMENTS) - XLAT(SCTP_DISABLE_FRAGMENTS), -#endif -#if defined(SCTP_PEER_ADDR_PARAMS) - XLAT(SCTP_PEER_ADDR_PARAMS), -#endif -#if defined(SCTP_DEFAULT_SEND_PARAM) - XLAT(SCTP_DEFAULT_SEND_PARAM), -#endif -#if defined(SCTP_EVENTS) - XLAT(SCTP_EVENTS), -#endif -#if defined(SCTP_I_WANT_MAPPED_V4_ADDR) - XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), -#endif -#if defined(SCTP_MAXSEG) - XLAT(SCTP_MAXSEG), -#endif -#if defined(SCTP_STATUS) - XLAT(SCTP_STATUS), -#endif -#if defined(SCTP_GET_PEER_ADDR_INFO) - XLAT(SCTP_GET_PEER_ADDR_INFO), -#endif -#if defined(SCTP_DELAYED_ACK) - XLAT(SCTP_DELAYED_ACK), -#endif -#if defined(SCTP_CONTEXT) - XLAT(SCTP_CONTEXT), -#endif -#if defined(SCTP_FRAGMENT_INTERLEAVE) - XLAT(SCTP_FRAGMENT_INTERLEAVE), -#endif -#if defined(SCTP_PARTIAL_DELIVERY_POINT) - XLAT(SCTP_PARTIAL_DELIVERY_POINT), -#endif -#if defined(SCTP_MAX_BURST) - XLAT(SCTP_MAX_BURST), -#endif -#if defined(SCTP_AUTH_CHUNK) - XLAT(SCTP_AUTH_CHUNK), -#endif -#if defined(SCTP_HMAC_IDENT) - XLAT(SCTP_HMAC_IDENT), -#endif -#if defined(SCTP_AUTH_KEY) - XLAT(SCTP_AUTH_KEY), -#endif -#if defined(SCTP_AUTH_ACTIVE_KEY) - XLAT(SCTP_AUTH_ACTIVE_KEY), -#endif -#if defined(SCTP_AUTH_DELETE_KEY) - XLAT(SCTP_AUTH_DELETE_KEY), -#endif -#if defined(SCTP_PEER_AUTH_CHUNKS) - XLAT(SCTP_PEER_AUTH_CHUNKS), -#endif -#if defined(SCTP_LOCAL_AUTH_CHUNKS) - XLAT(SCTP_LOCAL_AUTH_CHUNKS), -#endif -#if defined(SCTP_GET_ASSOC_NUMBER) - XLAT(SCTP_GET_ASSOC_NUMBER), -#endif - - /* linux specific things */ -#if defined(SCTP_SOCKOPT_BINDX_ADD) - XLAT(SCTP_SOCKOPT_BINDX_ADD), -#endif -#if defined(SCTP_SOCKOPT_BINDX_REM) - XLAT(SCTP_SOCKOPT_BINDX_REM), -#endif -#if defined(SCTP_SOCKOPT_PEELOFF) - XLAT(SCTP_SOCKOPT_PEELOFF), -#endif -#if defined(SCTP_GET_PEER_ADDRS_NUM_OLD) - XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), -#endif -#if defined(SCTP_GET_PEER_ADDRS_OLD) - XLAT(SCTP_GET_PEER_ADDRS_OLD), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS_NUM_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_OLD), -#endif -#if defined(SCTP_SOCKOPT_CONNECTX_OLD) - XLAT(SCTP_SOCKOPT_CONNECTX_OLD), -#endif -#if defined(SCTP_GET_PEER_ADDRS) - XLAT(SCTP_GET_PEER_ADDRS), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS) - XLAT(SCTP_GET_LOCAL_ADDRS), -#endif - - XLAT_END -}; +#include "xlat/socksctpoptions.h" #endif #if !defined(SOL_TCP) && defined(IPPROTO_TCP) @@ -1245,149 +147,15 @@ static const struct xlat socksctpoptions[] = { #endif #ifdef SOL_TCP -static const struct xlat socktcpoptions[] = { - XLAT(TCP_NODELAY), - XLAT(TCP_MAXSEG), -#ifdef TCP_CORK - XLAT(TCP_CORK), -#endif -#ifdef TCP_KEEPIDLE - XLAT(TCP_KEEPIDLE), -#endif -#ifdef TCP_KEEPINTVL - XLAT(TCP_KEEPINTVL), -#endif -#ifdef TCP_KEEPCNT - XLAT(TCP_KEEPCNT), -#endif -#ifdef TCP_SYNCNT - XLAT(TCP_SYNCNT), -#endif -#ifdef TCP_LINGER2 - XLAT(TCP_LINGER2), -#endif -#ifdef TCP_DEFER_ACCEPT - XLAT(TCP_DEFER_ACCEPT), -#endif -#ifdef TCP_WINDOW_CLAMP - XLAT(TCP_WINDOW_CLAMP), -#endif -#ifdef TCP_INFO - XLAT(TCP_INFO), -#endif -#ifdef TCP_QUICKACK - XLAT(TCP_QUICKACK), -#endif -#ifdef TCP_CONGESTION - XLAT(TCP_CONGESTION), -#endif -#ifdef TCP_MD5SIG - XLAT(TCP_MD5SIG), -#endif -#ifdef TCP_COOKIE_TRANSACTIONS - XLAT(TCP_COOKIE_TRANSACTIONS), -#endif -#ifdef TCP_THIN_LINEAR_TIMEOUTS - XLAT(TCP_THIN_LINEAR_TIMEOUTS), -#endif -#ifdef TCP_THIN_DUPACK - XLAT(TCP_THIN_DUPACK), -#endif -#ifdef TCP_USER_TIMEOUT - XLAT(TCP_USER_TIMEOUT), -#endif -#ifdef TCP_REPAIR - XLAT(TCP_REPAIR), -#endif -#ifdef TCP_REPAIR_QUEUE - XLAT(TCP_REPAIR_QUEUE), -#endif -#ifdef TCP_QUEUE_SEQ - XLAT(TCP_QUEUE_SEQ), -#endif -#ifdef TCP_REPAIR_OPTIONS - XLAT(TCP_REPAIR_OPTIONS), -#endif -#ifdef TCP_FASTOPEN - XLAT(TCP_FASTOPEN), -#endif -#ifdef TCP_TIMESTAMP - XLAT(TCP_TIMESTAMP), -#endif - XLAT_END -}; +#include "xlat/socktcpoptions.h" #endif /* SOL_TCP */ #ifdef SOL_RAW -static const struct xlat icmpfilterflags[] = { -#if defined(ICMP_ECHOREPLY) - { (1< -static const struct xlat prctl_options[] = { -#ifdef PR_MAXPROCS - XLAT(PR_MAXPROCS), -#endif -#ifdef PR_ISBLOCKED - XLAT(PR_ISBLOCKED), -#endif -#ifdef PR_SETSTACKSIZE - XLAT(PR_SETSTACKSIZE), -#endif -#ifdef PR_GETSTACKSIZE - XLAT(PR_GETSTACKSIZE), -#endif -#ifdef PR_MAXPPROCS - XLAT(PR_MAXPPROCS), -#endif -#ifdef PR_UNBLKONEXEC - XLAT(PR_UNBLKONEXEC), -#endif -#ifdef PR_ATOMICSIM - XLAT(PR_ATOMICSIM), -#endif -#ifdef PR_SETEXITSIG - XLAT(PR_SETEXITSIG), -#endif -#ifdef PR_RESIDENT - XLAT(PR_RESIDENT), -#endif -#ifdef PR_ATTACHADDR - XLAT(PR_ATTACHADDR), -#endif -#ifdef PR_DETACHADDR - XLAT(PR_DETACHADDR), -#endif -#ifdef PR_TERMCHILD - XLAT(PR_TERMCHILD), -#endif -#ifdef PR_GETSHMASK - XLAT(PR_GETSHMASK), -#endif -#ifdef PR_GETNSHARE - XLAT(PR_GETNSHARE), -#endif -#ifdef PR_COREPID - XLAT(PR_COREPID), -#endif -#ifdef PR_ATTACHADDRPERM - XLAT(PR_ATTACHADDRPERM), -#endif -#ifdef PR_PTHREADEXIT - XLAT(PR_PTHREADEXIT), -#endif - -#ifdef PR_SET_PDEATHSIG - XLAT(PR_SET_PDEATHSIG), -#endif -#ifdef PR_GET_PDEATHSIG - XLAT(PR_GET_PDEATHSIG), -#endif -#ifdef PR_GET_DUMPABLE - XLAT(PR_GET_DUMPABLE), -#endif -#ifdef PR_SET_DUMPABLE - XLAT(PR_SET_DUMPABLE), -#endif -#ifdef PR_GET_UNALIGN - XLAT(PR_GET_UNALIGN), -#endif -#ifdef PR_SET_UNALIGN - XLAT(PR_SET_UNALIGN), -#endif -#ifdef PR_GET_KEEPCAPS - XLAT(PR_GET_KEEPCAPS), -#endif -#ifdef PR_SET_KEEPCAPS - XLAT(PR_SET_KEEPCAPS), -#endif -#ifdef PR_GET_FPEMU - XLAT(PR_GET_FPEMU), -#endif -#ifdef PR_SET_FPEMU - XLAT(PR_SET_FPEMU), -#endif -#ifdef PR_GET_FPEXC - XLAT(PR_GET_FPEXC), -#endif -#ifdef PR_SET_FPEXC - XLAT(PR_SET_FPEXC), -#endif -#ifdef PR_GET_TIMING - XLAT(PR_GET_TIMING), -#endif -#ifdef PR_SET_TIMING - XLAT(PR_SET_TIMING), -#endif -#ifdef PR_SET_NAME - XLAT(PR_SET_NAME), -#endif -#ifdef PR_GET_NAME - XLAT(PR_GET_NAME), -#endif -#ifdef PR_GET_ENDIAN - XLAT(PR_GET_ENDIAN), -#endif -#ifdef PR_SET_ENDIAN - XLAT(PR_SET_ENDIAN), -#endif -#ifdef PR_GET_SECCOMP - XLAT(PR_GET_SECCOMP), -#endif -#ifdef PR_SET_SECCOMP - XLAT(PR_SET_SECCOMP), -#endif -#ifdef PR_CAPBSET_READ - XLAT(PR_CAPBSET_READ), -#endif -#ifdef PR_CAPBSET_DROP - XLAT(PR_CAPBSET_DROP), -#endif -#ifdef PR_GET_TSC - XLAT(PR_GET_TSC), -#endif -#ifdef PR_SET_TSC - XLAT(PR_SET_TSC), -#endif -#ifdef PR_GET_SECUREBITS - XLAT(PR_GET_SECUREBITS), -#endif -#ifdef PR_SET_SECUREBITS - XLAT(PR_SET_SECUREBITS), -#endif -#ifdef PR_SET_TIMERSLACK - XLAT(PR_SET_TIMERSLACK), -#endif -#ifdef PR_GET_TIMERSLACK - XLAT(PR_GET_TIMERSLACK), -#endif -#ifdef PR_TASK_PERF_EVENTS_DISABLE - XLAT(PR_TASK_PERF_EVENTS_DISABLE), -#endif -#ifdef PR_TASK_PERF_EVENTS_ENABLE - XLAT(PR_TASK_PERF_EVENTS_ENABLE), -#endif -#ifdef PR_MCE_KILL - XLAT(PR_MCE_KILL), -#endif -#ifdef PR_MCE_KILL_GET - XLAT(PR_MCE_KILL_GET), -#endif -#ifdef PR_SET_MM - XLAT(PR_SET_MM), -#endif -#ifdef PR_SET_PTRACER - XLAT(PR_SET_PTRACER), -#endif -#ifdef PR_SET_CHILD_SUBREAPER - XLAT(PR_SET_CHILD_SUBREAPER), -#endif -#ifdef PR_GET_CHILD_SUBREAPER - XLAT(PR_GET_CHILD_SUBREAPER), -#endif -#ifdef PR_SET_NO_NEW_PRIVS - XLAT(PR_SET_NO_NEW_PRIVS), -#endif -#ifdef PR_GET_NO_NEW_PRIVS - XLAT(PR_GET_NO_NEW_PRIVS), -#endif -#ifdef PR_GET_TID_ADDRESS - XLAT(PR_GET_TID_ADDRESS), -#endif - XLAT_END -}; +#include "xlat/prctl_options.h" static const char * unalignctl_string(unsigned int ctl) @@ -464,32 +293,7 @@ sys_exit(struct tcb *tcp) #define CLONE_NEWNET 0x40000000 /* New network namespace */ #define CLONE_IO 0x80000000 /* Clone io context */ -static const struct xlat clone_flags[] = { - XLAT(CLONE_VM), - XLAT(CLONE_FS), - XLAT(CLONE_FILES), - XLAT(CLONE_SIGHAND), - XLAT(CLONE_IDLETASK), - XLAT(CLONE_PTRACE), - XLAT(CLONE_VFORK), - XLAT(CLONE_PARENT), - XLAT(CLONE_THREAD), - XLAT(CLONE_NEWNS), - XLAT(CLONE_SYSVSEM), - XLAT(CLONE_SETTLS), - XLAT(CLONE_PARENT_SETTID), - XLAT(CLONE_CHILD_CLEARTID), - XLAT(CLONE_UNTRACED), - XLAT(CLONE_CHILD_SETTID), - XLAT(CLONE_STOPPED), - XLAT(CLONE_NEWUTS), - XLAT(CLONE_NEWIPC), - XLAT(CLONE_NEWUSER), - XLAT(CLONE_NEWPID), - XLAT(CLONE_NEWNET), - XLAT(CLONE_IO), - XLAT_END -}; +#include "xlat/clone_flags.h" #if defined I386 || defined X86_64 || defined X32 extern void print_user_desc(struct tcb *, long); @@ -1008,37 +812,7 @@ sys_execve(struct tcb *tcp) #define __WCLONE 0x80000000 #endif -static const struct xlat wait4_options[] = { - XLAT(WNOHANG), -#ifndef WSTOPPED - XLAT(WUNTRACED), -#endif -#ifdef WEXITED - XLAT(WEXITED), -#endif -#ifdef WTRAPPED - XLAT(WTRAPPED), -#endif -#ifdef WSTOPPED - XLAT(WSTOPPED), -#endif -#ifdef WCONTINUED - XLAT(WCONTINUED), -#endif -#ifdef WNOWAIT - XLAT(WNOWAIT), -#endif -#ifdef __WCLONE - XLAT(__WCLONE), -#endif -#ifdef __WALL - XLAT(__WALL), -#endif -#ifdef __WNOTHREAD - XLAT(__WNOTHREAD), -#endif - XLAT_END -}; +#include "xlat/wait4_options.h" #if !defined WCOREFLAG && defined WCOREFLG # define WCOREFLAG WCOREFLG @@ -1163,30 +937,7 @@ sys_osf_wait4(struct tcb *tcp) } #endif -static const struct xlat waitid_types[] = { - XLAT(P_PID), -#ifdef P_PPID - XLAT(P_PPID), -#endif - XLAT(P_PGID), -#ifdef P_SID - XLAT(P_SID), -#endif -#ifdef P_CID - XLAT(P_CID), -#endif -#ifdef P_UID - XLAT(P_UID), -#endif -#ifdef P_GID - XLAT(P_GID), -#endif - XLAT(P_ALL), -#ifdef P_LWPID - XLAT(P_LWPID), -#endif - XLAT_END -}; +#include "xlat/waitid_types.h" int sys_waitid(struct tcb *tcp) @@ -1243,183 +994,13 @@ sys_uname(struct tcb *tcp) return 0; } -static const struct xlat ptrace_cmds[] = { - XLAT(PTRACE_TRACEME), - XLAT(PTRACE_PEEKTEXT), - XLAT(PTRACE_PEEKDATA), - XLAT(PTRACE_PEEKUSER), - XLAT(PTRACE_POKETEXT), - XLAT(PTRACE_POKEDATA), - XLAT(PTRACE_POKEUSER), - XLAT(PTRACE_CONT), - XLAT(PTRACE_KILL), - XLAT(PTRACE_SINGLESTEP), - XLAT(PTRACE_ATTACH), - XLAT(PTRACE_DETACH), -#ifdef PTRACE_GETREGS - XLAT(PTRACE_GETREGS), -#endif -#ifdef PTRACE_SETREGS - XLAT(PTRACE_SETREGS), -#endif -#ifdef PTRACE_GETFPREGS - XLAT(PTRACE_GETFPREGS), -#endif -#ifdef PTRACE_SETFPREGS - XLAT(PTRACE_SETFPREGS), -#endif -#ifdef PTRACE_GETFPXREGS - XLAT(PTRACE_GETFPXREGS), -#endif -#ifdef PTRACE_SETFPXREGS - XLAT(PTRACE_SETFPXREGS), -#endif -#ifdef PTRACE_GETVRREGS - XLAT(PTRACE_GETVRREGS), -#endif -#ifdef PTRACE_SETVRREGS - XLAT(PTRACE_SETVRREGS), -#endif -#ifdef PTRACE_SETOPTIONS - XLAT(PTRACE_SETOPTIONS), -#endif -#ifdef PTRACE_GETEVENTMSG - XLAT(PTRACE_GETEVENTMSG), -#endif -#ifdef PTRACE_GETSIGINFO - XLAT(PTRACE_GETSIGINFO), -#endif -#ifdef PTRACE_SETSIGINFO - XLAT(PTRACE_SETSIGINFO), -#endif -#ifdef PTRACE_GETREGSET - XLAT(PTRACE_GETREGSET), -#endif -#ifdef PTRACE_SETREGSET - XLAT(PTRACE_SETREGSET), -#endif -#ifdef PTRACE_SET_SYSCALL - XLAT(PTRACE_SET_SYSCALL), -#endif -#ifdef PTRACE_SEIZE - XLAT(PTRACE_SEIZE), -#endif -#ifdef PTRACE_INTERRUPT - XLAT(PTRACE_INTERRUPT), -#endif -#ifdef PTRACE_LISTEN - XLAT(PTRACE_LISTEN), -#endif - XLAT(PTRACE_SYSCALL), - - XLAT_END -}; +#include "xlat/ptrace_cmds.h" #ifdef PTRACE_SETOPTIONS -static const struct xlat ptrace_setoptions_flags[] = { -# ifdef PTRACE_O_TRACESYSGOOD - XLAT(PTRACE_O_TRACESYSGOOD), -# endif -# ifdef PTRACE_O_TRACEFORK - XLAT(PTRACE_O_TRACEFORK), -# endif -# ifdef PTRACE_O_TRACEVFORK - XLAT(PTRACE_O_TRACEVFORK), -# endif -# ifdef PTRACE_O_TRACECLONE - XLAT(PTRACE_O_TRACECLONE), -# endif -# ifdef PTRACE_O_TRACEEXEC - XLAT(PTRACE_O_TRACEEXEC), -# endif -# ifdef PTRACE_O_TRACEVFORKDONE - XLAT(PTRACE_O_TRACEVFORKDONE), -# endif -# ifdef PTRACE_O_TRACEEXIT - XLAT(PTRACE_O_TRACEEXIT), -# endif -# ifdef PTRACE_O_TRACESECCOMP - XLAT(PTRACE_O_TRACESECCOMP), -# endif -# ifdef PTRACE_O_EXITKILL - XLAT(PTRACE_O_EXITKILL), -# endif - XLAT_END -}; +#include "xlat/ptrace_setoptions_flags.h" #endif /* PTRACE_SETOPTIONS */ -static const struct xlat nt_descriptor_types[] = { -#ifdef NT_PRSTATUS - XLAT(NT_PRSTATUS), -#endif -#ifdef NT_FPREGSET - XLAT(NT_FPREGSET), -#endif -#ifdef NT_PRPSINFO - XLAT(NT_PRPSINFO), -#endif -#ifdef NT_PRXREG - XLAT(NT_PRXREG), -#endif -#ifdef NT_TASKSTRUCT - XLAT(NT_TASKSTRUCT), -#endif -#ifdef NT_PLATFORM - XLAT(NT_PLATFORM), -#endif -#ifdef NT_AUXV - XLAT(NT_AUXV), -#endif -#ifdef NT_GWINDOWS - XLAT(NT_GWINDOWS), -#endif -#ifdef NT_ASRS - XLAT(NT_ASRS), -#endif -#ifdef NT_PSTATUS - XLAT(NT_PSTATUS), -#endif -#ifdef NT_PSINFO - XLAT(NT_PSINFO), -#endif -#ifdef NT_PRCRED - XLAT(NT_PRCRED), -#endif -#ifdef NT_UTSNAME - XLAT(NT_UTSNAME), -#endif -#ifdef NT_LWPSTATUS - XLAT(NT_LWPSTATUS), -#endif -#ifdef NT_LWPSINFO - XLAT(NT_LWPSINFO), -#endif -#ifdef NT_PRFPXREG - XLAT(NT_PRFPXREG), -#endif -#ifdef NT_PRXFPREG - XLAT(NT_PRXFPREG), -#endif -#ifdef NT_PPC_VMX - XLAT(NT_PPC_VMX), -#endif -#ifdef NT_PPC_SPE - XLAT(NT_PPC_SPE), -#endif -#ifdef NT_PPC_VSX - XLAT(NT_PPC_VSX), -#endif -#ifdef NT_386_TLS - XLAT(NT_386_TLS), -#endif -#ifdef NT_386_IOPERM - XLAT(NT_386_IOPERM), -#endif -#ifdef NT_X86_XSTATE - XLAT(NT_X86_XSTATE), -#endif - XLAT_END -}; +#include "xlat/nt_descriptor_types.h" #define uoff(member) offsetof(struct user, member) @@ -2692,39 +2273,7 @@ sys_ptrace(struct tcb *tcp) #ifndef FUTEX_CMP_REQUEUE_PI_PRIVATE # define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG) #endif -static const struct xlat futexops[] = { - XLAT(FUTEX_WAIT), - XLAT(FUTEX_WAKE), - XLAT(FUTEX_FD), - XLAT(FUTEX_REQUEUE), - XLAT(FUTEX_CMP_REQUEUE), - XLAT(FUTEX_WAKE_OP), - XLAT(FUTEX_LOCK_PI), - XLAT(FUTEX_UNLOCK_PI), - XLAT(FUTEX_TRYLOCK_PI), - XLAT(FUTEX_WAIT_BITSET), - XLAT(FUTEX_WAKE_BITSET), - XLAT(FUTEX_WAIT_REQUEUE_PI), - XLAT(FUTEX_CMP_REQUEUE_PI), - XLAT(FUTEX_WAIT_PRIVATE), - XLAT(FUTEX_WAKE_PRIVATE), - XLAT(FUTEX_FD|FUTEX_PRIVATE_FLAG), - XLAT(FUTEX_REQUEUE_PRIVATE), - XLAT(FUTEX_CMP_REQUEUE_PRIVATE), - XLAT(FUTEX_WAKE_OP_PRIVATE), - XLAT(FUTEX_LOCK_PI_PRIVATE), - XLAT(FUTEX_UNLOCK_PI_PRIVATE), - XLAT(FUTEX_TRYLOCK_PI_PRIVATE), - XLAT(FUTEX_WAIT_BITSET_PRIVATE), - XLAT(FUTEX_WAKE_BITSET_PRIVATE), - XLAT(FUTEX_WAIT_REQUEUE_PI_PRIVATE), - XLAT(FUTEX_CMP_REQUEUE_PI_PRIVATE), - XLAT(FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME), - XLAT(FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME), - XLAT(FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME), - XLAT(FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME), - XLAT_END -}; +#include "xlat/futexops.h" #ifndef FUTEX_OP_SET # define FUTEX_OP_SET 0 # define FUTEX_OP_ADD 1 @@ -2738,23 +2287,8 @@ static const struct xlat futexops[] = { # define FUTEX_OP_CMP_GT 4 # define FUTEX_OP_CMP_GE 5 #endif -static const struct xlat futexwakeops[] = { - XLAT(FUTEX_OP_SET), - XLAT(FUTEX_OP_ADD), - XLAT(FUTEX_OP_OR), - XLAT(FUTEX_OP_ANDN), - XLAT(FUTEX_OP_XOR), - XLAT_END -}; -static const struct xlat futexwakecmps[] = { - XLAT(FUTEX_OP_CMP_EQ), - XLAT(FUTEX_OP_CMP_NE), - XLAT(FUTEX_OP_CMP_LT), - XLAT(FUTEX_OP_CMP_LE), - XLAT(FUTEX_OP_CMP_GT), - XLAT(FUTEX_OP_CMP_GE), - XLAT_END -}; +#include "xlat/futexwakeops.h" +#include "xlat/futexwakecmps.h" int sys_futex(struct tcb *tcp) @@ -2880,12 +2414,7 @@ sys_get_robust_list(struct tcb *tcp) return 0; } -static const struct xlat schedulers[] = { - XLAT(SCHED_OTHER), - XLAT(SCHED_RR), - XLAT(SCHED_FIFO), - XLAT_END -}; +#include "xlat/schedulers.h" int sys_sched_getscheduler(struct tcb *tcp) @@ -2969,13 +2498,7 @@ sys_sched_rr_get_interval(struct tcb *tcp) #if defined X86_64 || defined X32 # include -static const struct xlat archvals[] = { - XLAT(ARCH_SET_GS), - XLAT(ARCH_SET_FS), - XLAT(ARCH_GET_FS), - XLAT(ARCH_GET_GS), - XLAT_END -}; +#include "xlat/archvals.h" int sys_arch_prctl(struct tcb *tcp) diff --git a/ptp.c b/ptp.c index 773f3d59..64e9905e 100644 --- a/ptp.c +++ b/ptp.c @@ -2,12 +2,7 @@ #include #include -static const struct xlat ptp_flags_options[] = { - XLAT(PTP_ENABLE_FEATURE), - XLAT(PTP_RISING_EDGE), - XLAT(PTP_FALLING_EDGE), - XLAT_END -}; +#include "xlat/ptp_flags_options.h" int ptp_ioctl(struct tcb *tcp, long code, long arg) diff --git a/quota.c b/quota.c index a13610f4..7f2a3a6c 100644 --- a/quota.c +++ b/quota.c @@ -76,64 +76,18 @@ #define Q_XQUOTARM XQM_CMD(0x6) #define Q_XQUOTASYNC XQM_CMD(0x7) -static const struct xlat quotacmds[] = { - XLAT(Q_V1_QUOTAON), - XLAT(Q_V1_QUOTAOFF), - XLAT(Q_V1_GETQUOTA), - XLAT(Q_V1_SETQUOTA), - XLAT(Q_V1_SETUSE), - XLAT(Q_V1_SYNC), - XLAT(Q_SETQLIM), - XLAT(Q_V1_GETSTATS), - XLAT(Q_V1_RSQUASH), - - XLAT(Q_V2_GETQUOTA), - XLAT(Q_V2_SETQUOTA), - XLAT(Q_V2_SETUSE), - XLAT(Q_V2_GETINFO), - XLAT(Q_V2_SETINFO), - XLAT(Q_V2_SETGRACE), - XLAT(Q_V2_SETFLAGS), - XLAT(Q_V2_GETSTATS), - - XLAT(Q_SYNC), - XLAT(Q_QUOTAON), - XLAT(Q_QUOTAOFF), - XLAT(Q_GETFMT), - XLAT(Q_GETINFO), - XLAT(Q_SETINFO), - XLAT(Q_GETQUOTA), - XLAT(Q_SETQUOTA), - - XLAT(Q_XQUOTAON), - XLAT(Q_XQUOTAOFF), - XLAT(Q_XGETQUOTA), - XLAT(Q_XSETQLIM), - XLAT(Q_XGETQSTAT), - XLAT(Q_XQUOTARM), - XLAT(Q_XQUOTASYNC), - - XLAT_END -}; +#include "xlat/quotacmds.h" #define USRQUOTA 0 #define GRPQUOTA 1 -static const struct xlat quotatypes[] = { - XLAT(USRQUOTA), - XLAT(GRPQUOTA), - XLAT_END -}; +#include "xlat/quotatypes.h" /* Quota format identifiers */ #define QFMT_VFS_OLD 1 #define QFMT_VFS_V0 2 -static const struct xlat quota_formats[] = { - XLAT(QFMT_VFS_OLD), - XLAT(QFMT_VFS_V0), - XLAT_END -}; +#include "xlat/quota_formats.h" #define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ #define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */ @@ -144,20 +98,9 @@ static const struct xlat quota_formats[] = { #define XFS_PROJ_QUOTA (1<<1) /* (IRIX) project quota type */ #define XFS_GROUP_QUOTA (1<<2) /* group quota type */ -static const struct xlat xfs_quota_flags[] = { - XLAT(XFS_QUOTA_UDQ_ACCT), - XLAT(XFS_QUOTA_UDQ_ENFD), - XLAT(XFS_QUOTA_GDQ_ACCT), - XLAT(XFS_QUOTA_GDQ_ENFD), - XLAT_END -}; +#include "xlat/xfs_quota_flags.h" -static const struct xlat xfs_dqblk_flags[] = { - XLAT(XFS_USER_QUOTA), - XLAT(XFS_PROJ_QUOTA), - XLAT(XFS_GROUP_QUOTA), - XLAT_END -}; +#include "xlat/xfs_dqblk_flags.h" /* * Following flags are used to specify which fields are valid @@ -169,15 +112,7 @@ static const struct xlat xfs_dqblk_flags[] = { #define QIF_BTIME 16 #define QIF_ITIME 32 -static const struct xlat if_dqblk_valid[] = { - XLAT(QIF_BLIMITS), - XLAT(QIF_SPACE), - XLAT(QIF_ILIMITS), - XLAT(QIF_INODES), - XLAT(QIF_BTIME), - XLAT(QIF_ITIME), - XLAT_END -}; +#include "xlat/if_dqblk_valid.h" struct if_dqblk { @@ -249,12 +184,7 @@ struct xfs_dqblk #define IIF_IGRACE 2 #define IIF_FLAGS 4 -static const struct xlat if_dqinfo_valid[] = { - XLAT(IIF_BGRACE), - XLAT(IIF_IGRACE), - XLAT(IIF_FLAGS), - XLAT_END -}; +#include "xlat/if_dqinfo_valid.h" struct if_dqinfo { diff --git a/reboot.c b/reboot.c index f8c3de7a..ab1160ba 100644 --- a/reboot.c +++ b/reboot.c @@ -1,30 +1,11 @@ #include "defs.h" #include -static const struct xlat bootflags1[] = { - XLAT(LINUX_REBOOT_MAGIC1), - XLAT_END -}; +#include "xlat/bootflags1.h" -static const struct xlat bootflags2[] = { - XLAT(LINUX_REBOOT_MAGIC2), - XLAT(LINUX_REBOOT_MAGIC2A), - XLAT(LINUX_REBOOT_MAGIC2B), - XLAT(LINUX_REBOOT_MAGIC2C), - XLAT_END -}; +#include "xlat/bootflags2.h" -static const struct xlat bootflags3[] = { - XLAT(LINUX_REBOOT_CMD_RESTART), - XLAT(LINUX_REBOOT_CMD_HALT), - XLAT(LINUX_REBOOT_CMD_CAD_ON), - XLAT(LINUX_REBOOT_CMD_CAD_OFF), - XLAT(LINUX_REBOOT_CMD_POWER_OFF), - XLAT(LINUX_REBOOT_CMD_RESTART2), - XLAT(LINUX_REBOOT_CMD_SW_SUSPEND), - XLAT(LINUX_REBOOT_CMD_KEXEC), - XLAT_END -}; +#include "xlat/bootflags3.h" int sys_reboot(struct tcb *tcp) diff --git a/resource.c b/resource.c index b62f6316..12e218f2 100644 --- a/resource.c +++ b/resource.c @@ -33,60 +33,7 @@ #include #include -static const struct xlat resources[] = { -#ifdef RLIMIT_AS - XLAT(RLIMIT_AS), -#endif -#ifdef RLIMIT_CORE - XLAT(RLIMIT_CORE), -#endif -#ifdef RLIMIT_CPU - XLAT(RLIMIT_CPU), -#endif -#ifdef RLIMIT_DATA - XLAT(RLIMIT_DATA), -#endif -#ifdef RLIMIT_FSIZE - XLAT(RLIMIT_FSIZE), -#endif -#ifdef RLIMIT_LOCKS - XLAT(RLIMIT_LOCKS), -#endif -#ifdef RLIMIT_MEMLOCK - XLAT(RLIMIT_MEMLOCK), -#endif -#ifdef RLIMIT_MSGQUEUE - XLAT(RLIMIT_MSGQUEUE), -#endif -#ifdef RLIMIT_NICE - XLAT(RLIMIT_NICE), -#endif -#ifdef RLIMIT_NOFILE - XLAT(RLIMIT_NOFILE), -#endif -#ifdef RLIMIT_NPROC - XLAT(RLIMIT_NPROC), -#endif -#ifdef RLIMIT_RSS - XLAT(RLIMIT_RSS), -#endif -#ifdef RLIMIT_RTPRIO - XLAT(RLIMIT_RTPRIO), -#endif -#ifdef RLIMIT_RTTIME - XLAT(RLIMIT_RTTIME), -#endif -#ifdef RLIMIT_SIGPENDING - XLAT(RLIMIT_SIGPENDING), -#endif -#ifdef RLIMIT_STACK - XLAT(RLIMIT_STACK), -#endif -#ifdef RLIMIT_VMEM - XLAT(RLIMIT_VMEM), -#endif - XLAT_END -}; +#include "xlat/resources.h" static const char * sprint_rlim64(uint64_t lim) @@ -234,14 +181,7 @@ sys_prlimit64(struct tcb *tcp) return 0; } -static const struct xlat usagewho[] = { - XLAT(RUSAGE_SELF), - XLAT(RUSAGE_CHILDREN), -#ifdef RUSAGE_BOTH - XLAT(RUSAGE_BOTH), -#endif - XLAT_END -}; +#include "xlat/usagewho.h" #ifdef ALPHA void @@ -388,12 +328,7 @@ sys_sysinfo(struct tcb *tcp) return 0; } -static const struct xlat priorities[] = { - XLAT(PRIO_PROCESS), - XLAT(PRIO_PGRP), - XLAT(PRIO_USER), - XLAT_END -}; +#include "xlat/priorities.h" int sys_getpriority(struct tcb *tcp) diff --git a/scsi.c b/scsi.c index c49f9548..2aa4c7b3 100644 --- a/scsi.c +++ b/scsi.c @@ -33,13 +33,7 @@ # include # include -static const struct xlat sg_io_dxfer_direction[] = { - XLAT(SG_DXFER_NONE), - XLAT(SG_DXFER_TO_DEV), - XLAT(SG_DXFER_FROM_DEV), - XLAT(SG_DXFER_TO_FROM_DEV), - XLAT_END -}; +#include "xlat/sg_io_dxfer_direction.h" static void print_sg_io_buffer(struct tcb *tcp, unsigned char *addr, int len) diff --git a/signal.c b/signal.c index e3072f11..b11dc6a5 100644 --- a/signal.c +++ b/signal.c @@ -100,67 +100,9 @@ struct sigcontext { # endif #endif -static const struct xlat sigact_flags[] = { -#ifdef SA_RESTORER - XLAT(SA_RESTORER), -#endif -#ifdef SA_STACK - XLAT(SA_STACK), -#endif -#ifdef SA_RESTART - XLAT(SA_RESTART), -#endif -#ifdef SA_INTERRUPT - XLAT(SA_INTERRUPT), -#endif -#ifdef SA_NODEFER - XLAT(SA_NODEFER), -#endif -#if defined SA_NOMASK && SA_NODEFER != SA_NOMASK - XLAT(SA_NOMASK), -#endif -#ifdef SA_RESETHAND - XLAT(SA_RESETHAND), -#endif -#if defined SA_ONESHOT && SA_ONESHOT != SA_RESETHAND - XLAT(SA_ONESHOT), -#endif -#ifdef SA_SIGINFO - XLAT(SA_SIGINFO), -#endif -#ifdef SA_RESETHAND - XLAT(SA_RESETHAND), -#endif -#ifdef SA_ONSTACK - XLAT(SA_ONSTACK), -#endif -#ifdef SA_NODEFER - XLAT(SA_NODEFER), -#endif -#ifdef SA_NOCLDSTOP - XLAT(SA_NOCLDSTOP), -#endif -#ifdef SA_NOCLDWAIT - XLAT(SA_NOCLDWAIT), -#endif -#ifdef _SA_BSDCALL - XLAT(_SA_BSDCALL), -#endif -#ifdef SA_NOPTRACE - XLAT(SA_NOPTRACE), -#endif - XLAT_END -}; +#include "xlat/sigact_flags.h" -static const struct xlat sigprocmaskcmds[] = { - XLAT(SIG_BLOCK), - XLAT(SIG_UNBLOCK), - XLAT(SIG_SETMASK), -#ifdef SIG_SETMASK32 - XLAT(SIG_SETMASK32), -#endif - XLAT_END -}; +#include "xlat/sigprocmaskcmds.h" #endif /* HAVE_SIGACTION */ @@ -385,132 +327,32 @@ print_sigset_addr_len(struct tcb *tcp, long addr, long len) # define SI_FROMUSER(sip) ((sip)->si_code <= 0) #endif -static const struct xlat siginfo_codes[] = { -#ifdef SI_KERNEL - XLAT(SI_KERNEL), -#endif -#ifdef SI_USER - XLAT(SI_USER), -#endif -#ifdef SI_QUEUE - XLAT(SI_QUEUE), -#endif -#ifdef SI_TIMER - XLAT(SI_TIMER), -#endif -#ifdef SI_MESGQ - XLAT(SI_MESGQ), -#endif -#ifdef SI_ASYNCIO - XLAT(SI_ASYNCIO), -#endif -#ifdef SI_SIGIO - XLAT(SI_SIGIO), -#endif -#ifdef SI_TKILL - XLAT(SI_TKILL), -#endif -#ifdef SI_DETHREAD - XLAT(SI_DETHREAD), -#endif -#ifdef SI_ASYNCNL - XLAT(SI_ASYNCNL), -#endif -#ifdef SI_NOINFO - XLAT(SI_NOINFO), -#endif -#ifdef SI_LWP - XLAT(SI_LWP), -#endif - XLAT_END -}; +#include "xlat/siginfo_codes.h" -static const struct xlat sigill_codes[] = { - XLAT(ILL_ILLOPC), - XLAT(ILL_ILLOPN), - XLAT(ILL_ILLADR), - XLAT(ILL_ILLTRP), - XLAT(ILL_PRVOPC), - XLAT(ILL_PRVREG), - XLAT(ILL_COPROC), - XLAT(ILL_BADSTK), - XLAT_END -}; +#include "xlat/sigill_codes.h" -static const struct xlat sigfpe_codes[] = { - XLAT(FPE_INTDIV), - XLAT(FPE_INTOVF), - XLAT(FPE_FLTDIV), - XLAT(FPE_FLTOVF), - XLAT(FPE_FLTUND), - XLAT(FPE_FLTRES), - XLAT(FPE_FLTINV), - XLAT(FPE_FLTSUB), - XLAT_END -}; +#include "xlat/sigfpe_codes.h" -static const struct xlat sigtrap_codes[] = { - XLAT(TRAP_BRKPT), - XLAT(TRAP_TRACE), - XLAT_END -}; +#include "xlat/sigtrap_codes.h" -static const struct xlat sigchld_codes[] = { - XLAT(CLD_EXITED), - XLAT(CLD_KILLED), - XLAT(CLD_DUMPED), - XLAT(CLD_TRAPPED), - XLAT(CLD_STOPPED), - XLAT(CLD_CONTINUED), - XLAT_END -}; +#include "xlat/sigchld_codes.h" -static const struct xlat sigpoll_codes[] = { - XLAT(POLL_IN), - XLAT(POLL_OUT), - XLAT(POLL_MSG), - XLAT(POLL_ERR), - XLAT(POLL_PRI), - XLAT(POLL_HUP), - XLAT_END -}; +#include "xlat/sigpoll_codes.h" -static const struct xlat sigprof_codes[] = { -#ifdef PROF_SIG - XLAT(PROF_SIG), -#endif - XLAT_END -}; +#include "xlat/sigprof_codes.h" #ifdef SIGEMT -static const struct xlat sigemt_codes[] = { -#ifdef EMT_TAGOVF - XLAT(EMT_TAGOVF), -#endif - XLAT_END -}; +#include "xlat/sigemt_codes.h" #endif -static const struct xlat sigsegv_codes[] = { - XLAT(SEGV_MAPERR), - XLAT(SEGV_ACCERR), - XLAT_END -}; +#include "xlat/sigsegv_codes.h" -static const struct xlat sigbus_codes[] = { - XLAT(BUS_ADRALN), - XLAT(BUS_ADRERR), - XLAT(BUS_OBJERR), - XLAT_END -}; +#include "xlat/sigbus_codes.h" #ifndef SYS_SECCOMP # define SYS_SECCOMP 1 #endif -static const struct xlat sigsys_codes[] = { - XLAT(SYS_SECCOMP), - XLAT_END -}; +#include "xlat/sigsys_codes.h" static void printsigsource(const siginfo_t *sip) @@ -1128,11 +970,7 @@ sys_sigsuspend(struct tcb *tcp) #define SS_DISABLE 2 #endif -static const struct xlat sigaltstack_flags[] = { - XLAT(SS_ONSTACK), - XLAT(SS_DISABLE), - XLAT_END -}; +#include "xlat/sigaltstack_flags.h" static void print_stack_t(struct tcb *tcp, unsigned long addr) diff --git a/sock.c b/sock.c index 3d4f0b64..d3a5b35a 100644 --- a/sock.c +++ b/sock.c @@ -38,24 +38,7 @@ #endif #include -static const struct xlat iffflags[] = { - XLAT(IFF_UP), - XLAT(IFF_BROADCAST), - XLAT(IFF_DEBUG), - XLAT(IFF_LOOPBACK), - XLAT(IFF_POINTOPOINT), - XLAT(IFF_NOTRAILERS), - XLAT(IFF_RUNNING), - XLAT(IFF_NOARP), - XLAT(IFF_PROMISC), - XLAT(IFF_ALLMULTI), - XLAT(IFF_MASTER), - XLAT(IFF_SLAVE), - XLAT(IFF_MULTICAST), - XLAT(IFF_PORTSEL), - XLAT(IFF_AUTOMEDIA), - XLAT_END -}; +#include "xlat/iffflags.h" static void print_addr(struct tcb *tcp, long addr, struct ifreq *ifr) diff --git a/stream.c b/stream.c index a47eca2c..ceb9e2d6 100644 --- a/stream.c +++ b/stream.c @@ -55,10 +55,7 @@ struct strbuf { # define MOREDATA 2 # endif -static const struct xlat msgflags[] = { - XLAT(RS_HIPRI), - XLAT_END -}; +#include "xlat/msgflags.h" static void printstrbuf(struct tcb *tcp, struct strbuf *sbp, int getting) @@ -153,18 +150,7 @@ sys_getmsg(struct tcb *tcp) } # if defined SYS_putpmsg || defined SYS_getpmsg -static const struct xlat pmsgflags[] = { -# ifdef MSG_HIPRI - XLAT(MSG_HIPRI), -# endif -# ifdef MSG_AND - XLAT(MSG_ANY), -# endif -# ifdef MSG_BAND - XLAT(MSG_BAND), -# endif - XLAT_END -}; +#include "xlat/pmsgflags.h" # ifdef SYS_putpmsg int sys_putpmsg(struct tcb *tcp) @@ -242,29 +228,7 @@ sys_getpmsg(struct tcb *tcp) #ifdef HAVE_SYS_POLL_H -static const struct xlat pollflags[] = { -# ifdef POLLIN - XLAT(POLLIN), - XLAT(POLLPRI), - XLAT(POLLOUT), -# ifdef POLLRDNORM - XLAT(POLLRDNORM), -# endif -# ifdef POLLWRNORM - XLAT(POLLWRNORM), -# endif -# ifdef POLLRDBAND - XLAT(POLLRDBAND), -# endif -# ifdef POLLWRBAND - XLAT(POLLWRBAND), -# endif - XLAT(POLLERR), - XLAT(POLLHUP), - XLAT(POLLNVAL), -# endif - XLAT_END -}; +#include "xlat/pollflags.h" static int decode_poll(struct tcb *tcp, long pts) diff --git a/system.c b/system.c index 604988b5..20a9de21 100644 --- a/system.c +++ b/system.c @@ -81,36 +81,7 @@ #include #include -static const struct xlat mount_flags[] = { - XLAT(MS_MGC_VAL), - XLAT(MS_RDONLY), - XLAT(MS_NOSUID), - XLAT(MS_NODEV), - XLAT(MS_NOEXEC), - XLAT(MS_SYNCHRONOUS), - XLAT(MS_REMOUNT), - XLAT(MS_RELATIME), - XLAT(MS_KERNMOUNT), - XLAT(MS_I_VERSION), - XLAT(MS_STRICTATIME), - XLAT(MS_NOSEC), - XLAT(MS_BORN), - XLAT(MS_MANDLOCK), - XLAT(MS_NOATIME), - XLAT(MS_NODIRATIME), - XLAT(MS_BIND), - XLAT(MS_MOVE), - XLAT(MS_REC), - XLAT(MS_SILENT), - XLAT(MS_POSIXACL), - XLAT(MS_UNBINDABLE), - XLAT(MS_PRIVATE), - XLAT(MS_SLAVE), - XLAT(MS_SHARED), - XLAT(MS_ACTIVE), - XLAT(MS_NOUSER), - XLAT_END -}; +#include "xlat/mount_flags.h" int sys_mount(struct tcb *tcp) @@ -155,12 +126,7 @@ sys_mount(struct tcb *tcp) #define MNT_DETACH 0x00000002 /* Just detach from the tree */ #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ -static const struct xlat umount_flags[] = { - XLAT(MNT_FORCE), - XLAT(MNT_DETACH), - XLAT(MNT_EXPIRE), - XLAT_END -}; +#include "xlat/umount_flags.h" int sys_umount2(struct tcb *tcp) @@ -175,31 +141,7 @@ sys_umount2(struct tcb *tcp) /* These are not macros, but enums. We just copy the values by hand from Linux 2.6.9 here. */ -static const struct xlat personality_options[] = { - XLAT(PER_LINUX), - XLAT(PER_LINUX_32BIT), - XLAT(PER_LINUX_FDPIC), - XLAT(PER_SVR4), - XLAT(PER_SVR3), - XLAT(PER_SCOSVR3), - XLAT(PER_OSR5), - XLAT(PER_WYSEV386), - XLAT(PER_ISCR4), - XLAT(PER_BSD), - XLAT(PER_SUNOS), - XLAT(PER_XENIX), - XLAT(PER_LINUX32), - XLAT(PER_LINUX32_3GB), - XLAT(PER_IRIX32), - XLAT(PER_IRIXN32), - XLAT(PER_IRIX64), - XLAT(PER_RISCOS), - XLAT(PER_SOLARIS), - XLAT(PER_UW7), - XLAT(PER_OSF4), - XLAT(PER_HPUX), - XLAT_END -}; +#include "xlat/personality_options.h" int sys_personality(struct tcb *tcp) @@ -223,20 +165,7 @@ enum { SYSLOG_ACTION_SIZE_BUFFER }; -static const struct xlat syslog_action_type[] = { - XLAT(SYSLOG_ACTION_CLOSE), - XLAT(SYSLOG_ACTION_OPEN), - XLAT(SYSLOG_ACTION_READ), - XLAT(SYSLOG_ACTION_READ_ALL), - XLAT(SYSLOG_ACTION_READ_CLEAR), - XLAT(SYSLOG_ACTION_CLEAR), - XLAT(SYSLOG_ACTION_CONSOLE_OFF), - XLAT(SYSLOG_ACTION_CONSOLE_ON), - XLAT(SYSLOG_ACTION_CONSOLE_LEVEL), - XLAT(SYSLOG_ACTION_SIZE_UNREAD), - XLAT(SYSLOG_ACTION_SIZE_BUFFER), - XLAT_END -}; +#include "xlat/syslog_action_type.h" int sys_syslog(struct tcb *tcp) @@ -276,18 +205,7 @@ sys_syslog(struct tcb *tcp) } #ifdef M68K -static const struct xlat cacheflush_scope[] = { -#ifdef FLUSH_SCOPE_LINE - XLAT(FLUSH_SCOPE_LINE), -#endif -#ifdef FLUSH_SCOPE_PAGE - XLAT(FLUSH_SCOPE_PAGE), -#endif -#ifdef FLUSH_SCOPE_ALL - XLAT(FLUSH_SCOPE_ALL), -#endif - XLAT_END -}; +#include "xlat/cacheflush_scope.h" static const struct xlat cacheflush_flags[] = { #ifdef FLUSH_CACHE_BOTH @@ -324,14 +242,7 @@ sys_cacheflush(struct tcb *tcp) #include -static const struct xlat sram_alloc_flags[] = { - XLAT(L1_INST_SRAM), - XLAT(L1_DATA_A_SRAM), - XLAT(L1_DATA_B_SRAM), - XLAT(L1_DATA_SRAM), - XLAT(L2_SRAM), - XLAT_END -}; +#include "xlat/sram_alloc_flags.h" int sys_sram_alloc(struct tcb *tcp) @@ -404,51 +315,7 @@ sys_cacheflush(struct tcb *tcp) #ifdef SYS_capget -static const struct xlat capabilities[] = { - { 1< #endif -static const struct xlat tcxonc_options[] = { - XLAT(TCOOFF), - XLAT(TCOON), - XLAT(TCIOFF), - XLAT(TCION), - XLAT_END -}; +#include "xlat/tcxonc_options.h" #ifdef TCLFLSH -static const struct xlat tcflsh_options[] = { - XLAT(TCIFLUSH), - XLAT(TCOFLUSH), - XLAT(TCIOFLUSH), - XLAT_END -}; +#include "xlat/tcflsh_options.h" #endif -static const struct xlat baud_options[] = { - XLAT(B0), - XLAT(B50), - XLAT(B75), - XLAT(B110), - XLAT(B134), - XLAT(B150), - XLAT(B200), - XLAT(B300), - XLAT(B600), - XLAT(B1200), - XLAT(B1800), - XLAT(B2400), - XLAT(B4800), - XLAT(B9600), -#ifdef B19200 - XLAT(B19200), -#endif -#ifdef B38400 - XLAT(B38400), -#endif -#ifdef B57600 - XLAT(B57600), -#endif -#ifdef B115200 - XLAT(B115200), -#endif -#ifdef B230400 - XLAT(B230400), -#endif -#ifdef B460800 - XLAT(B460800), -#endif -#ifdef B500000 - XLAT(B500000), -#endif -#ifdef B576000 - XLAT(B576000), -#endif -#ifdef B921600 - XLAT(B921600), -#endif -#ifdef B1000000 - XLAT(B1000000), -#endif -#ifdef B1152000 - XLAT(B1152000), -#endif -#ifdef B1500000 - XLAT(B1500000), -#endif -#ifdef B2000000 - XLAT(B2000000), -#endif -#ifdef B2500000 - XLAT(B2500000), -#endif -#ifdef B3000000 - XLAT(B3000000), -#endif -#ifdef B3500000 - XLAT(B3500000), -#endif -#ifdef B4000000 - XLAT(B4000000), -#endif -#ifdef EXTA - XLAT(EXTA), -#endif -#ifdef EXTB - XLAT(EXTB), -#endif - XLAT_END -}; +#include "xlat/baud_options.h" -static const struct xlat modem_flags[] = { -#ifdef TIOCM_LE - XLAT(TIOCM_LE), -#endif -#ifdef TIOCM_DTR - XLAT(TIOCM_DTR), -#endif -#ifdef TIOCM_RTS - XLAT(TIOCM_RTS), -#endif -#ifdef TIOCM_ST - XLAT(TIOCM_ST), -#endif -#ifdef TIOCM_SR - XLAT(TIOCM_SR), -#endif -#ifdef TIOCM_CTS - XLAT(TIOCM_CTS), -#endif -#ifdef TIOCM_CAR - XLAT(TIOCM_CAR), -#endif -#ifdef TIOCM_CD - XLAT(TIOCM_CD), -#endif -#ifdef TIOCM_RNG - XLAT(TIOCM_RNG), -#endif -#ifdef TIOCM_RI - XLAT(TIOCM_RI), -#endif -#ifdef TIOCM_DSR - XLAT(TIOCM_DSR), -#endif - XLAT_END -}; +#include "xlat/modem_flags.h" int term_ioctl(struct tcb *tcp, long code, long arg) { diff --git a/time.c b/time.c index 3909d519..f4383c47 100644 --- a/time.c +++ b/time.c @@ -279,12 +279,7 @@ sys_nanosleep(struct tcb *tcp) return 0; } -static const struct xlat itimer_which[] = { - XLAT(ITIMER_REAL), - XLAT(ITIMER_VIRTUAL), - XLAT(ITIMER_PROF), - XLAT_END -}; +#include "xlat/itimer_which.h" static void printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness) @@ -402,123 +397,11 @@ sys_osf_setitimer(struct tcb *tcp) } #endif -static const struct xlat adjtimex_modes[] = { - XLAT(0), -#ifdef ADJ_OFFSET - XLAT(ADJ_OFFSET), -#endif -#ifdef ADJ_FREQUENCY - XLAT(ADJ_FREQUENCY), -#endif -#ifdef ADJ_MAXERROR - XLAT(ADJ_MAXERROR), -#endif -#ifdef ADJ_ESTERROR - XLAT(ADJ_ESTERROR), -#endif -#ifdef ADJ_STATUS - XLAT(ADJ_STATUS), -#endif -#ifdef ADJ_TIMECONST - XLAT(ADJ_TIMECONST), -#endif -#ifdef ADJ_TAI - XLAT(ADJ_TAI), -#endif -#ifdef ADJ_SETOFFSET - XLAT(ADJ_SETOFFSET), -#endif -#ifdef ADJ_MICRO - XLAT(ADJ_MICRO), -#endif -#ifdef ADJ_NANO - XLAT(ADJ_NANO), -#endif -#ifdef ADJ_TICK - XLAT(ADJ_TICK), -#endif -#ifdef ADJ_OFFSET_SINGLESHOT - XLAT(ADJ_OFFSET_SINGLESHOT), -#endif -#ifdef ADJ_OFFSET_SS_READ - XLAT(ADJ_OFFSET_SS_READ), -#endif - XLAT_END -}; +#include "xlat/adjtimex_modes.h" -static const struct xlat adjtimex_status[] = { -#ifdef STA_PLL - XLAT(STA_PLL), -#endif -#ifdef STA_PPSFREQ - XLAT(STA_PPSFREQ), -#endif -#ifdef STA_PPSTIME - XLAT(STA_PPSTIME), -#endif -#ifdef STA_FLL - XLAT(STA_FLL), -#endif -#ifdef STA_INS - XLAT(STA_INS), -#endif -#ifdef STA_DEL - XLAT(STA_DEL), -#endif -#ifdef STA_UNSYNC - XLAT(STA_UNSYNC), -#endif -#ifdef STA_FREQHOLD - XLAT(STA_FREQHOLD), -#endif -#ifdef STA_PPSSIGNAL - XLAT(STA_PPSSIGNAL), -#endif -#ifdef STA_PPSJITTER - XLAT(STA_PPSJITTER), -#endif -#ifdef STA_PPSWANDER - XLAT(STA_PPSWANDER), -#endif -#ifdef STA_PPSERROR - XLAT(STA_PPSERROR), -#endif -#ifdef STA_CLOCKERR - XLAT(STA_CLOCKERR), -#endif -#ifdef STA_NANO - XLAT(STA_NANO), -#endif -#ifdef STA_MODE - XLAT(STA_MODE), -#endif -#ifdef STA_CLK - XLAT(STA_CLK), -#endif - XLAT_END -}; +#include "xlat/adjtimex_status.h" -static const struct xlat adjtimex_state[] = { -#ifdef TIME_OK - XLAT(TIME_OK), -#endif -#ifdef TIME_INS - XLAT(TIME_INS), -#endif -#ifdef TIME_DEL - XLAT(TIME_DEL), -#endif -#ifdef TIME_OOP - XLAT(TIME_OOP), -#endif -#ifdef TIME_WAIT - XLAT(TIME_WAIT), -#endif -#ifdef TIME_ERROR - XLAT(TIME_ERROR), -#endif - XLAT_END -}; +#include "xlat/adjtimex_state.h" #if SUPPORTED_PERSONALITIES > 1 static int @@ -638,58 +521,12 @@ sys_adjtimex(struct tcb *tcp) return 0; } -static const struct xlat clockflags[] = { - XLAT(TIMER_ABSTIME), - XLAT_END -}; +#include "xlat/clockflags.h" -static const struct xlat clocknames[] = { -#ifdef CLOCK_REALTIME - XLAT(CLOCK_REALTIME), -#endif -#ifdef CLOCK_MONOTONIC - XLAT(CLOCK_MONOTONIC), -#endif -#ifdef CLOCK_PROCESS_CPUTIME_ID - XLAT(CLOCK_PROCESS_CPUTIME_ID), -#endif -#ifdef CLOCK_THREAD_CPUTIME_ID - XLAT(CLOCK_THREAD_CPUTIME_ID), -#endif -#ifdef CLOCK_MONOTONIC_RAW - XLAT(CLOCK_MONOTONIC_RAW), -#endif -#ifdef CLOCK_REALTIME_COARSE - XLAT(CLOCK_REALTIME_COARSE), -#endif -#ifdef CLOCK_MONOTONIC_COARSE - XLAT(CLOCK_MONOTONIC_COARSE), -#endif -#ifdef CLOCK_BOOTTIME - XLAT(CLOCK_BOOTTIME), -#endif -#ifdef CLOCK_REALTIME_ALARM - XLAT(CLOCK_REALTIME_ALARM), -#endif -#ifdef CLOCK_BOOTTIME_ALARM - XLAT(CLOCK_BOOTTIME_ALARM), -#endif -#ifdef CLOCK_SGI_CYCLE - XLAT(CLOCK_SGI_CYCLE), -#endif -#ifdef CLOCK_TAI - XLAT(CLOCK_TAI), -#endif - XLAT_END -}; +#include "xlat/clocknames.h" #ifdef CLOCKID_TO_FD -static const struct xlat cpuclocknames[] = { - XLAT(CPUCLOCK_PROF), - XLAT(CPUCLOCK_VIRT), - XLAT(CPUCLOCK_SCHED), - XLAT_END -}; +#include "xlat/cpuclocknames.h" #endif static void @@ -771,13 +608,7 @@ sys_clock_adjtime(struct tcb *tcp) #ifndef SIGEV_THREAD_ID # define SIGEV_THREAD_ID 4 #endif -static const struct xlat sigev_value[] = { - XLAT(SIGEV_SIGNAL), - XLAT(SIGEV_NONE), - XLAT(SIGEV_THREAD), - XLAT(SIGEV_THREAD_ID), - XLAT_END -}; +#include "xlat/sigev_value.h" #if SUPPORTED_PERSONALITIES > 1 static void @@ -1002,10 +833,7 @@ rtc_ioctl(struct tcb *tcp, long code, long arg) #define TFD_TIMER_ABSTIME (1 << 0) #endif -static const struct xlat timerfdflags[] = { - XLAT(TFD_TIMER_ABSTIME), - XLAT_END -}; +#include "xlat/timerfdflags.h" int sys_timerfd(struct tcb *tcp) diff --git a/xlat/access_flags.in b/xlat/access_flags.in new file mode 100644 index 00000000..cc46ad51 --- /dev/null +++ b/xlat/access_flags.in @@ -0,0 +1,6 @@ +F_OK +R_OK +W_OK +X_OK +EFF_ONLY_OK +EX_OK diff --git a/xlat/aclcmds.in b/xlat/aclcmds.in new file mode 100644 index 00000000..87559c64 --- /dev/null +++ b/xlat/aclcmds.in @@ -0,0 +1,6 @@ +SETACL +GETACL +GETACLCNT +ACL_GET +ACL_SET +ACL_CNT diff --git a/xlat/aclipc.in b/xlat/aclipc.in new file mode 100644 index 00000000..fd4d61c0 --- /dev/null +++ b/xlat/aclipc.in @@ -0,0 +1,3 @@ +IPC_SHM +IPC_SEM +IPC_MSG diff --git a/xlat/addrfams.in b/xlat/addrfams.in new file mode 100644 index 00000000..a8695742 --- /dev/null +++ b/xlat/addrfams.in @@ -0,0 +1,41 @@ +AF_UNSPEC +AF_LOCAL +AF_UNIX +AF_INET +AF_AX25 +AF_IPX +AF_APPLETALK +AF_NETROM +AF_BRIDGE +AF_ATMPVC +AF_X25 +AF_INET6 +AF_ROSE +AF_DECnet +AF_NETBEUI +AF_SECURITY +AF_KEY +AF_NETLINK +AF_ROUTE +AF_PACKET +AF_ASH +AF_ECONET +AF_ATMSVC +AF_RDS +AF_SNA +AF_IRDA +AF_PPPOX +AF_WANPIPE +AF_LLC +AF_CAN +AF_TIPC +AF_BLUETOOTH +AF_IUCV +AF_RXRPC +AF_ISDN +AF_PHONET +AF_IEEE802154 +AF_CAIF +AF_ALG +AF_NFC +AF_VSOCK diff --git a/xlat/adjtimex_modes.in b/xlat/adjtimex_modes.in new file mode 100644 index 00000000..e2ca6809 --- /dev/null +++ b/xlat/adjtimex_modes.in @@ -0,0 +1,14 @@ +0 +ADJ_OFFSET +ADJ_FREQUENCY +ADJ_MAXERROR +ADJ_ESTERROR +ADJ_STATUS +ADJ_TIMECONST +ADJ_TAI +ADJ_SETOFFSET +ADJ_MICRO +ADJ_NANO +ADJ_TICK +ADJ_OFFSET_SINGLESHOT +ADJ_OFFSET_SS_READ diff --git a/xlat/adjtimex_state.in b/xlat/adjtimex_state.in new file mode 100644 index 00000000..873b9a1e --- /dev/null +++ b/xlat/adjtimex_state.in @@ -0,0 +1,6 @@ +TIME_OK +TIME_INS +TIME_DEL +TIME_OOP +TIME_WAIT +TIME_ERROR diff --git a/xlat/adjtimex_status.in b/xlat/adjtimex_status.in new file mode 100644 index 00000000..c6b62641 --- /dev/null +++ b/xlat/adjtimex_status.in @@ -0,0 +1,16 @@ +STA_PLL +STA_PPSFREQ +STA_PPSTIME +STA_FLL +STA_INS +STA_DEL +STA_UNSYNC +STA_FREQHOLD +STA_PPSSIGNAL +STA_PPSJITTER +STA_PPSWANDER +STA_PPSERROR +STA_CLOCKERR +STA_NANO +STA_MODE +STA_CLK diff --git a/xlat/advise.in b/xlat/advise.in new file mode 100644 index 00000000..47540e08 --- /dev/null +++ b/xlat/advise.in @@ -0,0 +1,6 @@ +POSIX_FADV_NORMAL +POSIX_FADV_RANDOM +POSIX_FADV_SEQUENTIAL +POSIX_FADV_WILLNEED +POSIX_FADV_DONTNEED +POSIX_FADV_NOREUSE diff --git a/xlat/af_packet_types.in b/xlat/af_packet_types.in new file mode 100644 index 00000000..18cf6558 --- /dev/null +++ b/xlat/af_packet_types.in @@ -0,0 +1,7 @@ +PACKET_HOST +PACKET_BROADCAST +PACKET_MULTICAST +PACKET_OTHERHOST +PACKET_OUTGOING +PACKET_LOOPBACK +PACKET_FASTROUTE diff --git a/xlat/archvals.in b/xlat/archvals.in new file mode 100644 index 00000000..22ad7c1b --- /dev/null +++ b/xlat/archvals.in @@ -0,0 +1,4 @@ +ARCH_SET_GS +ARCH_SET_FS +ARCH_GET_FS +ARCH_GET_GS diff --git a/xlat/at_flags.in b/xlat/at_flags.in new file mode 100644 index 00000000..1a790d59 --- /dev/null +++ b/xlat/at_flags.in @@ -0,0 +1,5 @@ +AT_SYMLINK_NOFOLLOW +AT_REMOVEDIR +AT_SYMLINK_FOLLOW +AT_NO_AUTOMOUNT +AT_EMPTY_PATH diff --git a/xlat/atomic_ops.in b/xlat/atomic_ops.in new file mode 100644 index 00000000..42261ea5 --- /dev/null +++ b/xlat/atomic_ops.in @@ -0,0 +1,9 @@ + { OR1K_ATOMIC_SWAP, "SWAP" }, + { OR1K_ATOMIC_CMPXCHG, "CMPXCHG" }, + { OR1K_ATOMIC_XCHG, "XCHG" }, + { OR1K_ATOMIC_ADD, "ADD" }, + { OR1K_ATOMIC_DECPOS, "DECPOS" }, + { OR1K_ATOMIC_AND, "AND" }, + { OR1K_ATOMIC_OR, "OR" }, + { OR1K_ATOMIC_UMAX, "UMAX" }, + { OR1K_ATOMIC_UMIN, "UMIN" }, diff --git a/xlat/baud_options.in b/xlat/baud_options.in new file mode 100644 index 00000000..be7311ab --- /dev/null +++ b/xlat/baud_options.in @@ -0,0 +1,33 @@ +B0 +B50 +B75 +B110 +B134 +B150 +B200 +B300 +B600 +B1200 +B1800 +B2400 +B4800 +B9600 +B19200 +B38400 +B57600 +B115200 +B230400 +B460800 +B500000 +B576000 +B921600 +B1000000 +B1152000 +B1500000 +B2000000 +B2500000 +B3000000 +B3500000 +B4000000 +EXTA +EXTB diff --git a/xlat/blkpg_ops.in b/xlat/blkpg_ops.in new file mode 100644 index 00000000..75f6f70d --- /dev/null +++ b/xlat/blkpg_ops.in @@ -0,0 +1,2 @@ +BLKPG_ADD_PARTITION +BLKPG_DEL_PARTITION diff --git a/xlat/bootflags1.in b/xlat/bootflags1.in new file mode 100644 index 00000000..d2b5f9f6 --- /dev/null +++ b/xlat/bootflags1.in @@ -0,0 +1 @@ +LINUX_REBOOT_MAGIC1 diff --git a/xlat/bootflags2.in b/xlat/bootflags2.in new file mode 100644 index 00000000..56ad023d --- /dev/null +++ b/xlat/bootflags2.in @@ -0,0 +1,4 @@ +LINUX_REBOOT_MAGIC2 +LINUX_REBOOT_MAGIC2A +LINUX_REBOOT_MAGIC2B +LINUX_REBOOT_MAGIC2C diff --git a/xlat/bootflags3.in b/xlat/bootflags3.in new file mode 100644 index 00000000..d13ab87d --- /dev/null +++ b/xlat/bootflags3.in @@ -0,0 +1,8 @@ +LINUX_REBOOT_CMD_RESTART +LINUX_REBOOT_CMD_HALT +LINUX_REBOOT_CMD_CAD_ON +LINUX_REBOOT_CMD_CAD_OFF +LINUX_REBOOT_CMD_POWER_OFF +LINUX_REBOOT_CMD_RESTART2 +LINUX_REBOOT_CMD_SW_SUSPEND +LINUX_REBOOT_CMD_KEXEC diff --git a/xlat/cacheflush_scope.in b/xlat/cacheflush_scope.in new file mode 100644 index 00000000..5f91b907 --- /dev/null +++ b/xlat/cacheflush_scope.in @@ -0,0 +1,3 @@ +FLUSH_SCOPE_LINE +FLUSH_SCOPE_PAGE +FLUSH_SCOPE_ALL diff --git a/xlat/cap_version.in b/xlat/cap_version.in new file mode 100644 index 00000000..70d6caee --- /dev/null +++ b/xlat/cap_version.in @@ -0,0 +1,3 @@ +_LINUX_CAPABILITY_VERSION_1 +_LINUX_CAPABILITY_VERSION_2 +_LINUX_CAPABILITY_VERSION_3 diff --git a/xlat/capabilities.in b/xlat/capabilities.in new file mode 100644 index 00000000..59f24f74 --- /dev/null +++ b/xlat/capabilities.in @@ -0,0 +1,32 @@ +1<