1 /* Copyright (c) 2015 Regents of the University of California
3 * Author: Brian Demsky <bdemsky@uci.edu>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
14 int model_swapcontext(ucontext_t *oucp, ucontext_t *ucp)
17 * Mac OSX swapcontext() clobbers some registers, so use a hand-rolled
18 * version with {get,set}context(). We can avoid the same problem
19 * (where optimizations can break the following code) because we don't
20 * statically link with the C library
23 /* volatile, so that 'i' doesn't get promoted to a register */