summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-03-24 18:00:42 -0700
committerOri Bernstein <ori@eigenstate.org>2018-03-24 18:08:36 -0700
commit7c70eb8f1b074ca2c8d5524ee3393345dac19e57 (patch)
treeada6e18c9e722b79195d8a544d9ff242cfbc5a26
parentfabf4a0a4642f212804444f1d03a1d51407cbf8c (diff)
downloadmc-0.2.tar.gz
Add support for OpenBSD's MAP_STACK mmap flags, use it in libthread0.2
-rw-r--r--lib/sys/sys+openbsd-x64.myr1
-rw-r--r--lib/sys/sys+openbsd:6.2-x64.myr1
-rw-r--r--lib/sys/sys+openbsd:6.3-x64.myr1
-rw-r--r--lib/thread/spawn+openbsd.myr2
-rw-r--r--support/syscall-gen/types+openbsd:6.3-x64.frag1
5 files changed, 5 insertions, 1 deletions
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index 7b0df69..454567a 100644
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -215,6 +215,7 @@ pkg sys =
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
+ const Mstack : mopt = 0x4000
const Mnoreplace : mopt = 0x0800
/* file types */
diff --git a/lib/sys/sys+openbsd:6.2-x64.myr b/lib/sys/sys+openbsd:6.2-x64.myr
index ca0ed6a..93bcaa6 100644
--- a/lib/sys/sys+openbsd:6.2-x64.myr
+++ b/lib/sys/sys+openbsd:6.2-x64.myr
@@ -348,6 +348,7 @@ pkg sys =
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
+ const Mstack : mopt = 0x4000
const Mnoreplace : mopt = 0x0800
/* file types */
diff --git a/lib/sys/sys+openbsd:6.3-x64.myr b/lib/sys/sys+openbsd:6.3-x64.myr
index ce86baf..82a6b17 100644
--- a/lib/sys/sys+openbsd:6.3-x64.myr
+++ b/lib/sys/sys+openbsd:6.3-x64.myr
@@ -354,6 +354,7 @@ pkg sys =
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
+ const Mstack : mopt = 0x4000
const Mnoreplace : mopt = 0x0800
/* file types */
diff --git a/lib/thread/spawn+openbsd.myr b/lib/thread/spawn+openbsd.myr
index 1cdf230..c925349 100644
--- a/lib/thread/spawn+openbsd.myr
+++ b/lib/thread/spawn+openbsd.myr
@@ -53,7 +53,7 @@ const spawnstk = {fn, sz
const getstk = {sz
var p, m
- p = sys.mmap((0 : byte#), sz, sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)
+ p = sys.mmap((0 : byte#), sz, sys.Mprotrw, sys.Mpriv | sys.Manon | sys.Mstack, -1, 0)
if p == sys.Mapbad
-> p
;;
diff --git a/support/syscall-gen/types+openbsd:6.3-x64.frag b/support/syscall-gen/types+openbsd:6.3-x64.frag
index 21b670e..cd204e5 100644
--- a/support/syscall-gen/types+openbsd:6.3-x64.frag
+++ b/support/syscall-gen/types+openbsd:6.3-x64.frag
@@ -348,6 +348,7 @@ const Mpriv : mopt = 0x2
const Mfixed : mopt = 0x10
const Mfile : mopt = 0x0
const Manon : mopt = 0x1000
+const Mstack : mopt = 0x4000
const Mnoreplace : mopt = 0x0800
/* file types */