Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/core/stdc/fenv.d
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,24 @@ else version (CRuntime_Bionic)

alias uint fexcept_t;
}
else version (X86_64)
{
struct fenv_t
{
struct _x87
{
uint __control;
uint __status;
uint __tag;
uint[4] __others;
}
_x87 __x87;

uint __mxcsr;
}

alias uint fexcept_t;
}
else
{
static assert(false, "Architecture not supported.");
Expand Down
4 changes: 4 additions & 0 deletions src/core/sys/posix/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ else version (CRuntime_UClibc)
else
enum __WORDSIZE=32;
}
else version (CRuntime_Bionic)
{
enum __USE_GNU = false;
}
else version (Solaris)
{
enum _FILE_OFFSET_BITS = 64;
Expand Down
39 changes: 9 additions & 30 deletions src/core/sys/posix/fcntl.d
Original file line number Diff line number Diff line change
Expand Up @@ -744,42 +744,21 @@ else version (CRuntime_Bionic)
enum F_WRLCK = 1;
enum F_UNLCK = 2;

version (X86)
{
enum O_CREAT = 0x40; // octal 0100
enum O_EXCL = 0x80; // octal 0200
enum O_NOCTTY = 0x100; // octal 0400
enum O_TRUNC = 0x200; // octal 01000
enum O_CREAT = 0x40; // octal 0100
enum O_EXCL = 0x80; // octal 0200
enum O_NOCTTY = 0x100; // octal 0400
enum O_TRUNC = 0x200; // octal 01000

enum O_APPEND = 0x400; // octal 02000
enum O_NONBLOCK = 0x800; // octal 04000
enum O_SYNC = 0x1000; // octal 010000
}
else version (ARM)
{
enum O_CREAT = 0x40; // octal 0100
enum O_EXCL = 0x80; // octal 0200
enum O_NOCTTY = 0x100; // octal 0400
enum O_TRUNC = 0x200; // octal 01000
enum O_APPEND = 0x400; // octal 02000
enum O_NONBLOCK = 0x800; // octal 04000

enum O_APPEND = 0x400; // octal 02000
enum O_NONBLOCK = 0x800; // octal 04000
enum O_SYNC = 0x1000; // octal 010000
}
else version (AArch64)
version (D_LP64)
{
enum O_CREAT = 0x40; // octal 0100
enum O_EXCL = 0x80; // octal 0200
enum O_NOCTTY = 0x100; // octal 0400
enum O_TRUNC = 0x200; // octal 01000

enum O_APPEND = 0x400; // octal 02000
enum O_NONBLOCK = 0x800; // octal 04000
enum O_SYNC = 0x101000; // octal 04010000
enum O_SYNC = 0x101000; // octal 04010000
}
else
{
static assert(false, "Architecture not supported.");
enum O_SYNC = 0x1000; // octal 010000
}

enum O_ACCMODE = 0x3;
Expand Down
6 changes: 5 additions & 1 deletion src/core/sys/posix/setjmp.d
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ else version (CRuntime_Bionic)
{
enum _JBLEN = 32;
}
else version (X86_64)
{
enum _JBLEN = 11;
}
else
{
static assert(false, "Architecture not supported.");
Expand Down Expand Up @@ -480,4 +484,4 @@ else version (CRuntime_UClibc)
{
int _setjmp(ref jmp_buf);
void _longjmp(ref jmp_buf, int);
}
}
139 changes: 31 additions & 108 deletions src/core/sys/posix/signal.d
Original file line number Diff line number Diff line change
Expand Up @@ -775,22 +775,22 @@ else version (CRuntime_UClibc)
}
else version (CRuntime_Bionic)
{
version (X86)
version (D_LP64)
{
struct sigaction_t
{
int sa_flags;
union
{
sigfn_t sa_handler;
sigactfn_t sa_sigaction;
}

sigset_t sa_mask;
int sa_flags;
void function() sa_restorer;
}
}
else version (ARM)
else
{
struct sigaction_t
{
Expand All @@ -805,25 +805,6 @@ else version (CRuntime_Bionic)
void function() sa_restorer;
}
}
else version (AArch64)
{
struct sigaction_t
{
int sa_flags;
union
{
sigfn_t sa_handler;
sigactfn_t sa_sigaction;
}

sigset_t sa_mask;
void function() sa_restorer;
}
}
else
{
static assert(false, "Architecture not supported.");
}
}
else version (Darwin)
{
Expand Down Expand Up @@ -1507,19 +1488,24 @@ else version (CRuntime_Bionic)

version (X86)
{
alias c_ulong sigset_t;
alias uint sigset_t;
enum int LONG_BIT = 32;
}
else version (ARM)
{
alias c_ulong sigset_t;
alias uint sigset_t;
enum int LONG_BIT = 32;
}
else version (AArch64)
{
struct sigset_t { ulong[1] sig; }
enum int LONG_BIT = 64;
}
else version (X86_64)
{
alias ulong sigset_t;
enum int LONG_BIT = 64;
}
else
{
static assert(false, "Architecture not supported.");
Expand Down Expand Up @@ -2995,93 +2981,30 @@ else version (Solaris)
}
else version (CRuntime_Bionic)
{
version (X86)
{
enum SIGPOLL = 29;
enum SIGPROF = 27;
enum SIGSYS = 31;
enum SIGTRAP = 5;
enum SIGVTALRM = 26;
enum SIGXCPU = 24;
enum SIGXFSZ = 25;

enum SA_ONSTACK = 0x08000000;
enum SA_RESETHAND = 0x80000000;
enum SA_RESTART = 0x10000000;
enum SA_SIGINFO = 4;
enum SA_NOCLDWAIT = 2;
enum SA_NODEFER = 0x40000000;
enum SS_ONSTACK = 1;
enum SS_DISABLE = 2;
enum MINSIGSTKSZ = 2048;
enum SIGSTKSZ = 8192;
enum SIGPOLL = 29;
enum SIGPROF = 27;
enum SIGSYS = 31;
enum SIGTRAP = 5;
enum SIGVTALRM = 26;
enum SIGXCPU = 24;
enum SIGXFSZ = 25;

struct stack_t
{
void* ss_sp;
int ss_flags;
size_t ss_size;
}
}
else version (ARM)
{
enum SIGPOLL = 29;
enum SIGPROF = 27;
enum SIGSYS = 31;
enum SIGTRAP = 5;
enum SIGVTALRM = 26;
enum SIGXCPU = 24;
enum SIGXFSZ = 25;

enum SA_ONSTACK = 0x08000000;
enum SA_RESETHAND = 0x80000000;
enum SA_RESTART = 0x10000000;
enum SA_SIGINFO = 4;
enum SA_NOCLDWAIT = 2;
enum SA_NODEFER = 0x40000000;
enum SS_ONSTACK = 1;
enum SS_DISABLE = 2;
enum MINSIGSTKSZ = 2048;
enum SIGSTKSZ = 8192;

struct stack_t
{
void* ss_sp;
int ss_flags;
size_t ss_size;
}
}
else version (AArch64)
{
enum SIGPOLL = 29;
enum SIGPROF = 27;
enum SIGSYS = 31;
enum SIGTRAP = 5;
enum SIGVTALRM = 26;
enum SIGXCPU = 24;
enum SIGXFSZ = 25;

enum SA_ONSTACK = 0x08000000;
enum SA_RESETHAND = 0x80000000;
enum SA_RESTART = 0x10000000;
enum SA_SIGINFO = 4;
enum SA_NOCLDWAIT = 2;
enum SA_NODEFER = 0x40000000;
enum SS_ONSTACK = 1;
enum SS_DISABLE = 2;
enum MINSIGSTKSZ = 2048;
enum SIGSTKSZ = 8192;
enum SA_ONSTACK = 0x08000000;
enum SA_RESETHAND = 0x80000000;
enum SA_RESTART = 0x10000000;
enum SA_SIGINFO = 4;
enum SA_NOCLDWAIT = 2;
enum SA_NODEFER = 0x40000000;
enum SS_ONSTACK = 1;
enum SS_DISABLE = 2;
enum MINSIGSTKSZ = 2048;
enum SIGSTKSZ = 8192;

struct stack_t
{
void* ss_sp;
int ss_flags;
size_t ss_size;
}
}
else
struct stack_t
{
static assert(false, "Architecture not supported.");
void* ss_sp;
int ss_flags;
size_t ss_size;
}

enum
Expand Down
32 changes: 8 additions & 24 deletions src/core/sys/posix/sys/ipc.d
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,22 @@ else version (DragonFlyBSD)
}
else version (CRuntime_Bionic)
{
// All except ftok are from the linux kernel headers.
version (X86)
// All except ftok are from the linux kernel headers. Latest Bionic headers
// don't use this legacy definition anymore, consider updating.
version (D_LP64)
{
struct ipc_perm
{
key_t key;
ushort uid;
ushort gid;
ushort cuid;
ushort cgid;
uint uid;
uint gid;
uint cuid;
uint cgid;
mode_t mode;
ushort seq;
}
}
else version (ARM)
else
{
struct ipc_perm
{
Expand All @@ -203,23 +204,6 @@ else version (CRuntime_Bionic)
ushort seq;
}
}
else version (AArch64)
{
struct ipc_perm
{
key_t key;
uint uid;
uint gid;
uint cuid;
uint cgid;
mode_t mode;
ushort seq;
}
}
else
{
static assert(false, "Architecture not supported.");
}

enum IPC_CREAT = 0x0200; // 01000
enum IPC_EXCL = 0x0400; // 02000
Expand Down
18 changes: 1 addition & 17 deletions src/core/sys/posix/sys/mman.d
Original file line number Diff line number Diff line change
Expand Up @@ -465,23 +465,7 @@ else version (CRuntime_Bionic)
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;

version (X86)
{
enum MAP_ANON = 0x0020;
}
else version (ARM)
{
enum MAP_ANON = 0x0020;
}
else version (AArch64)
{
enum MAP_ANON = 0x0020;
}
else
{
static assert(false, "Architecture not supported.");
}
enum MAP_ANON = 0x0020;

enum MAP_FAILED = cast(void*)-1;

Expand Down
Loading