There's a bunch of code that takes the addresses of xfmem and xfregs and manipulates them; I managed to get very confused trying to merge them.  That said, I'm a little more confident I understand the code now; I'll try again.