summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-11-06Create the output directory when assembling.Ori Bernstein
Easier to bootstrap.
2018-11-05TLS implementation for 9front.Ori Bernstein
2018-11-03Add tls hooks to libstd.Ori Bernstein
2018-11-03First attempt at a queue API.Ori Bernstein
Simple, naive, but seems to work.
2018-10-27Add back stack mapping.Ori Bernstein
OpenBSD 6.4 wants this.
2018-10-27Merge branch 'master' of git+ssh://git.eigenstate.org/git/ori/mcOri Bernstein
2018-10-25Heapify closures on OSX/FreeBSD.Ori Bernstein
Fixes tests. (Thanks, iri)
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-10-15Fixes to libbio (Thanks, Mike)Ori Bernstein
2018-10-14Fix boundary-spanning delimiters.Ori Bernstein
2018-10-12Don't readinto if we're dropping.Ori Bernstein
2018-10-12Actually read delimiter length bytes. Don't index out of bounds.Ori Bernstein
2018-10-12Fix typo in chartype.Ori Bernstein
2018-10-12Fix missing free in aesgcm (thanks mike)Ori Bernstein
2018-10-07Try /dev/urandom before /dev/random.Ori Bernstein
Speeds things up on Linux.
2018-10-03Unswap sha output bytes. (Thanks Mike!)Ori Bernstein
2018-09-24Add iterator for all section, key, val pairs in inifile.Ori Bernstein
2018-09-12Wait can't always be called from other procs.Ori Bernstein
2018-09-10Simplify futures.Ori Bernstein
2018-08-29Implement futures + thread.doOri Bernstein
2018-08-24Add -v option, make it print test output.Ori Bernstein
2018-08-19Only attempt to ftxwake in sempost if there might be a waiter.iriri
2018-08-19Add rwlocks.iriri
Updating the first three patches. Changes: - Copied all of the relevant timespec, futex, etc. changes to `/support/syscall-gen/`. - Added comment to FreeBSD and OS X condvar implementations about reacquiring the lock after being signalled. - Simplified the fallback condvar implementation. - The `ftxwait` timeout parameter is now a `std.time`. Negative values mean no timeout. - Replaced the fallback rwlock implementation with a much simpler one. - Added comments to the rwlock implementations and made the requested changes to the function names.
2018-08-19Fix futex timeouts and handle futex error codes.iriri
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-08-11Clean up the mutex code a bit more.Ori Bernstein
2018-08-05We can pick fma generically at compile time.Ori Bernstein
It's a trait, and because the functions are generic, they already know the type.
2018-08-05We don't need the impls in sin-impl.Ori Bernstein
2018-08-03Clean up previous fixes.Ori Bernstein
The externs were already defined, they just needed to be moved out to prevent cyclic dependencies.
2018-08-03Fix build on Linux.Ori Bernstein
2018-08-02Prettify mutex code a bit.Ori Bernstein
The if statements at the start were a touch odd.
2018-07-31Merge remote-tracking branch 'npnth/libmath'Ori Bernstein
2018-07-31Include test cases for all (relevant) sub-polynomials of atan.S. Gilles
2018-07-31Correct extra-precision division typo for atan.S. Gilles
2018-07-31Correctly compute u, du for y/x in atan.S. Gilles
Also, apparently the C tables gave negatives. That's probably a mistake.
2018-07-31Improve accuracy of poly path of atan calculations.S. Gilles
2018-07-31Negate atan properly when atan(1/x) is computed.S. Gilles
2018-07-31First compiling atan.S. Gilles
2018-07-28Fix openbsd build.Ori Bernstein
2018-07-28Allocate condvar waiters on heap.Ori Bernstein
It solves crashes on plan 9, because plan 9 keeps separate stacks in different procs.
2018-07-27Fix typo in plan 9 mksem.iriri
2018-07-25Subject: [PATCH 2/2] Add/fix condvar implementations.iriri
2018-07-25Add ftxwakeall and waitgrps to libthread.iriri
A waitgrp provides more or less the same functionality as a pthread_barrier_t or a sync.WaitGroup from Go. Since "barrier" sounds similar to a memory barrier/fence, I went with the latter name.
2018-07-24Adjust leeway in arctan tuple generator.S. Gilles
2018-07-24Document that generate-minimax-by-Remez.gp has issues.S. Gilles
2018-07-24Add tuple-generation for arctan.S. Gilles
2018-07-23Handle awkward special cases in tan/cot32.S. Gilles
2018-07-22Test Highly Accurate Tables for tan() and cot().S. Gilles
2018-07-22Handle -0.0 correctly in tan() and cot().S. Gilles
2018-07-22Correct typo in cotangent calculations.S. Gilles