| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| /** | ||
| * D header file for Darwin | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.darwin.sys.mman; | ||
|
|
||
| version (OSX) | ||
| version = Darwin; | ||
| else version (iOS) | ||
| version = Darwin; | ||
| else version (TVOS) | ||
| version = Darwin; | ||
| else version (WatchOS) | ||
| version = Darwin; | ||
|
|
||
| version (Darwin): | ||
| extern (C): | ||
| nothrow: | ||
| @nogc: | ||
|
|
||
| public import core.sys.posix.sys.mman; | ||
| import core.sys.darwin.sys.cdefs; | ||
| import core.sys.posix.sys.types; | ||
|
|
||
| // already in core.sys.posix.sys.mman | ||
| // enum PROT_NONE = 0x00; | ||
| // enum PROT_READ = 0x01; | ||
| // enum PROT_WRITE = 0x02; | ||
| // enum PROT_EXEC = 0x04; | ||
|
|
||
| // already in core.sys.posix.sys.mman | ||
| // enum MAP_SHARED = 0x0001; | ||
| // enum MAP_PRIVATE = 0x0002; | ||
| static if (_DARWIN_C_SOURCE) | ||
| alias MAP_COPY = MAP_PRIVATE; | ||
| // enum MAP_FIXED = 0x0010; | ||
|
|
||
| static if (_DARWIN_C_SOURCE) | ||
| { | ||
| enum MAP_RENAME = 0x0020; | ||
| enum MAP_NORESERVE = 0x0040; | ||
| enum MAP_RESERVED0080 = 0x0080; | ||
| enum MAP_NOEXTEND = 0x0100; | ||
| enum MAP_HASSEMAPHORE = 0x0200; | ||
| enum MAP_NOCACHE = 0x0400; | ||
| enum MAP_JIT = 0x0800; | ||
| } | ||
|
|
||
| // already in core.sys.posix.sys.mman | ||
| // enum MCL_CURRENT = 0x0001; | ||
| // enum MCL_FUTURE = 0x0002; | ||
|
|
||
| // enum MAP_FAILED = cast(void*)-1; | ||
|
|
||
| // enum MS_ASYNC = 0x0001; | ||
| // enum MS_INVALIDATE = 0x0002; | ||
| // enum MS_SYNC = 0x0010; | ||
|
|
||
| static if (_DARWIN_C_SOURCE) | ||
| { | ||
| enum MS_KILLPAGES = 0x0004; | ||
| enum MS_DEACTIVATE = 0x0008; | ||
|
|
||
| enum MAP_FILE = 0x0000; | ||
|
|
||
| // already in core.sys.posix.sys.mman | ||
| // enum MAP_ANON = 0x1000; | ||
|
|
||
| // enum POSIX_MADV_NORMAL = 0; | ||
| // enum POSIX_MADV_RANDOM = 1; | ||
| // enum POSIX_MADV_SEQUENTIAL = 2; | ||
| // enum POSIX_MADV_WILLNEED = 3; | ||
| // enum POSIX_MADV_DONTNEED = 4; | ||
|
|
||
| alias MADV_NORMAL = POSIX_MADV_NORMAL; | ||
| alias MADV_RANDOM = POSIX_MADV_RANDOM; | ||
| alias MADV_SEQUENTIAL = POSIX_MADV_SEQUENTIAL; | ||
| alias MADV_WILLNEED = POSIX_MADV_WILLNEED; | ||
| alias MADV_DONTNEED = POSIX_MADV_DONTNEED; | ||
| enum MADV_FREE = 5; | ||
| enum MADV_ZERO_WIRED_PAGES = 6; | ||
| enum MADV_FREE_REUSABLE = 7; | ||
| enum MADV_FREE_REUSE = 8; | ||
| enum MADV_CAN_REUSE = 9; | ||
|
|
||
| enum MINCORE_INCORE = 0x1; | ||
| enum MINCORE_REFERENCED = 0x2; | ||
| enum MINCORE_MODIFIED = 0x4; | ||
| enum MINCORE_REFERENCED_OTHER = 0x8; | ||
| enum MINCORE_MODIFIED_OTHER = 0x10; | ||
| } | ||
|
|
||
| // already in core.sys.posix.sys.mman | ||
| // int mlockall(int); | ||
| // int munlockall(void); | ||
| // int mlock(const void *, size_t); | ||
| // void * mmap(void *, size_t, int, int, int, off_t); | ||
| // int mprotect(void *, size_t, int); | ||
| // int msync(void *, size_t, int); | ||
| // int munlock(const void *, size_t); | ||
| // int munmap(void *, size_t); | ||
| // int shm_open(const char *, int, ...); | ||
| // int shm_unlink(const char *); | ||
| // int posix_madvise(void *, size_t, int); | ||
|
|
||
| static if (_DARWIN_C_SOURCE) | ||
| { | ||
| int madvise(void *, size_t, int); | ||
| int mincore(const(void)*, size_t, char *); | ||
| int minherit(void *, size_t, int); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /** | ||
| * D header file for FreeBSD. | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.freebsd.pthread; | ||
|
|
||
| version (FreeBSD): | ||
| extern (C) nothrow @nogc: | ||
|
|
||
| public import core.sys.posix.sys.types; | ||
| // TODO: add full core.sys.freebsd.sys.cpuset; | ||
| public import core.sys.freebsd.sys._cpuset; | ||
| public import core.sys.posix.time; | ||
|
|
||
| enum __BSD_VISIBLE = true; | ||
|
|
||
| alias pthread_switch_routine_t = void function(pthread_t, pthread_t); | ||
|
|
||
| int pthread_attr_setcreatesuspend_np(pthread_attr_t *); | ||
| int pthread_attr_get_np(pthread_t, pthread_attr_t *); | ||
| int pthread_attr_getaffinity_np(const(pthread_attr_t)*, size_t, cpuset_t *); | ||
| int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const(cpuset_t)*); | ||
| int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *); | ||
| int pthread_getthreadid_np(); | ||
| int pthread_main_np(); | ||
| int pthread_multi_np(); | ||
| int pthread_mutexattr_getkind_np(pthread_mutexattr_t); | ||
| int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int); | ||
| void pthread_resume_all_np(); | ||
| int pthread_resume_np(pthread_t); | ||
| void pthread_set_name_np(pthread_t, const(char)*); | ||
| int pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); | ||
| int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); | ||
| int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count); | ||
| int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count); | ||
| int pthread_mutex_isowned_np(pthread_mutex_t *mutex); | ||
| int pthread_setaffinity_np(pthread_t, size_t, const(cpuset_t)*); | ||
| int pthread_single_np(); | ||
| void pthread_suspend_all_np(); | ||
| int pthread_suspend_np(pthread_t); | ||
| int pthread_switch_add_np(pthread_switch_routine_t); | ||
| int pthread_switch_delete_np(pthread_switch_routine_t); | ||
| int pthread_timedjoin_np(pthread_t, void **, const(timespec)*); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /** | ||
| * D header file for FreeBSD. | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.freebsd.sys._bitset; | ||
|
|
||
| version (FreeBSD): | ||
| extern (C) pure nothrow @nogc: | ||
|
|
||
| import core.stdc.config : c_long; | ||
|
|
||
| enum NBBY = 8; // number of bits per byte | ||
|
|
||
| enum _BITSET_BITS = c_long.sizeof * NBBY; | ||
|
|
||
| enum __bitset_words(size_t s) = (s + _BITSET_BITS - 1) / _BITSET_BITS; | ||
|
|
||
| c_long __bitset_mask(size_t s)(size_t n) | ||
| { | ||
| static if (__bitset_words!s == 1) | ||
| return (cast(c_long)1) << n; | ||
| else | ||
| return (cast(c_long)1) << n % _BITSET_BITS; | ||
| } | ||
|
|
||
| size_t __bitset_word(size_t s)(size_t n) | ||
| { | ||
| static if (__bitset_words!s == 1) | ||
| return 0; | ||
| else | ||
| return n / _BITSET_BITS; | ||
| } | ||
|
|
||
| struct BITSET_DEFINE(size_t s) | ||
| { | ||
| c_long[__bitset_words!s] __bits; | ||
| } | ||
|
|
||
| // no idea how to translate those | ||
| //#define BITSET_T_INITIALIZER(x) \ | ||
| // { .__bits = { x } } | ||
| // | ||
| //#define BITSET_FSET(n) \ | ||
| // [ 0 ... ((n) - 1) ] = (-1L) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /** | ||
| * D header file for FreeBSD. | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.freebsd.sys._cpuset; | ||
|
|
||
| version (FreeBSD): | ||
| extern (C) pure nothrow @nogc: | ||
|
|
||
| public import core.sys.freebsd.sys._bitset; | ||
|
|
||
| static if (is(typeof(_KERNEL))) | ||
| alias CPU_SETSIZE = MAXCPU; | ||
|
|
||
| enum CPU_MAXSIZE = 256; | ||
|
|
||
| static if (!is(typeof(CPU_SETSIZE))) | ||
| alias CPU_SETSIZE = CPU_MAXSIZE; | ||
|
|
||
| enum _NCPUBITS = _BITSET_BITS; | ||
| enum _NCPUWORDS = __bitset_words!CPU_SETSIZE; | ||
|
|
||
| alias _cpuset = BITSET_DEFINE!(CPU_SETSIZE); | ||
| alias cpuset_t = _cpuset; | ||
|
|
||
| // no idea how to translate those | ||
| //#define CPUSET_FSET BITSET_FSET(_NCPUWORDS) | ||
| //#define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,223 @@ | ||
| /** | ||
| * D header file for GNU/Linux. | ||
| * | ||
| * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) | ||
| * Authors: Kai Nacke | ||
| */ | ||
| module core.sys.linux.sys.auxv; | ||
|
|
||
| import core.stdc.config; | ||
|
|
||
| version (linux): | ||
| extern (C): | ||
|
|
||
| c_ulong getauxval(c_ulong type) nothrow pure @nogc @system; | ||
|
|
||
| version(ARM) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/arm/bits/hwcap.h | ||
|
|
||
| enum HWCAP_ARM_SWP = 1; | ||
| enum HWCAP_ARM_HALF = 2; | ||
| enum HWCAP_ARM_THUMB = 4; | ||
| enum HWCAP_ARM_26BIT = 8; | ||
| enum HWCAP_ARM_FAST_MULT = 16; | ||
| enum HWCAP_ARM_FPA = 32; | ||
| enum HWCAP_ARM_VFP = 64; | ||
| enum HWCAP_ARM_EDSP = 128; | ||
| enum HWCAP_ARM_JAVA = 256; | ||
| enum HWCAP_ARM_IWMMXT = 512; | ||
| enum HWCAP_ARM_CRUNCH = 1024; | ||
| enum HWCAP_ARM_THUMBEE = 2048; | ||
| enum HWCAP_ARM_NEON = 4096; | ||
| enum HWCAP_ARM_VFPv3 = 8192; | ||
| enum HWCAP_ARM_VFPv3D16 = 16384; | ||
| enum HWCAP_ARM_TLS = 32768; | ||
| enum HWCAP_ARM_VFPv4 = 65536; | ||
| enum HWCAP_ARM_IDIVA = 131072; | ||
| enum HWCAP_ARM_IDIVT = 262144; | ||
| enum HWCAP_ARM_VFPD32 = 524288; | ||
| enum HWCAP_ARM_LPAE = 1048576; | ||
| enum HWCAP_ARM_EVTSTRM = 2097152; | ||
| } | ||
| else version(AArch64) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | ||
|
|
||
| enum HWCAP_FP = 1; | ||
| enum HWCAP_ASIMD = 2; | ||
| enum HWCAP_EVTSTRM = 4; | ||
| enum HWCAP_AES = 8; | ||
| enum HWCAP_PMULL = 16; | ||
| enum HWCAP_SHA1 = 32; | ||
| enum HWCAP_SHA2 = 64; | ||
| enum HWCAP_CRC32 = 128; | ||
| enum HWCAP_ATOMICS = 256; | ||
| enum HWCAP_FPHP = 512; | ||
| enum HWCAP_ASIMDHP = 1024; | ||
| } | ||
| else version(PPC) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/bits/hwcap.h | ||
|
|
||
| enum PPC_FEATURE_32 = 0x80000000; | ||
| enum PPC_FEATURE_64 = 0x40000000; | ||
| enum PPC_FEATURE_601_INSTR = 0x20000000; | ||
| enum PPC_FEATURE_HAS_ALTIVEC = 0x10000000; | ||
| enum PPC_FEATURE_HAS_FPU = 0x08000000; | ||
| enum PPC_FEATURE_HAS_MMU = 0x04000000; | ||
| enum PPC_FEATURE_HAS_4xxMAC = 0x02000000; | ||
| enum PPC_FEATURE_UNIFIED_CACHE = 0x01000000; | ||
| enum PPC_FEATURE_HAS_SPE = 0x00800000; | ||
| enum PPC_FEATURE_HAS_EFP_SINGLE = 0x00400000; | ||
| enum PPC_FEATURE_HAS_EFP_DOUBLE = 0x00200000; | ||
| enum PPC_FEATURE_NO_TB = 0x00100000; | ||
| enum PPC_FEATURE_POWER4 = 0x00080000; | ||
| enum PPC_FEATURE_POWER5 = 0x00040000; | ||
| enum PPC_FEATURE_POWER5_PLUS = 0x00020000; | ||
| enum PPC_FEATURE_CELL_BE = 0x00010000; | ||
| enum PPC_FEATURE_BOOKE = 0x00008000; | ||
| enum PPC_FEATURE_SMT = 0x00004000; | ||
|
|
||
| enum PPC_FEATURE_ICACHE_SNOOP = 0x00002000; | ||
| enum PPC_FEATURE_ARCH_2_05 = 0x00001000; | ||
| enum PPC_FEATURE_PA6T = 0x00000800; | ||
| enum PPC_FEATURE_HAS_DFP = 0x00000400; | ||
| enum PPC_FEATURE_POWER6_EXT = 0x00000200; | ||
| enum PPC_FEATURE_ARCH_2_06 = 0x00000100; | ||
| enum PPC_FEATURE_HAS_VSX = 0x00000080; | ||
| enum PPC_FEATURE_PSERIES_PERFMON_COMPAT = 0x00000040; | ||
| enum PPC_FEATURE_TRUE_LE = 0x00000002; | ||
| enum PPC_FEATURE_PPC_LE = 0x00000001; | ||
|
|
||
| enum PPC_FEATURE2_ARCH_2_07 = 0x80000000; | ||
| enum PPC_FEATURE2_HAS_HTM = 0x40000000; | ||
| enum PPC_FEATURE2_HAS_DSCR = 0x20000000; | ||
| enum PPC_FEATURE2_HAS_EBB = 0x10000000; | ||
| enum PPC_FEATURE2_HAS_ISEL = 0x08000000; | ||
| enum PPC_FEATURE2_HAS_TAR = 0x04000000; | ||
| enum PPC_FEATURE2_HAS_VEC_CRYPTO = 0x02000000; | ||
| } | ||
| else version(PPC64) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/bits/hwcap.h | ||
|
|
||
| enum PPC_FEATURE_32 = 0x80000000; | ||
| enum PPC_FEATURE_64 = 0x40000000; | ||
| enum PPC_FEATURE_601_INSTR = 0x20000000; | ||
| enum PPC_FEATURE_HAS_ALTIVEC = 0x10000000; | ||
| enum PPC_FEATURE_HAS_FPU = 0x08000000; | ||
| enum PPC_FEATURE_HAS_MMU = 0x04000000; | ||
| enum PPC_FEATURE_HAS_4xxMAC = 0x02000000; | ||
| enum PPC_FEATURE_UNIFIED_CACHE = 0x01000000; | ||
| enum PPC_FEATURE_HAS_SPE = 0x00800000; | ||
| enum PPC_FEATURE_HAS_EFP_SINGLE = 0x00400000; | ||
| enum PPC_FEATURE_HAS_EFP_DOUBLE = 0x00200000; | ||
| enum PPC_FEATURE_NO_TB = 0x00100000; | ||
| enum PPC_FEATURE_POWER4 = 0x00080000; | ||
| enum PPC_FEATURE_POWER5 = 0x00040000; | ||
| enum PPC_FEATURE_POWER5_PLUS = 0x00020000; | ||
| enum PPC_FEATURE_CELL_BE = 0x00010000; | ||
| enum PPC_FEATURE_BOOKE = 0x00008000; | ||
| enum PPC_FEATURE_SMT = 0x00004000; | ||
|
|
||
| enum PPC_FEATURE_ICACHE_SNOOP = 0x00002000; | ||
| enum PPC_FEATURE_ARCH_2_05 = 0x00001000; | ||
| enum PPC_FEATURE_PA6T = 0x00000800; | ||
| enum PPC_FEATURE_HAS_DFP = 0x00000400; | ||
| enum PPC_FEATURE_POWER6_EXT = 0x00000200; | ||
| enum PPC_FEATURE_ARCH_2_06 = 0x00000100; | ||
| enum PPC_FEATURE_HAS_VSX = 0x00000080; | ||
| enum PPC_FEATURE_PSERIES_PERFMON_COMPAT = 0x00000040; | ||
| enum PPC_FEATURE_TRUE_LE = 0x00000002; | ||
| enum PPC_FEATURE_PPC_LE = 0x00000001; | ||
|
|
||
| enum PPC_FEATURE2_ARCH_2_07 = 0x80000000; | ||
| enum PPC_FEATURE2_HAS_HTM = 0x40000000; | ||
| enum PPC_FEATURE2_HAS_DSCR = 0x20000000; | ||
| enum PPC_FEATURE2_HAS_EBB = 0x10000000; | ||
| enum PPC_FEATURE2_HAS_ISEL = 0x08000000; | ||
| enum PPC_FEATURE2_HAS_TAR = 0x04000000; | ||
| enum PPC_FEATURE2_HAS_VEC_CRYPTO = 0x02000000; | ||
| } | ||
| else version(SPARC) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/sparc/bits/hwcap.h | ||
|
|
||
| enum HWCAP_SPARC_FLUSH = 0x00000001; | ||
| enum HWCAP_SPARC_STBAR = 0x00000002; | ||
| enum HWCAP_SPARC_SWAP = 0x00000004; | ||
| enum HWCAP_SPARC_MULDIV = 0x00000008; | ||
| enum HWCAP_SPARC_V9 = 0x00000010; | ||
| enum HWCAP_SPARC_ULTRA3 = 0x00000020; | ||
| enum HWCAP_SPARC_BLKINIT = 0x00000040; | ||
| enum HWCAP_SPARC_N2 = 0x00000080; | ||
| enum HWCAP_SPARC_MUL32 = 0x00000100; | ||
| enum HWCAP_SPARC_DIV32 = 0x00000200; | ||
| enum HWCAP_SPARC_FSMULD = 0x00000400; | ||
| enum HWCAP_SPARC_V8PLUS = 0x00000800; | ||
| enum HWCAP_SPARC_POPC = 0x00001000; | ||
| enum HWCAP_SPARC_VIS = 0x00002000; | ||
| enum HWCAP_SPARC_VIS2 = 0x00004000; | ||
| enum HWCAP_SPARC_ASI_BLK_INIT = 0x00008000; | ||
| enum HWCAP_SPARC_FMAF = 0x00010000; | ||
| enum HWCAP_SPARC_VIS3 = 0x00020000; | ||
| enum HWCAP_SPARC_HPC = 0x00040000; | ||
| enum HWCAP_SPARC_RANDOM = 0x00080000; | ||
| enum HWCAP_SPARC_TRANS = 0x00100000; | ||
| enum HWCAP_SPARC_FJFMAU = 0x00200000; | ||
| enum HWCAP_SPARC_IMA = 0x00400000; | ||
| enum HWCAP_SPARC_ASI_CACHE_SPARING = 0x00800000; | ||
| enum HWCAP_SPARC_PAUSE = 0x01000000; | ||
| enum HWCAP_SPARC_CBCOND = 0x02000000; | ||
| enum HWCAP_SPARC_CRYPTO = 0x04000000; | ||
| } | ||
| else version(SPARC64) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/sparc/bits/hwcap.h | ||
|
|
||
| enum HWCAP_SPARC_FLUSH = 0x00000001; | ||
| enum HWCAP_SPARC_STBAR = 0x00000002; | ||
| enum HWCAP_SPARC_SWAP = 0x00000004; | ||
| enum HWCAP_SPARC_MULDIV = 0x00000008; | ||
| enum HWCAP_SPARC_V9 = 0x00000010; | ||
| enum HWCAP_SPARC_ULTRA3 = 0x00000020; | ||
| enum HWCAP_SPARC_BLKINIT = 0x00000040; | ||
| enum HWCAP_SPARC_N2 = 0x00000080; | ||
| enum HWCAP_SPARC_MUL32 = 0x00000100; | ||
| enum HWCAP_SPARC_DIV32 = 0x00000200; | ||
| enum HWCAP_SPARC_FSMULD = 0x00000400; | ||
| enum HWCAP_SPARC_V8PLUS = 0x00000800; | ||
| enum HWCAP_SPARC_POPC = 0x00001000; | ||
| enum HWCAP_SPARC_VIS = 0x00002000; | ||
| enum HWCAP_SPARC_VIS2 = 0x00004000; | ||
| enum HWCAP_SPARC_ASI_BLK_INIT = 0x00008000; | ||
| enum HWCAP_SPARC_FMAF = 0x00010000; | ||
| enum HWCAP_SPARC_VIS3 = 0x00020000; | ||
| enum HWCAP_SPARC_HPC = 0x00040000; | ||
| enum HWCAP_SPARC_RANDOM = 0x00080000; | ||
| enum HWCAP_SPARC_TRANS = 0x00100000; | ||
| enum HWCAP_SPARC_FJFMAU = 0x00200000; | ||
| enum HWCAP_SPARC_IMA = 0x00400000; | ||
| enum HWCAP_SPARC_ASI_CACHE_SPARING = 0x00800000; | ||
| enum HWCAP_SPARC_PAUSE = 0x01000000; | ||
| enum HWCAP_SPARC_CBCOND = 0x02000000; | ||
| enum HWCAP_SPARC_CRYPTO = 0x04000000; | ||
| } | ||
| else version(SystemZ) | ||
| { | ||
| // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/s390/bits/hwcap.h | ||
|
|
||
| enum HWCAP_S390_ESAN3 = 1; | ||
| enum HWCAP_S390_ZARCH = 2; | ||
| enum HWCAP_S390_STFLE = 4; | ||
| enum HWCAP_S390_MSA = 8; | ||
| enum HWCAP_S390_LDISP = 16; | ||
| enum HWCAP_S390_EIMM = 32; | ||
| enum HWCAP_S390_DFP = 64; | ||
| enum HWCAP_S390_HPAGE = 128; | ||
| enum HWCAP_S390_ETF3EH = 256; | ||
| enum HWCAP_S390_HIGH_GPRS = 512; | ||
| enum HWCAP_S390_TE = 1024; | ||
| enum HWCAP_S390_VX = 2048; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * D header file for OpenBSD. | ||
| * | ||
| * $(LINK2 http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/include/link_elf.h?rev=1.6&content-type=text/x-cvsweb-markup, dlfcn.h) | ||
| */ | ||
| module core.sys.openbsd.dlfcn; | ||
|
|
||
| public import core.sys.posix.dlfcn; | ||
|
|
||
| version (OpenBSD): | ||
| extern (C): | ||
| nothrow: | ||
|
|
||
| static assert(RTLD_LAZY == 1); | ||
| static assert(RTLD_NOW == 2); | ||
| static assert(RTLD_GLOBAL == 0x100); | ||
| static assert(RTLD_LOCAL == 0); | ||
| enum RTLD_TRACE = 0x200; | ||
|
|
||
| enum RTLD_NEXT = cast(void *)-1; | ||
| enum RTLD_DEFAULT = cast(void *)-2; | ||
| enum RTLD_SELF = cast(void *)-3; | ||
|
|
||
| enum DL_GETERRNO = 1; | ||
| enum DL_SETTHREADLCK = 2; | ||
| enum DL_SETBINDLCK = 3; | ||
|
|
||
| enum DL_LAZY = RTLD_LAZY; | ||
|
|
||
| int dlctl(void *, int, void *); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,11 @@ | ||
| /** | ||
| * $(RED Deprecated. Use $(D core.sys.darwin.sys.cdefs) instead. This module | ||
| * will be removed in June 2018.) | ||
| * | ||
| * D header file for OSX | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.osx.sys.cdefs; | ||
|
|
||
| public import core.sys.darwin.sys.cdefs; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,102 +1,11 @@ | ||
| /** | ||
| * $(RED Deprecated. Use $(D core.sys.darwin.sys.mman) instead. This module | ||
| * will be removed in June 2018.) | ||
| * | ||
| * D header file for FreeBSD | ||
| * | ||
| * Authors: Martin Nowak | ||
| */ | ||
| module core.sys.osx.sys.mman; | ||
|
|
||
| public import core.sys.darwin.sys.mman; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /** | ||
| * D header file for POSIX. | ||
| * | ||
| * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). | ||
| */ | ||
|
|
||
| module core.sys.posix.sys.filio; | ||
|
|
||
| import core.sys.posix.sys.ioccom; | ||
|
|
||
| version (Posix): | ||
|
|
||
| nothrow @nogc: | ||
|
|
||
| version (OSX) | ||
| { | ||
| // File-descriptor ioctl's | ||
| enum uint FIOCLEX = _IO('f', 1); // set close on exec on fd | ||
| enum uint FIONCLEX = _IO('f', 2); // remove close on exec | ||
| enum uint FIONREAD = _IOR!(int)('f', 127); // get # bytes to read | ||
| enum uint FIONBIO = _IOW!(int)('f', 126); // set/clear non-blocking i/o | ||
| enum uint FIOASYNC = _IOW!(int)('f', 125); // set/clear async i/o | ||
| enum uint FIOSETOWN = _IOW!(int)('f', 124); // set owner | ||
| enum uint FIOGETOWN = _IOR!(int)('f', 123); // get owner | ||
| enum uint FIODTYPE = _IOR!(int)('f', 122); // get d_type | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /** | ||
| * D header file for POSIX. | ||
| * | ||
| * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). | ||
| */ | ||
|
|
||
| module core.sys.posix.sys.ioccom; | ||
|
|
||
| version (Posix): | ||
|
|
||
| nothrow @nogc: | ||
|
|
||
| version (OSX) | ||
| { | ||
| /* OSX ioctl's (based on FreeBSD) encode the command in the lower 16-bits | ||
| * and the size of any in/out parameters in the lower 13 bits of the upper | ||
| * 16-bits of a 32 bit unsigned integer. The high 3 bits of the upper | ||
| * 16-bits encode the in/out status of the parameter. | ||
| */ | ||
| enum uint IOCPARM_MASK = 0x1fff; // parameter length, at most 13 bits | ||
| uint IOCPARM_LEN(uint x) // to extract the encoded parameter length | ||
| { | ||
| return ((x >> 16) & IOCPARM_MASK); | ||
| } | ||
| uint IOCBASECMD(uint x) // to extract the encoded command | ||
| { | ||
| return (x & ~(IOCPARM_MASK << 16)); | ||
| } | ||
| uint IOCGROUP(uint x) // to extract the encoded group | ||
| { | ||
| return ((x >> 8) & 0xff); | ||
| } | ||
|
|
||
| enum uint IOCPARM_MAX = (IOCPARM_MASK + 1); // max size of ioctl args | ||
|
|
||
| enum uint IOC_VOID = 0x20000000; // no parameters | ||
| enum uint IOC_OUT = 0x40000000; // copy parameters back | ||
| enum uint IOC_IN = 0x80000000; // copy parameters into | ||
| enum uint IOC_INOUT = (IOC_IN | IOC_OUT); // copy parameter into and get back | ||
| enum uint IOC_DIRMASK = 0xe0000000; // mask to extract above direction parameters | ||
|
|
||
| // encode the ioctl info into 32 bits | ||
| uint _IOC(T=typeof(null))(uint inorout, uint group, uint num, size_t len) | ||
| { | ||
| return (inorout | ((len & IOCPARM_MASK) << 16) | (group << 8) | num); | ||
| } | ||
|
|
||
| // encode a command with no parameters | ||
| uint _IO(char g, int n) | ||
| { | ||
| return _IOC(IOC_VOID, cast(uint)g, cast(uint)n, cast(size_t)0); | ||
| } | ||
| // encode a command that returns info | ||
| uint _IOR(T)(char g, int n) | ||
| { | ||
| return _IOC!(T)(IOC_OUT, cast(uint)g, cast(uint)n, T.sizeof); | ||
| } | ||
| // encode a command that takes info | ||
| uint _IOW(T)(char g, int n) | ||
| { | ||
| return _IOC!(T)(IOC_IN, cast(uint)g, cast(uint)n, T.sizeof); | ||
| } | ||
| // encode a command that takes info and returns info | ||
| uint _IOWR(T)(char g, int n) | ||
| { | ||
| return _IOC!(T)(IOC_INOUT, cast(uint)g, cast(uint)n, T.sizeof); | ||
| } | ||
| } |