summaryrefslogtreecommitdiff
path: root/lib/sys
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sys')
-rw-r--r--lib/sys/sys+freebsd-x64.myr12
-rw-r--r--lib/sys/sys+linux-x64.myr16
-rw-r--r--lib/sys/sys+netbsd-x64.myr23
-rw-r--r--lib/sys/sys+openbsd-x64.myr2
-rw-r--r--lib/sys/sys+openbsd:6.1-x64.myr4
-rw-r--r--lib/sys/sys+openbsd:6.2-x64.myr6
-rw-r--r--lib/sys/sys+openbsd:6.3-x64.myr4
7 files changed, 55 insertions, 12 deletions
diff --git a/lib/sys/sys+freebsd-x64.myr b/lib/sys/sys+freebsd-x64.myr
index b89e99b..73821b4 100644
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -38,6 +38,7 @@ pkg sys =
type cpulevel = int
type cpusetid = int
type idtype = int
+ type sysarchop = int64
type acltype = int
type acltag = uint32
@@ -802,6 +803,13 @@ pkg sys =
const Siglwp : signo = Sigthr
const Siglibrt : signo = 33 /* reserved by real-time library. */
+ /* sysarch ops */
+ const Archamd64getfs : sysarchop = 128
+ const Archamd64setfs : sysarchop = 129
+ const Archamd64getgs : sysarchop = 130
+ const Archamd64setgs : sysarchop = 131
+ const Archamd64getxfpu : sysarchop = 132
+
extern const syscall : (sc:scno, args:... -> int64)
extern var __cenvp : byte##
@@ -1285,7 +1293,7 @@ pkg sys =
const quotactl : (path : byte#, cmd : int, uid : int, arg : void# -> int)
const lgetfh : (fname : byte#, fhp : fhandle# -> int)
const getfh : (fname : byte#, fhp : fhandle# -> int)
- const sysarch : (op : int, parms : byte# -> int)
+ const sysarch : (op : sysarchop, parms : void## -> int)
const rtprio : (function : int, pid : pid, rtp : rtprio# -> int)
const setfib : (fibnum : int -> int)
const ntp_adjtime : (tp : timex# -> int)
@@ -1969,7 +1977,7 @@ const getfh = {fname, fhp
-> (syscall(Sysgetfh, a(fname), a(fhp)) : int)
}
const sysarch = {op, parms
- -> (syscall(Syssysarch, a(op), a(parms)) : int)
+ -> (syscall(Syssysarch, op, a(parms)) : int)
}
const rtprio = {function, pid, rtp
-> (syscall(Sysrtprio, a(function), a(pid), a(rtp)) : int)
diff --git a/lib/sys/sys+linux-x64.myr b/lib/sys/sys+linux-x64.myr
index 61bb8b2..bbfb689 100644
--- a/lib/sys/sys+linux-x64.myr
+++ b/lib/sys/sys+linux-x64.myr
@@ -45,6 +45,7 @@ pkg sys =
type mfdflags = uint32
type aiocontext = uint64
type msg = void#
+ type arch_prctlop = uint64
type clock = union
@@ -590,6 +591,12 @@ pkg sys =
/* return value for a failed mapping */
const Mapbad : byte# = (-1 : byte#)
+
+ /* arch_prctl ops */
+ const Archsetgs : arch_prctlop = 0x1001
+ const Archsetfs : arch_prctlop = 0x1002
+ const Archgetfs : arch_prctlop = 0x1003
+ const Archgetgs : arch_prctlop = 0x1004
/* signal flags */
const Sanocldstop : sigflags = 0x00000001
@@ -1097,6 +1104,7 @@ pkg sys =
const Sysmq_notify : scno = 244
const Sysmq_getsetattr : scno = 245
const Sysprctl : scno = 157
+ const Sysarch_prctl : scno = 158
const Sysswapon : scno = 167
const Sysswapoff : scno = 168
const Sys_sysctl : scno = 156
@@ -1308,7 +1316,7 @@ pkg sys =
const settimeofday : (tv : timeval#, tz : timezone# -> int64)
const adjtimex : (txc_p : timex# -> int64)
const times : (tbuf : tms# -> int64)
- const gettid : ( -> int64)
+ const gettid : ( -> pid)
const alarm : (seconds : uint -> int64)
const getppid : ( -> int64)
const geteuid : ( -> int64)
@@ -1484,6 +1492,7 @@ pkg sys =
const mq_notify : (mqdes : int, notification : sigevent# -> int64)
const mq_getsetattr : (mqdes : int, mqstat : mq_attr#, omqstat : mq_attr# -> int64)
const prctl : (option : int, arg2 : uint64, arg3 : uint64, arg4 : uint64, arg5 : uint64 -> int64)
+ const arch_prctl : (op : arch_prctlop, addr : void# -> int64)
const swapon : (specialfile : byte#, swap_flags : int -> int64)
const swapoff : (specialfile : byte# -> int64)
const _sysctl : (args : sysctl_args# -> int64)
@@ -1782,7 +1791,7 @@ const times = {tbuf
-> (syscall(Systimes, a(tbuf)) : int64)
}
const gettid = {
- -> (syscall(Sysgettid) : int64)
+ -> (syscall(Sysgettid) : pid)
}
const alarm = {seconds
-> (syscall(Sysalarm, a(seconds)) : int64)
@@ -2309,6 +2318,9 @@ const mq_getsetattr = {mqdes, mqstat, omqstat
const prctl = {option, arg2, arg3, arg4, arg5
-> (syscall(Sysprctl, a(option), a(arg2), a(arg3), a(arg4), a(arg5)) : int64)
}
+const arch_prctl = {op, addr
+ -> syscall(Sysarch_prctl, op, addr)
+}
const swapon = {specialfile, swap_flags
-> (syscall(Sysswapon, a(specialfile), a(swap_flags)) : int64)
}
diff --git a/lib/sys/sys+netbsd-x64.myr b/lib/sys/sys+netbsd-x64.myr
index 8e22c0b..5fd3bb0 100644
--- a/lib/sys/sys+netbsd-x64.myr
+++ b/lib/sys/sys+netbsd-x64.myr
@@ -18,6 +18,7 @@ pkg sys =
type umtxop = int32
type signo = int32
type sigflags = int32
+ type sysarchop = int64
type clock = union
`Clockrealtime
@@ -344,6 +345,21 @@ pkg sys =
const Umtxmtxwake2 : umtxop = 22
const Umtxmax : umtxop = 23
+ /* sysarch ops */
+ const X8664getldt : sysarchop = 0
+ const X8664setldt : sysarchop = 1
+ const X8664iopl : sysarchop = 2
+ const X8664getioperm : sysarchop = 3
+ const X8664setioperm : sysarchop = 4
+ const X8664oldvm86 : sysarchop = 5
+ const X8664getmtrr : sysarchop = 11
+ const X8664setmtrr : sysarchop = 12
+ const X8664vm86 : sysarchop = 13
+ const X8664getgsbase : sysarchop = 14
+ const X8664getfsbase : sysarchop = 15
+ const X8664setgsbase : sysarchop = 16
+ const X8664setfsbase : sysarchop = 17
+
/* signal actions */
const Saonstack : sigflags = 0x0001 /* take signal on signal stack */
const Sarestart : sigflags = 0x0002 /* restart system call on signal return */
@@ -908,6 +924,9 @@ pkg sys =
new : void#, newsz : size# \
-> int)
+ /* misc */
+ const sysarch : (op : sysarchop, args : void## -> int)
+
extern const cstring : (str : byte[:] -> byte#)
/* filled by start code */
extern var __cenvp : byte##
@@ -1102,6 +1121,10 @@ const sysctl = {mib, old, oldsz, new, newsz
(mib : int#), a(mib.len), old, oldsz, new, newsz) : int)
}
+const sysarch = {op, args
+ -> (syscall(Syssysarch, op, args) : int)
+}
+
const clockid = {clk
match clk
| `Clockrealtime: -> 0
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index a260134..d840608 100644
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -215,7 +215,7 @@ pkg sys =
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
- const Mstack : mopt = 0x4000
+ const Mstack : mopt = 0x0
const Mnoreplace : mopt = 0x0800
/* file types */
diff --git a/lib/sys/sys+openbsd:6.1-x64.myr b/lib/sys/sys+openbsd:6.1-x64.myr
index 9314394..9ac648a 100644
--- a/lib/sys/sys+openbsd:6.1-x64.myr
+++ b/lib/sys/sys+openbsd:6.1-x64.myr
@@ -1031,7 +1031,7 @@ pkg sys =
const symlinkat : (path : byte#, fd : int, link : byte# -> int)
const unlinkat : (fd : int, path : byte#, flag : int -> int)
const __set_tcb : (tcb : void# -> void)
- const __get_tcb : ( -> void)
+ const __get_tcb : ( -> void#)
;;
/* start manual overrides { */
@@ -1750,5 +1750,5 @@ const __set_tcb = {tcb
-> (syscall(Sys__set_tcb, a(tcb)) : void)
}
const __get_tcb = {
- -> (syscall(Sys__get_tcb) : void)
+ -> (syscall(Sys__get_tcb) : void#)
}
diff --git a/lib/sys/sys+openbsd:6.2-x64.myr b/lib/sys/sys+openbsd:6.2-x64.myr
index 598d381..d89b702 100644
--- a/lib/sys/sys+openbsd:6.2-x64.myr
+++ b/lib/sys/sys+openbsd:6.2-x64.myr
@@ -348,7 +348,7 @@ pkg sys =
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
- const Mstack : mopt = 0x4000
+ const Mstack : mopt = 0x0
const Mnoreplace : mopt = 0x0800
/* file types */
@@ -1037,7 +1037,7 @@ pkg sys =
const symlinkat : (path : byte#, fd : int, link : byte# -> int)
const unlinkat : (fd : int, path : byte#, flag : int -> int)
const __set_tcb : (tcb : void# -> void)
- const __get_tcb : ( -> void)
+ const __get_tcb : ( -> void#)
;;
/* start manual overrides { */
@@ -1759,5 +1759,5 @@ const __set_tcb = {tcb
-> (syscall(Sys__set_tcb, a(tcb)) : void)
}
const __get_tcb = {
- -> (syscall(Sys__get_tcb) : void)
+ -> (syscall(Sys__get_tcb) : void#)
}
diff --git a/lib/sys/sys+openbsd:6.3-x64.myr b/lib/sys/sys+openbsd:6.3-x64.myr
index d013643..ac7170b 100644
--- a/lib/sys/sys+openbsd:6.3-x64.myr
+++ b/lib/sys/sys+openbsd:6.3-x64.myr
@@ -1036,7 +1036,7 @@ pkg sys =
const symlinkat : (path : byte#, fd : int, link : byte# -> int)
const unlinkat : (fd : int, path : byte#, flag : int -> int)
const __set_tcb : (tcb : void# -> void)
- const __get_tcb : ( -> void)
+ const __get_tcb : ( -> void#)
;;
/* start manual overrides { */
@@ -1755,5 +1755,5 @@ const __set_tcb = {tcb
-> (syscall(Sys__set_tcb, a(tcb)) : void)
}
const __get_tcb = {
- -> (syscall(Sys__get_tcb) : void)
+ -> (syscall(Sys__get_tcb) : void#)
}