linux.h (245849) | linux.h (246085) |
---|---|
1/*- 2 * Copyright (c) 1994-1996 S��ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1994-1996 S��ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/i386/linux/linux.h 245849 2013-01-23 21:44:48Z jhb $ | 28 * $FreeBSD: head/sys/i386/linux/linux.h 246085 2013-01-29 18:41:30Z jhb $ |
29 */ 30 31#ifndef _I386_LINUX_H_ 32#define _I386_LINUX_H_ 33 34#include <sys/signal.h> /* for sigval union */ 35 36#include <i386/linux/linux_syscall.h> --- 59 unchanged lines hidden (view full) --- 96 l_suseconds_t tv_usec; 97} l_timeval; 98 99#define l_fd_set fd_set 100 101/* 102 * Miscellaneous 103 */ | 29 */ 30 31#ifndef _I386_LINUX_H_ 32#define _I386_LINUX_H_ 33 34#include <sys/signal.h> /* for sigval union */ 35 36#include <i386/linux/linux_syscall.h> --- 59 unchanged lines hidden (view full) --- 96 l_suseconds_t tv_usec; 97} l_timeval; 98 99#define l_fd_set fd_set 100 101/* 102 * Miscellaneous 103 */ |
104#define LINUX_NAME_MAX 255 105#define LINUX_MAX_UTSNAME 65 106 107#define LINUX_CTL_MAXNAME 10 108 | |
109#define LINUX_AT_COUNT 16 /* Count of used aux entry types. 110 * Keep this synchronized with 111 * elf_linux_fixup() code. 112 */ 113struct l___sysctl_args 114{ 115 l_int *name; 116 l_int nlen; 117 void *oldval; 118 l_size_t *oldlenp; 119 void *newval; 120 l_size_t newlen; 121 l_ulong __spare[4]; 122}; 123 | 104#define LINUX_AT_COUNT 16 /* Count of used aux entry types. 105 * Keep this synchronized with 106 * elf_linux_fixup() code. 107 */ 108struct l___sysctl_args 109{ 110 l_int *name; 111 l_int nlen; 112 void *oldval; 113 l_size_t *oldlenp; 114 void *newval; 115 l_size_t newlen; 116 l_ulong __spare[4]; 117}; 118 |
124/* Scheduling policies */ 125#define LINUX_SCHED_OTHER 0 126#define LINUX_SCHED_FIFO 1 127#define LINUX_SCHED_RR 2 128 | |
129/* Resource limits */ 130#define LINUX_RLIMIT_CPU 0 131#define LINUX_RLIMIT_FSIZE 1 132#define LINUX_RLIMIT_DATA 2 133#define LINUX_RLIMIT_STACK 3 134#define LINUX_RLIMIT_CORE 4 135#define LINUX_RLIMIT_RSS 5 136#define LINUX_RLIMIT_NPROC 6 --- 98 unchanged lines hidden (view full) --- 235 uint64_t f_bavail; 236 uint64_t f_files; 237 uint64_t f_ffree; 238 l_fsid_t f_fsid; 239 l_int f_namelen; 240 l_int f_spare[6]; 241}; 242 | 119/* Resource limits */ 120#define LINUX_RLIMIT_CPU 0 121#define LINUX_RLIMIT_FSIZE 1 122#define LINUX_RLIMIT_DATA 2 123#define LINUX_RLIMIT_STACK 3 124#define LINUX_RLIMIT_CORE 4 125#define LINUX_RLIMIT_RSS 5 126#define LINUX_RLIMIT_NPROC 6 --- 98 unchanged lines hidden (view full) --- 225 uint64_t f_bavail; 226 uint64_t f_files; 227 uint64_t f_ffree; 228 l_fsid_t f_fsid; 229 l_int f_namelen; 230 l_int f_spare[6]; 231}; 232 |
243struct l_new_utsname { 244 char sysname[LINUX_MAX_UTSNAME]; 245 char nodename[LINUX_MAX_UTSNAME]; 246 char release[LINUX_MAX_UTSNAME]; 247 char version[LINUX_MAX_UTSNAME]; 248 char machine[LINUX_MAX_UTSNAME]; 249 char domainname[LINUX_MAX_UTSNAME]; 250}; 251 | |
252/* 253 * Signalling 254 */ 255#define LINUX_SIGHUP 1 256#define LINUX_SIGINT 2 257#define LINUX_SIGQUIT 3 258#define LINUX_SIGILL 4 259#define LINUX_SIGTRAP 5 --- 245 unchanged lines hidden (view full) --- 505 l_int sf_sig; 506 l_siginfo_t *sf_siginfo; 507 struct l_ucontext *sf_ucontext; 508 l_siginfo_t sf_si; 509 struct l_ucontext sf_sc; 510 l_handler_t sf_handler; 511}; 512 | 233/* 234 * Signalling 235 */ 236#define LINUX_SIGHUP 1 237#define LINUX_SIGINT 2 238#define LINUX_SIGQUIT 3 239#define LINUX_SIGILL 4 240#define LINUX_SIGTRAP 5 --- 245 unchanged lines hidden (view full) --- 486 l_int sf_sig; 487 l_siginfo_t *sf_siginfo; 488 struct l_ucontext *sf_ucontext; 489 l_siginfo_t sf_si; 490 struct l_ucontext sf_sc; 491 l_handler_t sf_handler; 492}; 493 |
513extern int bsd_to_linux_signal[]; 514extern int linux_to_bsd_signal[]; | |
515extern struct sysentvec linux_sysvec; 516extern struct sysentvec elf_linux_sysvec; 517 518/* | 494extern struct sysentvec linux_sysvec; 495extern struct sysentvec elf_linux_sysvec; 496 497/* |
519 * Pluggable ioctl handlers 520 */ 521struct linux_ioctl_args; 522struct thread; 523 524typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *); 525 526struct linux_ioctl_handler { 527 linux_ioctl_function_t *func; 528 int low, high; 529}; 530 531int linux_ioctl_register_handler(struct linux_ioctl_handler *h); 532int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); 533 534/* | |
535 * open/fcntl flags 536 */ 537#define LINUX_O_RDONLY 00000000 538#define LINUX_O_WRONLY 00000001 539#define LINUX_O_RDWR 00000002 540#define LINUX_O_ACCMODE 00000003 541#define LINUX_O_CREAT 00000100 542#define LINUX_O_EXCL 00000200 --- 25 unchanged lines hidden (view full) --- 568#define LINUX_F_GETLK64 12 569#define LINUX_F_SETLK64 13 570#define LINUX_F_SETLKW64 14 571 572#define LINUX_F_RDLCK 0 573#define LINUX_F_WRLCK 1 574#define LINUX_F_UNLCK 2 575 | 498 * open/fcntl flags 499 */ 500#define LINUX_O_RDONLY 00000000 501#define LINUX_O_WRONLY 00000001 502#define LINUX_O_RDWR 00000002 503#define LINUX_O_ACCMODE 00000003 504#define LINUX_O_CREAT 00000100 505#define LINUX_O_EXCL 00000200 --- 25 unchanged lines hidden (view full) --- 531#define LINUX_F_GETLK64 12 532#define LINUX_F_SETLK64 13 533#define LINUX_F_SETLKW64 14 534 535#define LINUX_F_RDLCK 0 536#define LINUX_F_WRLCK 1 537#define LINUX_F_UNLCK 2 538 |
576/* 577 * posix_fadvise advice 578 */ 579#define LINUX_POSIX_FADV_NORMAL 0 580#define LINUX_POSIX_FADV_RANDOM 1 581#define LINUX_POSIX_FADV_SEQUENTIAL 2 582#define LINUX_POSIX_FADV_WILLNEED 3 583#define LINUX_POSIX_FADV_DONTNEED 4 584#define LINUX_POSIX_FADV_NOREUSE 5 585 586/* 587 * mount flags 588 */ 589#define LINUX_MS_RDONLY 0x0001 590#define LINUX_MS_NOSUID 0x0002 591#define LINUX_MS_NODEV 0x0004 592#define LINUX_MS_NOEXEC 0x0008 593#define LINUX_MS_REMOUNT 0x0020 594 595/* 596 * SystemV IPC defines 597 */ 598#define LINUX_SEMOP 1 599#define LINUX_SEMGET 2 600#define LINUX_SEMCTL 3 601#define LINUX_MSGSND 11 602#define LINUX_MSGRCV 12 603#define LINUX_MSGGET 13 604#define LINUX_MSGCTL 14 605#define LINUX_SHMAT 21 606#define LINUX_SHMDT 22 607#define LINUX_SHMGET 23 608#define LINUX_SHMCTL 24 609 610#define LINUX_IPC_RMID 0 611#define LINUX_IPC_SET 1 612#define LINUX_IPC_STAT 2 613#define LINUX_IPC_INFO 3 614 615#define LINUX_SHM_LOCK 11 616#define LINUX_SHM_UNLOCK 12 617#define LINUX_SHM_STAT 13 618#define LINUX_SHM_INFO 14 619 620#define LINUX_SHM_RDONLY 0x1000 621#define LINUX_SHM_RND 0x2000 622#define LINUX_SHM_REMAP 0x4000 623 624/* semctl commands */ 625#define LINUX_GETPID 11 626#define LINUX_GETVAL 12 627#define LINUX_GETALL 13 628#define LINUX_GETNCNT 14 629#define LINUX_GETZCNT 15 630#define LINUX_SETVAL 16 631#define LINUX_SETALL 17 632#define LINUX_SEM_STAT 18 633#define LINUX_SEM_INFO 19 634 | |
635union l_semun { 636 l_int val; 637 struct l_semid_ds *buf; 638 l_ushort *array; 639 struct l_seminfo *__buf; 640 void *__pad; 641}; 642 643/* 644 * Socket defines 645 */ | 539union l_semun { 540 l_int val; 541 struct l_semid_ds *buf; 542 l_ushort *array; 543 struct l_seminfo *__buf; 544 void *__pad; 545}; 546 547/* 548 * Socket defines 549 */ |
646#define LINUX_SOCKET 1 647#define LINUX_BIND 2 648#define LINUX_CONNECT 3 649#define LINUX_LISTEN 4 650#define LINUX_ACCEPT 5 651#define LINUX_GETSOCKNAME 6 652#define LINUX_GETPEERNAME 7 653#define LINUX_SOCKETPAIR 8 654#define LINUX_SEND 9 655#define LINUX_RECV 10 656#define LINUX_SENDTO 11 657#define LINUX_RECVFROM 12 658#define LINUX_SHUTDOWN 13 659#define LINUX_SETSOCKOPT 14 660#define LINUX_GETSOCKOPT 15 661#define LINUX_SENDMSG 16 662#define LINUX_RECVMSG 17 663#define LINUX_ACCEPT4 18 664 | |
665#define LINUX_SOL_SOCKET 1 666#define LINUX_SOL_IP 0 667#define LINUX_SOL_IPX 256 668#define LINUX_SOL_AX25 257 669#define LINUX_SOL_TCP 6 670#define LINUX_SOL_UDP 17 671 672#define LINUX_SO_DEBUG 1 --- 12 unchanged lines hidden (view full) --- 685#define LINUX_SO_PEERCRED 17 686#define LINUX_SO_RCVLOWAT 18 687#define LINUX_SO_SNDLOWAT 19 688#define LINUX_SO_RCVTIMEO 20 689#define LINUX_SO_SNDTIMEO 21 690#define LINUX_SO_TIMESTAMP 29 691#define LINUX_SO_ACCEPTCONN 30 692 | 550#define LINUX_SOL_SOCKET 1 551#define LINUX_SOL_IP 0 552#define LINUX_SOL_IPX 256 553#define LINUX_SOL_AX25 257 554#define LINUX_SOL_TCP 6 555#define LINUX_SOL_UDP 17 556 557#define LINUX_SO_DEBUG 1 --- 12 unchanged lines hidden (view full) --- 570#define LINUX_SO_PEERCRED 17 571#define LINUX_SO_RCVLOWAT 18 572#define LINUX_SO_SNDLOWAT 19 573#define LINUX_SO_RCVTIMEO 20 574#define LINUX_SO_SNDTIMEO 21 575#define LINUX_SO_TIMESTAMP 29 576#define LINUX_SO_ACCEPTCONN 30 577 |
693#define LINUX_IP_TOS 1 694#define LINUX_IP_TTL 2 695#define LINUX_IP_HDRINCL 3 696#define LINUX_IP_OPTIONS 4 697 698#define LINUX_IP_MULTICAST_IF 32 699#define LINUX_IP_MULTICAST_TTL 33 700#define LINUX_IP_MULTICAST_LOOP 34 701#define LINUX_IP_ADD_MEMBERSHIP 35 702#define LINUX_IP_DROP_MEMBERSHIP 36 703 704#define LINUX_TCP_NODELAY 1 705#define LINUX_TCP_MAXSEG 2 706#define LINUX_TCP_KEEPIDLE 4 707#define LINUX_TCP_KEEPINTVL 5 708#define LINUX_TCP_KEEPCNT 6 709#define LINUX_TCP_MD5SIG 14 710 | |
711struct l_sockaddr { 712 l_ushort sa_family; 713 char sa_data[14]; 714}; 715 716struct l_msghdr { 717 l_uintptr_t msg_name; 718 l_int msg_namelen; --- 143 unchanged lines hidden (view full) --- 862 (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1) 863#define LINUX_GET_LIMIT_PAGES(desc) \ 864 (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1) 865#define LINUX_GET_PRESENT(desc) \ 866 (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1) 867#define LINUX_GET_USEABLE(desc) \ 868 (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) 869 | 578struct l_sockaddr { 579 l_ushort sa_family; 580 char sa_data[14]; 581}; 582 583struct l_msghdr { 584 l_uintptr_t msg_name; 585 l_int msg_namelen; --- 143 unchanged lines hidden (view full) --- 729 (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1) 730#define LINUX_GET_LIMIT_PAGES(desc) \ 731 (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1) 732#define LINUX_GET_PRESENT(desc) \ 733 (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1) 734#define LINUX_GET_USEABLE(desc) \ 735 (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) 736 |
870#define LINUX_CLOCK_REALTIME 0 871#define LINUX_CLOCK_MONOTONIC 1 872#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 873#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 874#define LINUX_CLOCK_REALTIME_HR 4 875#define LINUX_CLOCK_MONOTONIC_HR 5 876 877#define LINUX_CLONE_VM 0x00000100 878#define LINUX_CLONE_FS 0x00000200 879#define LINUX_CLONE_FILES 0x00000400 880#define LINUX_CLONE_SIGHAND 0x00000800 881#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ 882#define LINUX_CLONE_VFORK 0x00004000 883#define LINUX_CLONE_PARENT 0x00008000 884#define LINUX_CLONE_THREAD 0x00010000 885#define LINUX_CLONE_SETTLS 0x00080000 886#define LINUX_CLONE_PARENT_SETTID 0x00100000 887#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 888#define LINUX_CLONE_CHILD_SETTID 0x01000000 889 890#define LINUX_THREADING_FLAGS \ 891 (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ 892 LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) 893 | |
894/* robust futexes */ 895struct linux_robust_list { 896 struct linux_robust_list *next; 897}; 898 899struct linux_robust_list_head { 900 struct linux_robust_list list; 901 l_long futex_offset; 902 struct linux_robust_list *pending_list; 903}; 904 | 737/* robust futexes */ 738struct linux_robust_list { 739 struct linux_robust_list *next; 740}; 741 742struct linux_robust_list_head { 743 struct linux_robust_list list; 744 l_long futex_offset; 745 struct linux_robust_list *pending_list; 746}; 747 |
905int linux_set_upcall_kse(struct thread *td, register_t stack); 906int linux_set_cloned_tls(struct thread *td, void *desc); 907 | |
908#endif /* !_I386_LINUX_H_ */ | 748#endif /* !_I386_LINUX_H_ */ |