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

Commit

Permalink
Merge pull request #1395 from redstar/systemz
Browse files Browse the repository at this point in the history
Add SystemZ declarations.
  • Loading branch information
dnadlinger committed Sep 22, 2015
2 parents 6f931f1 + d66630d commit 00fb481
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/core/sys/linux/dlfcn.d
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,30 @@ else version (AArch64)
void _dl_mcount_wrapper_check(void* __selfpc);
}
}
else version (SystemZ)
{
// http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
// enum RTLD_LAZY = 0x0001; // POSIX
// enum RTLD_NOW = 0x0002; // POSIX
enum RTLD_BINDING_MASK = 0x3;
enum RTLD_NOLOAD = 0x00004;
enum RTLD_DEEPBIND = 0x00008;

// enum RTLD_GLOBAL = 0x00100; // POSIX
// enum RTLD_LOCAL = 0; // POSIX
enum RTLD_NODELETE = 0x01000;

static if (__USE_GNU)
{
RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args)
{
_dl_mcount_wrapper_check(cast(void*)fctp);
return fctp(args);
}

void _dl_mcount_wrapper_check(void* __selfpc);
}
}
else
static assert(0, "unimplemented");

Expand Down
7 changes: 7 additions & 0 deletions src/core/sys/posix/dlfcn.d
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ version( CRuntime_Glibc )
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
}
else version (SystemZ)
{
enum RTLD_LAZY = 0x00001;
enum RTLD_NOW = 0x00002;
enum RTLD_GLOBAL = 0x00100;
enum RTLD_LOCAL = 0;
}
else
static assert(0, "unimplemented");

Expand Down
34 changes: 34 additions & 0 deletions src/core/sys/posix/signal.d
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,30 @@ version( linux )
enum SIGUSR2 = 12;
enum SIGURG = 23;
}
else version (SystemZ)
{
//SIGABRT (defined in core.stdc.signal)
enum SIGALRM = 14;
enum SIGBUS = 7;
enum SIGCHLD = 17;
enum SIGCONT = 18;
//SIGFPE (defined in core.stdc.signal)
enum SIGHUP = 1;
//SIGILL (defined in core.stdc.signal)
//SIGINT (defined in core.stdc.signal)
enum SIGKILL = 9;
enum SIGPIPE = 13;
enum SIGQUIT = 3;
//SIGSEGV (defined in core.stdc.signal)
enum SIGSTOP = 19;
//SIGTERM (defined in core.stdc.signal)
enum SIGTSTP = 20;
enum SIGTTIN = 21;
enum SIGTTOU = 22;
enum SIGUSR1 = 10;
enum SIGUSR2 = 12;
enum SIGURG = 23;
}
else
static assert(0, "unimplemented");
}
Expand Down Expand Up @@ -1249,6 +1273,16 @@ version( CRuntime_Glibc )
enum SIGXCPU = 24;
enum SIGXFSZ = 25;
}
else version (SystemZ)
{
enum SIGPOLL = 29;
enum SIGPROF = 27;
enum SIGSYS = 31;
enum SIGTRAP = 5;
enum SIGVTALRM = 26;
enum SIGXCPU = 24;
enum SIGXFSZ = 25;
}
else
static assert(0, "unimplemented");

Expand Down
21 changes: 21 additions & 0 deletions src/core/sys/posix/sys/msg.d
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,27 @@ else version (S390)
c_ulong __glibc_reserved5;
};
}
else version (SystemZ)
{
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/s390/bits/msq.h
alias c_ulong msgqnum_t;
alias c_ulong msglen_t;

// Assuming wordsize == 64
struct msqid_ds {
ipc_perm msg_perm;
time_t msg_stime;
time_t msg_rtime;
time_t msg_ctime;
c_ulong __msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
c_ulong __glibc_reserved4;
c_ulong __glibc_reserved5;
};
}
else version (SPARC)
{
// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sparc/bits/msq.h
Expand Down
34 changes: 34 additions & 0 deletions src/core/sys/posix/sys/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,40 @@ version( CRuntime_Glibc )
SO_TYPE = 3
}
}
else version (SystemZ)
{
enum
{
SOCK_DGRAM = 2,
SOCK_SEQPACKET = 5,
SOCK_STREAM = 1
}

enum
{
SOL_SOCKET = 1
}

enum
{
SO_ACCEPTCONN = 30,
SO_BROADCAST = 6,
SO_DEBUG = 1,
SO_DONTROUTE = 5,
SO_ERROR = 4,
SO_KEEPALIVE = 9,
SO_LINGER = 13,
SO_OOBINLINE = 10,
SO_RCVBUF = 8,
SO_RCVLOWAT = 18,
SO_RCVTIMEO = 20,
SO_REUSEADDR = 2,
SO_SNDBUF = 7,
SO_SNDLOWAT = 19,
SO_SNDTIMEO = 21,
SO_TYPE = 3
}
}
else
static assert(0, "unimplemented");

Expand Down

0 comments on commit 00fb481

Please sign in to comment.