summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_hibernate.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-05-02 10:59:47 +0000
committerdlg <dlg@openbsd.org>2015-05-02 10:59:47 +0000
commit423042ddb9827fbafb9ca22cfdde3830cb8da11e (patch)
tree97b08f65518fd1eec2030d658f634fe49fd530a6 /sys/kern/subr_hibernate.c
parentadd missing splx calls (diff)
downloadwireguard-openbsd-423042ddb9827fbafb9ca22cfdde3830cb8da11e.tar.xz
wireguard-openbsd-423042ddb9827fbafb9ca22cfdde3830cb8da11e.zip
rework hppa mutexes.
this is largely based on src/sys/arch/alpha/alpha/mutex.c r1.14 and src/sys/arch/sgi/sgi/mutex.c r1.15 always and explicitely record which cpu owns the lock (or NULL if noone owns it). improve the mutex diagnostics/asserts so they operate on the mtx_owner field rather than mtx_lock. previously the asserts would assume the lock cpu owns the lock if any of them own the lock, which blows up badly. hppa hasnt got good atomic cpu opcodes, so this still relies on ldcws to serialise access to the lock. while im here i also shuffled the code. on MULTIPROCESSOR systems instead of duplicating code between mtx_enter and mtx_enter_try, mtx_enter simply loops on mtx_enter_try until it succeeds. this also provides an alternative implementation of mutexes on !MULTIPROCESSOR systems that avoids interlocking opcodes. mutexes wont contend on UP boxes, theyre basically wrappers around spls. we can just do the splraise, stash the owner as a guard value for DIAGNOSTIC and return. similarly, mtx_enter_try on UP will never fail, so we can just call mtx_enter and return 1. tested by and ok kettenis@ jsing@
Diffstat (limited to 'sys/kern/subr_hibernate.c')
0 files changed, 0 insertions, 0 deletions