> > Another problem with your patch is that I'd rather like avoid assuming
> > that the register buffer is an array of 8-byte registers.
>
> That code already assumems that, and that the values are little-endian.
>
> Yes it assumes little-endianness, but the assumptions on the size of
> the slots in the register buffer are weaker. The register buffer here
> corresponds to `struct reg' on the BSD's. It would be prefectly well
> possible for some of its members to be 4 bytes in size. The current
> code works for that case, whereas with your patch, it could thrash
> another member of the structure.
Do you know of any such an system?
Actually GNU/Linux x86-64 has a gregset_t where %cs, %fs and %gs are
stored in a short.
Could you live with just zero-extending the 16 general-purpose
registers and the instruction pointer? I'll implement it for you.