summaryrefslogtreecommitdiff
path: root/lib/sys/sys+openbsd-x64.myr
AgeCommit message (Collapse)Author
2018-10-18Add thread-local storage for POSIX-y platforms.iriri
This patch implements thread-local storage by using a segment register to store pointers to regions of memory unique to each thread. In spawned threads, this region starts above the top of the stack, while in the main thread, this region is initially statically allocated so it can be used in `__init__` functions and dynamically reallocated if it needs to grow beyond 8 slots. The api consists of 3 functions: `tlsalloc()`, which must be called from the main thread, allocates a slot and returns a key to be used with `settls(k, v)` and `gettls(k)`. Each thread inherits its tls slots from the thread that spawned it and any slot added after a given thread is spawned is not available in that thread. Adding tls regions gives threads an easy way to get their own tids, allowing us to add some basic correctness checks to the mutex code. A pointer to the base of the stack and the size of the mapping are also stored in the tls region, making it easy to support user-specified stack sizes in the future. Changes from previous version: - Fixed size of main tls static allocation. - More comments, less magic. - Fixed typo in start+osx-x64.s exit+{freebsd,linux,openbsd}-x64.s - `gettlskey` renamed to `tlsalloc`. - `key` is now `tlskey(@a#)`, improving safety. - Test is slightly less bad.
2018-08-14Make timespec/timeval struct members signed to simplify arithmetic.iriri
Every single conversion except for one for OS X is uint64 to int64.
2018-03-24Add support for OpenBSD's MAP_STACK mmap flags, use it in libthreadOri Bernstein
2017-07-07Use the correct syscall for kill on OpenBSDCarlin Bingham
2017-06-25Rename Solsock to Solsocket and make it type sockprotoMichael Forney
This constant is used as a protocol level in getsockopt/setsockopt as well as msghdr. Valid values for level include the same constants used as the protocol argument of socket (IPPROTO_*), so it needs to have the same type so the constants can be used in both functions. The rename is for consistency with the C API.
2017-06-25Use an iovec struct for readv/writevMichael Forney
This avoids the assumption that iovec and byte[:] are laid out the same way in memory.
2017-06-07Add poll flags for OpenBSD.Ori Bernstein
2017-05-24Allow arbitrary functions on bio files.biofuncOri Bernstein
2017-05-16Add pread/pwrite syscalls.Ori Bernstein
2017-03-06Add missing `poll` on OpenBSDOri Bernstein
2017-03-05Merge branch 'master' of git+ssh://git.eigenstate.org/git/ori/mcOri Bernstein
2017-02-17Search for usefiles relative to the output.Ori Bernstein
For most uses, this is equivalent to compiler cwd, but supports out of tree builds better. It also means that builds behave the same way regardless of the directory that the compiler is run from, which is convenient for testing. This also drops support for `.use` suffixes on local uses.
2017-02-16Bulk of porting to NetBSD.Ori Bernstein
This wasn't so bad. Missing: - libthread - auditing all libsys struct types.
2017-01-17Add the ability to do setenv() on posixy systems.Ori Bernstein
2017-01-12Add more missing system calls.Ori Bernstein
2017-01-10Add some missing open flags on some oses.Ori Bernstein
2016-11-22Implement signals on OpenBSDori
2016-11-20Fix cut-paste error.Ori Bernstein
I was supposed to copy, not cut.
2016-11-20Fix sysctl signature.Ori Bernstein
The previous one worked, but was really painful to use well for what it was intended.
2016-08-14Remove more duplicate extern defs.Ori Bernstein
2016-07-16Fix mmap offset on OpenBSD (see ↵Ori Bernstein
http://marc.info/?l=openbsd-tech&m=146793252011083&w=2)
2016-05-24Regenerate OpenBSD bootstrapOri Bernstein
2016-05-17New syntax for casts.Ori Bernstein
2016-05-09Add support for OpenBSD thread spawning.Ori Bernstein
2016-05-08Clean up OpenBSD syscalls.Ori Bernstein
2016-05-08Use a correct implementation of pipe()Ori Bernstein
2016-05-08We now can build and install on openbsd.Ori Bernstein
2016-05-08mbld sort of works.Ori Bernstein
2016-05-08Fix several openbsd syscalls.Ori Bernstein
2016-05-08uname for openbsdAndrew Chambers
2016-05-08work on openbsd portAndrew Chambers
- fix start assembly - update syscall numbers to match openbsd - add openbsd note section
2016-05-08Add initial openbsd skeletonAndrew Chambers