plan9fox/sys/src/ape
cinap_lenrek 2c5c784255 prof: properly save and restore RARG for amd64
amd64 passes first argument in RARG (BP) register
which has the be preserved duing _profin() and
_profout() calls. to handle this we introduce
_saveret() and _savearg(). _saveret() returns
AX, _savearg() returns RARG (BP). for archs other
and amd64, _saveret() and _savearg() are the
same function, doing nothing.

restoing works with dummy function:

uintptr
_restore(uintptr, uintptr ret)
{
	return ret;
}

...

ret = _saveret();
arg = _savearg();
...
return _restore(arg, ret);

as we pass arg as the first argument, RARG (BP) is
restored.
2014-02-17 13:25:24 +01:00
..
9src Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
cmd ape/mv: check if from path fits and error if too long 2012-12-04 06:06:28 +01:00
lib prof: properly save and restore RARG for amd64 2014-02-17 13:25:24 +01:00
config Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
mkfile ape/mkfile: work arround fake "command line arguments" rule matching 2012-08-08 21:36:42 +02:00