26 May 2008 19:46
sh3 mcontext change
Valeriy E. Ushakov <uwe <at> NetBSD.org>
2008-05-26 17:46:37 GMT
2008-05-26 17:46:37 GMT
With NetBSD 5.0 looming, I'd like to fix a problem with sh3 mcontext that's been there since the very beginning - it doesn't have a slot for GBR register. Currently kernel doesn't preserve GBR and userland doesn't use it either - unless you write you own asm code, in which case you lose - which is bad by itself already. And GBR is also used by TLS, though our ld.so doesn't support it yet. The problem of course is how to change mcontext without breaking ABI (sizeof(struct mcontext)). Fortunately, it seems we have a slot we can steal - we have _REG_EXPEVT slot in gregs and it seems it's unused. cpu_setmcontext() in the kernel doesn't set it for obvious reasons and as far as I can tell no code ever examines it - all kernel code that is interested in expevt uses trapframe for that. Userland code that might be interested in expevt (reason for the trap) already gets the same info via siginfo. So i would like to recycle that currently useless slot for GBR and thus avoid breaking ABI. Just in case - is there anything I'm missing here? Any objections/comments? SY, Uwe -- -- uwe <at> NetBSD.org | NetBSD/toaster: http://snark.ptc.spbu.ru/~uwe/ | we wish the toaster to be happy too(Continue reading)
RSS Feed