linux.h (245849) | linux.h (246085) |
---|---|
1/*- 2 * Copyright (c) 2004 Tim J. Robbins 3 * Copyright (c) 2001 Doug Rabson 4 * Copyright (c) 1994-1996 S��ren Schmidt 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/*- 2 * Copyright (c) 2004 Tim J. Robbins 3 * Copyright (c) 2001 Doug Rabson 4 * Copyright (c) 1994-1996 S��ren Schmidt 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/amd64/linux32/linux.h 245849 2013-01-23 21:44:48Z jhb $ | 30 * $FreeBSD: head/sys/amd64/linux32/linux.h 246085 2013-01-29 18:41:30Z jhb $ |
31 */ 32 33#ifndef _AMD64_LINUX_H_ 34#define _AMD64_LINUX_H_ 35 36#include <amd64/linux32/linux32_syscall.h> 37 38/* --- 63 unchanged lines hidden (view full) --- 102 l_suseconds_t tv_usec; 103} l_timeval; 104 105#define l_fd_set fd_set 106 107/* 108 * Miscellaneous 109 */ | 31 */ 32 33#ifndef _AMD64_LINUX_H_ 34#define _AMD64_LINUX_H_ 35 36#include <amd64/linux32/linux32_syscall.h> 37 38/* --- 63 unchanged lines hidden (view full) --- 102 l_suseconds_t tv_usec; 103} l_timeval; 104 105#define l_fd_set fd_set 106 107/* 108 * Miscellaneous 109 */ |
110#define LINUX_NAME_MAX 255 111#define LINUX_MAX_UTSNAME 65 112 113#define LINUX_CTL_MAXNAME 10 114 | |
115#define LINUX_AT_COUNT 16 /* Count of used aux entry types. 116 * Keep this synchronized with 117 * elf_linux_fixup() code. 118 */ 119struct l___sysctl_args 120{ 121 l_uintptr_t name; 122 l_int nlen; 123 l_uintptr_t oldval; 124 l_uintptr_t oldlenp; 125 l_uintptr_t newval; 126 l_size_t newlen; 127 l_ulong __spare[4]; 128} __packed; 129 | 110#define LINUX_AT_COUNT 16 /* Count of used aux entry types. 111 * Keep this synchronized with 112 * elf_linux_fixup() code. 113 */ 114struct l___sysctl_args 115{ 116 l_uintptr_t name; 117 l_int nlen; 118 l_uintptr_t oldval; 119 l_uintptr_t oldlenp; 120 l_uintptr_t newval; 121 l_size_t newlen; 122 l_ulong __spare[4]; 123} __packed; 124 |
130/* Scheduling policies */ 131#define LINUX_SCHED_OTHER 0 132#define LINUX_SCHED_FIFO 1 133#define LINUX_SCHED_RR 2 134 | |
135/* Resource limits */ 136#define LINUX_RLIMIT_CPU 0 137#define LINUX_RLIMIT_FSIZE 1 138#define LINUX_RLIMIT_DATA 2 139#define LINUX_RLIMIT_STACK 3 140#define LINUX_RLIMIT_CORE 4 141#define LINUX_RLIMIT_RSS 5 142#define LINUX_RLIMIT_NPROC 6 --- 117 unchanged lines hidden (view full) --- 260 uint64_t f_bavail; 261 uint64_t f_files; 262 uint64_t f_ffree; 263 l_fsid_t f_fsid; 264 l_int f_namelen; 265 l_int f_spare[6]; 266} __packed; 267 | 125/* Resource limits */ 126#define LINUX_RLIMIT_CPU 0 127#define LINUX_RLIMIT_FSIZE 1 128#define LINUX_RLIMIT_DATA 2 129#define LINUX_RLIMIT_STACK 3 130#define LINUX_RLIMIT_CORE 4 131#define LINUX_RLIMIT_RSS 5 132#define LINUX_RLIMIT_NPROC 6 --- 117 unchanged lines hidden (view full) --- 250 uint64_t f_bavail; 251 uint64_t f_files; 252 uint64_t f_ffree; 253 l_fsid_t f_fsid; 254 l_int f_namelen; 255 l_int f_spare[6]; 256} __packed; 257 |
268struct l_new_utsname { 269 char sysname[LINUX_MAX_UTSNAME]; 270 char nodename[LINUX_MAX_UTSNAME]; 271 char release[LINUX_MAX_UTSNAME]; 272 char version[LINUX_MAX_UTSNAME]; 273 char machine[LINUX_MAX_UTSNAME]; 274 char domainname[LINUX_MAX_UTSNAME]; 275} __packed; 276 | |
277/* 278 * Signalling 279 */ 280#define LINUX_SIGHUP 1 281#define LINUX_SIGINT 2 282#define LINUX_SIGQUIT 3 283#define LINUX_SIGILL 4 284#define LINUX_SIGTRAP 5 --- 245 unchanged lines hidden (view full) --- 530 l_int sf_sig; 531 l_uintptr_t sf_siginfo; 532 l_uintptr_t sf_ucontext; 533 l_siginfo_t sf_si; 534 struct l_ucontext sf_sc; 535 l_handler_t sf_handler; 536} __packed; 537 | 258/* 259 * Signalling 260 */ 261#define LINUX_SIGHUP 1 262#define LINUX_SIGINT 2 263#define LINUX_SIGQUIT 3 264#define LINUX_SIGILL 4 265#define LINUX_SIGTRAP 5 --- 245 unchanged lines hidden (view full) --- 511 l_int sf_sig; 512 l_uintptr_t sf_siginfo; 513 l_uintptr_t sf_ucontext; 514 l_siginfo_t sf_si; 515 struct l_ucontext sf_sc; 516 l_handler_t sf_handler; 517} __packed; 518 |
538extern int bsd_to_linux_signal[]; 539extern int linux_to_bsd_signal[]; | |
540extern struct sysentvec elf_linux_sysvec; 541 542/* | 519extern struct sysentvec elf_linux_sysvec; 520 521/* |
543 * Pluggable ioctl handlers 544 */ 545struct linux_ioctl_args; 546struct thread; 547 548typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *); 549 550struct linux_ioctl_handler { 551 linux_ioctl_function_t *func; 552 int low, high; 553}; 554 555int linux_ioctl_register_handler(struct linux_ioctl_handler *h); 556int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); 557 558/* | |
559 * open/fcntl flags 560 */ 561#define LINUX_O_RDONLY 00000000 562#define LINUX_O_WRONLY 00000001 563#define LINUX_O_RDWR 00000002 564#define LINUX_O_ACCMODE 00000003 565#define LINUX_O_CREAT 00000100 566#define LINUX_O_EXCL 00000200 --- 25 unchanged lines hidden (view full) --- 592#define LINUX_F_GETLK64 12 593#define LINUX_F_SETLK64 13 594#define LINUX_F_SETLKW64 14 595 596#define LINUX_F_RDLCK 0 597#define LINUX_F_WRLCK 1 598#define LINUX_F_UNLCK 2 599 | 522 * open/fcntl flags 523 */ 524#define LINUX_O_RDONLY 00000000 525#define LINUX_O_WRONLY 00000001 526#define LINUX_O_RDWR 00000002 527#define LINUX_O_ACCMODE 00000003 528#define LINUX_O_CREAT 00000100 529#define LINUX_O_EXCL 00000200 --- 25 unchanged lines hidden (view full) --- 555#define LINUX_F_GETLK64 12 556#define LINUX_F_SETLK64 13 557#define LINUX_F_SETLKW64 14 558 559#define LINUX_F_RDLCK 0 560#define LINUX_F_WRLCK 1 561#define LINUX_F_UNLCK 2 562 |
600/* 601 * posix_fadvise advice 602 */ 603#define LINUX_POSIX_FADV_NORMAL 0 604#define LINUX_POSIX_FADV_RANDOM 1 605#define LINUX_POSIX_FADV_SEQUENTIAL 2 606#define LINUX_POSIX_FADV_WILLNEED 3 607#define LINUX_POSIX_FADV_DONTNEED 4 608#define LINUX_POSIX_FADV_NOREUSE 5 609 610/* 611 * mount flags 612 */ 613#define LINUX_MS_RDONLY 0x0001 614#define LINUX_MS_NOSUID 0x0002 615#define LINUX_MS_NODEV 0x0004 616#define LINUX_MS_NOEXEC 0x0008 617#define LINUX_MS_REMOUNT 0x0020 618 619/* 620 * SystemV IPC defines 621 */ 622#define LINUX_SEMOP 1 623#define LINUX_SEMGET 2 624#define LINUX_SEMCTL 3 625#define LINUX_MSGSND 11 626#define LINUX_MSGRCV 12 627#define LINUX_MSGGET 13 628#define LINUX_MSGCTL 14 629#define LINUX_SHMAT 21 630#define LINUX_SHMDT 22 631#define LINUX_SHMGET 23 632#define LINUX_SHMCTL 24 633 634#define LINUX_IPC_RMID 0 635#define LINUX_IPC_SET 1 636#define LINUX_IPC_STAT 2 637#define LINUX_IPC_INFO 3 638 639#define LINUX_SHM_LOCK 11 640#define LINUX_SHM_UNLOCK 12 641#define LINUX_SHM_STAT 13 642#define LINUX_SHM_INFO 14 643 644#define LINUX_SHM_RDONLY 0x1000 645#define LINUX_SHM_RND 0x2000 646#define LINUX_SHM_REMAP 0x4000 647 648/* semctl commands */ 649#define LINUX_GETPID 11 650#define LINUX_GETVAL 12 651#define LINUX_GETALL 13 652#define LINUX_GETNCNT 14 653#define LINUX_GETZCNT 15 654#define LINUX_SETVAL 16 655#define LINUX_SETALL 17 656#define LINUX_SEM_STAT 18 657#define LINUX_SEM_INFO 19 658 | |
659union l_semun { 660 l_int val; 661 l_uintptr_t buf; 662 l_uintptr_t array; 663 l_uintptr_t __buf; 664 l_uintptr_t __pad; 665} __packed; 666 667/* 668 * Socket defines 669 */ | 563union l_semun { 564 l_int val; 565 l_uintptr_t buf; 566 l_uintptr_t array; 567 l_uintptr_t __buf; 568 l_uintptr_t __pad; 569} __packed; 570 571/* 572 * Socket defines 573 */ |
670#define LINUX_SOCKET 1 671#define LINUX_BIND 2 672#define LINUX_CONNECT 3 673#define LINUX_LISTEN 4 674#define LINUX_ACCEPT 5 675#define LINUX_GETSOCKNAME 6 676#define LINUX_GETPEERNAME 7 677#define LINUX_SOCKETPAIR 8 678#define LINUX_SEND 9 679#define LINUX_RECV 10 680#define LINUX_SENDTO 11 681#define LINUX_RECVFROM 12 682#define LINUX_SHUTDOWN 13 683#define LINUX_SETSOCKOPT 14 684#define LINUX_GETSOCKOPT 15 685#define LINUX_SENDMSG 16 686#define LINUX_RECVMSG 17 687#define LINUX_ACCEPT4 18 688 | |
689#define LINUX_SOL_SOCKET 1 690#define LINUX_SOL_IP 0 691#define LINUX_SOL_IPX 256 692#define LINUX_SOL_AX25 257 693#define LINUX_SOL_TCP 6 694#define LINUX_SOL_UDP 17 695 696#define LINUX_SO_DEBUG 1 --- 12 unchanged lines hidden (view full) --- 709#define LINUX_SO_PEERCRED 17 710#define LINUX_SO_RCVLOWAT 18 711#define LINUX_SO_SNDLOWAT 19 712#define LINUX_SO_RCVTIMEO 20 713#define LINUX_SO_SNDTIMEO 21 714#define LINUX_SO_TIMESTAMP 29 715#define LINUX_SO_ACCEPTCONN 30 716 | 574#define LINUX_SOL_SOCKET 1 575#define LINUX_SOL_IP 0 576#define LINUX_SOL_IPX 256 577#define LINUX_SOL_AX25 257 578#define LINUX_SOL_TCP 6 579#define LINUX_SOL_UDP 17 580 581#define LINUX_SO_DEBUG 1 --- 12 unchanged lines hidden (view full) --- 594#define LINUX_SO_PEERCRED 17 595#define LINUX_SO_RCVLOWAT 18 596#define LINUX_SO_SNDLOWAT 19 597#define LINUX_SO_RCVTIMEO 20 598#define LINUX_SO_SNDTIMEO 21 599#define LINUX_SO_TIMESTAMP 29 600#define LINUX_SO_ACCEPTCONN 30 601 |
717#define LINUX_IP_TOS 1 718#define LINUX_IP_TTL 2 719#define LINUX_IP_HDRINCL 3 720#define LINUX_IP_OPTIONS 4 721 722#define LINUX_IP_MULTICAST_IF 32 723#define LINUX_IP_MULTICAST_TTL 33 724#define LINUX_IP_MULTICAST_LOOP 34 725#define LINUX_IP_ADD_MEMBERSHIP 35 726#define LINUX_IP_DROP_MEMBERSHIP 36 727 728#define LINUX_TCP_NODELAY 1 729#define LINUX_TCP_MAXSEG 2 730#define LINUX_TCP_KEEPIDLE 4 731#define LINUX_TCP_KEEPINTVL 5 732#define LINUX_TCP_KEEPCNT 6 733#define LINUX_TCP_MD5SIG 14 734 | |
735struct l_sockaddr { 736 l_ushort sa_family; 737 char sa_data[14]; 738} __packed; 739 740struct l_msghdr { 741 l_uintptr_t msg_name; 742 l_int msg_namelen; --- 149 unchanged lines hidden (view full) --- 892 (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1) 893#define LINUX_GET_LIMIT_PAGES(desc) \ 894 (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1) 895#define LINUX_GET_PRESENT(desc) \ 896 (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1) 897#define LINUX_GET_USEABLE(desc) \ 898 (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) 899 | 602struct l_sockaddr { 603 l_ushort sa_family; 604 char sa_data[14]; 605} __packed; 606 607struct l_msghdr { 608 l_uintptr_t msg_name; 609 l_int msg_namelen; --- 149 unchanged lines hidden (view full) --- 759 (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1) 760#define LINUX_GET_LIMIT_PAGES(desc) \ 761 (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1) 762#define LINUX_GET_PRESENT(desc) \ 763 (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1) 764#define LINUX_GET_USEABLE(desc) \ 765 (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) 766 |
900#define LINUX_CLOCK_REALTIME 0 901#define LINUX_CLOCK_MONOTONIC 1 902#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 903#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 904#define LINUX_CLOCK_REALTIME_HR 4 905#define LINUX_CLOCK_MONOTONIC_HR 5 906 907#define LINUX_CLONE_VM 0x00000100 908#define LINUX_CLONE_FS 0x00000200 909#define LINUX_CLONE_FILES 0x00000400 910#define LINUX_CLONE_SIGHAND 0x00000800 911#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ 912#define LINUX_CLONE_VFORK 0x00004000 913#define LINUX_CLONE_PARENT 0x00008000 914#define LINUX_CLONE_THREAD 0x00010000 915#define LINUX_CLONE_SETTLS 0x00080000 916#define LINUX_CLONE_PARENT_SETTID 0x00100000 917#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 918#define LINUX_CLONE_CHILD_SETTID 0x01000000 919 920#define LINUX_THREADING_FLAGS \ 921 (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ 922 LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) 923 | |
924struct iovec; 925 926struct l_iovec32 { 927 uint32_t iov_base; 928 l_size_t iov_len; 929}; 930 931int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, --- 5 unchanged lines hidden (view full) --- 937}; 938 939struct linux_robust_list_head { 940 struct linux_robust_list list; 941 l_long futex_offset; 942 l_uintptr_t pending_list; 943}; 944 | 767struct iovec; 768 769struct l_iovec32 { 770 uint32_t iov_base; 771 l_size_t iov_len; 772}; 773 774int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, --- 5 unchanged lines hidden (view full) --- 780}; 781 782struct linux_robust_list_head { 783 struct linux_robust_list list; 784 l_long futex_offset; 785 l_uintptr_t pending_list; 786}; 787 |
945int linux_set_upcall_kse(struct thread *td, register_t stack); 946int linux_set_cloned_tls(struct thread *td, void *desc); 947 | |
948#endif /* !_AMD64_LINUX_H_ */ | 788#endif /* !_AMD64_LINUX_H_ */ |