Commit Graph

411 Commits

Author SHA1 Message Date
Giacomo Tesio a59b992ed4 libposix: more code for signals 2017-05-25 01:04:53 +02:00
Giacomo Tesio 68bc46fe85 libposix: initial changes to POSIX_kill 2017-05-24 00:40:28 +02:00
Giacomo Tesio 3381f75d03 libposix: fix typo 2017-05-24 00:08:00 +02:00
Giacomo Tesio 3307c1e7e2 libposix: drafted Child structure 2017-05-24 00:04:30 +02:00
Giacomo Tesio 6b70ea29e2 Merge branch 'gcc-O2' of https://bitbucket.org/tesio/jehanne into gcc-O2 2017-05-23 22:57:41 +02:00
Giacomo Tesio e0610f6b71 libposix: drafted SIGCHLD management 2017-05-23 00:27:50 +02:00
Giacomo Tesio f9c63742bb qa: simplify test that crash with -O2 2017-05-22 23:18:47 +02:00
Giacomo Tesio c27b2aa93b kern: remove unused l64acidt.S 2017-05-22 00:45:03 +02:00
Giacomo Tesio 1eb450510a qa: add test that crash with -O2 2017-05-21 23:16:41 +02:00
Giacomo Tesio cc595c7c99 kernel: save and restore all registers on syscall 2017-05-21 00:15:51 +02:00
Giacomo Tesio 4b7957a28f kernel: simplify init code 2017-05-20 14:06:26 +02:00
Giacomo Tesio aedc31e925 libstdio: fix uninitialized variables 2017-05-19 01:33:09 +02:00
Giacomo Tesio 3b4af1e4d8 gcc: enable -O2 compilation
To enable -O2 compilation we have to disable some optimizations:

- strict-aliasing (TODO: introduce required unions to enable this)
- aggressive-loop-optimizations
- array-bounds

Affected builds are

- sys/src/cmd/dossrv/build.json
- sys/src/cmd/ip/build.json
- sys/src/lib/authsrv/build.json
- sys/src/lib/memdraw/build.json
2017-05-19 01:15:34 +02:00
Giacomo Tesio fa15f817c4 qa: avoid cast that preclude strict aliasing 2017-05-19 01:09:51 +02:00
Giacomo Tesio 913b1361dc u.h: (try) to avoid optimizations of syscall arguments 2017-05-19 01:02:42 +02:00
Giacomo Tesio 901962f6c9 cmds: avoid duplicated compilation of ip tools 2017-05-19 00:54:23 +02:00
Giacomo Tesio 802bd8368a travis-ci: fix dotter, again 2017-05-18 22:47:37 +02:00
Giacomo Tesio 4de6a61310 travis-ci: fix dotters 2017-05-18 21:13:56 +02:00
Giacomo Tesio d3fe64ac87 newlib: fix usleep; signal improvements 2017-05-18 02:13:13 +02:00
Giacomo Tesio 22d90985a5 kernel: awake() wake up only truly blocking syscalls
If a syscall did not entered sleep(), the pendingWakeup is not consumed.
2017-05-17 02:04:08 +02:00
Giacomo Tesio 1dc8991331 kernel: reset and restore up->cursyscall in trap
This way sleep() knows that it should not interrupt the process
to serve awake().

Also rename Proc.insyscall to Proc.inkernel since that's the meaning
of the flag, which is only read to serve awake()'s mechanics and
to accounttime(). Indeed faultAmd64 was setting insyscall to 1.
2017-05-17 01:16:49 +02:00
Giacomo Tesio 960e8a0d4e qa/kern: more tests for awake 2017-05-17 00:52:16 +02:00
Giacomo Tesio 2b1baf8de1 kernel: devpipe: fix error management on writes
The "write on closed pipe" note should be posted only
if the write occurred on a closed pipe.

Before this fix, on any interrupt caused the note to be sent,
despite the pipe being open and fully working.
2017-05-17 00:27:57 +02:00
Giacomo Tesio 031201a1ac kernel: reset process wakeups on exec 2017-05-15 00:35:22 +02:00
Giacomo Tesio f9b2e9aba4 kernel: generalize awake
Awake can now interrupt several blocking syscalls (even
during note handling).

Among others, it can interrupt await, pread and pwrite.

It cannot interrupt several others for different reasons:

- awake cannot be interrupted by awake;
- syscalls like remove and create can be used for kernel comunication
  and it would be hard to know if the effect occurred in the
  receiving fs if they were interrupted;
- other syscalls do not need awake since they just provide access
  to kernel infos (eg seek or fd2path)

NOTE: awakes registered before a note cannot occur during the note
handling and will be deferred till the next call to noted.
2017-05-15 00:05:59 +02:00
Giacomo Tesio 79f8204766 kern: move tsemaquire to userspace (given a generalized awake) 2017-05-12 11:13:19 +02:00
Giacomo Tesio 46664994d4 libposix: fix usleep 2017-05-12 11:13:08 +02:00
Giacomo Tesio aa4172a1de libposix: document timers 2017-05-08 23:46:19 +02:00
Giacomo Tesio a3791c88f7 libposix: add usleep 2017-05-08 23:45:46 +02:00
Giacomo Tesio d62ca1162f Merge branch 'libposix-new-signals' of https://bitbucket.org/tesio/jehanne into libposix-new-signals 2017-05-08 22:54:34 +02:00
Giacomo Tesio edc116ef45 libposix: documented new signal machinery 2017-05-08 00:43:35 +02:00
Giacomo Tesio 48ea61ab9c newlib: more tests for signals 2017-05-08 00:36:04 +02:00
Giacomo Tesio 333d5dcbcd Merge branch 'master' into libposix-new-signals 2017-05-07 19:44:47 +02:00
Giacomo Tesio 1263399c0b qa: check devproc start/stop ctl msg 2017-05-07 19:32:55 +02:00
Giacomo Tesio b08218529d devproc: can't wait for up to stop 2017-05-06 16:03:16 +02:00
Giacomo Tesio 8d5eb5914f libposix: fix default_signal_disposition 2017-05-06 13:33:08 +02:00
Giacomo Tesio da0381a213 libposix: big refactor of signal handling 2017-05-05 19:01:18 +02:00
Giacomo Tesio ecd6dddf86 qa/kern: ensure awake in signal handlers is not affected by sleep 2017-05-04 19:55:55 +02:00
Giacomo Tesio 0b193807b6 qa: ensure awake works correctly in signal handlers
Jehanne's notes (like Plan9 ones) are not reentrant.
Thus an alarm can not be used to interrupt a syscall in a note handler.

Awake instead works properly also in a note handler.
2017-05-04 01:07:32 +02:00
Giacomo Tesio bd8ced55f1 qa: fix CID 168327 and CID 168326 2017-05-04 00:22:50 +02:00
Giacomo Tesio ec8d3427b7 qa: fix newlib test (CID 168329 and CID 168328) 2017-05-04 00:17:19 +02:00
Giacomo Tesio 6480cd0293 newlib: fix kill and signal trampoline 2017-05-03 23:37:43 +02:00
Giacomo Tesio d29859684b libposix: complete POSIX_signal_execute 2017-05-03 03:02:56 +02:00
Giacomo Tesio 3b35743a64 qa: nested_note checks that notes are enqueued in kernel 2017-05-03 02:23:26 +02:00
Giacomo Tesio bd5063666f libposix: introduce POSIX_signal_execute and PosixSignalDisposition enum 2017-05-03 01:14:53 +02:00
Giacomo Tesio 47573e2122 newlib: add 201-signals (broken as no default action occurs in newlib) 2017-05-02 01:15:10 +02:00
Giacomo Tesio cf974abe0e libposix: (almost working) waitpid 2017-05-02 00:57:18 +02:00
Giacomo Tesio be7c067507 newlib: fix qa_exit_translator in qa tests 2017-05-02 00:18:52 +02:00
Giacomo Tesio 8c33c921b4 libposix: draft waitpid (still broken) 2017-05-01 23:57:05 +02:00
Giacomo Tesio 690a89d3ce newlib: add test for waitpid (to implement) 2017-05-01 12:03:49 +02:00