Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add more definitions for Linux/SystemZ.
Browse files Browse the repository at this point in the history
Adds ucontext, setjmp and inotify.
  • Loading branch information
redstar committed Nov 1, 2015
1 parent c2c255c commit de0b080
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/sys/linux/sys/inotify.d
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ else version (AArch64)
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (SystemZ)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else
static assert(0, "unimplemented");

Expand Down
9 changes: 9 additions & 0 deletions src/core/sys/posix/setjmp.d
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ version( CRuntime_Glibc )
double[6] __fpregs;
}
}
else version (SystemZ)
{
struct __s390_jmp_buf
{
c_long[10] __gregs;
c_long[8] __fpregs;
}
alias __jmp_buf = __s390_jmp_buf[1];
}
else
static assert(0, "unimplemented");

Expand Down
46 changes: 46 additions & 0 deletions src/core/sys/posix/ucontext.d
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,52 @@ version( CRuntime_Glibc )
mcontext_t uc_mcontext;
}
}
else version (SystemZ)
{
public import core.sys.posix.signal : sigset_t;

enum NGREG = 27;

alias greg_t = c_ulong;
alias gregset_t = align(8) greg_t[NGREG];

align(8) struct __psw_t
{
c_ulong mask;
c_ulong addr;
}

union fpreg_t
{
double d;
float f;
}

struct fpregset_t
{
uint fpc;
fpreg_t[16] fprs;
}

struct mcontext_t
{
__psw_t psw;
c_ulong[16] gregs;
uint[16] aregs;
fpregset_t fpregs;
}

struct ucontext
{
c_ulong uc_flags;
ucontext* uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
}

alias ucontext_t = ucontext;
}
else
static assert(0, "unimplemented");
}
Expand Down

0 comments on commit de0b080

Please sign in to comment.