Mail Archives: djgpp/2000/03/25/06:59:15
David Cleaver wrote:
>> > farptrx.h:13: Invalid 'asm' statement:
>> > farptrx.h:13: fixed or forbidden register 2 (cx) was spilled for
>> > class CREG.
[...]
>extern __inline__ void _farpokex (unsigned short selector, unsigned long
>offset, void *x, int len)
>{
> __asm__ __volatile__ ("pushl %%es\n"
> "movw %w0, %%es\n"
> "rep\n"
> "movsb\n"
> "popl %%es"
> :
> : "rm" (selector), "S" (x), "D" (offset), "c" (len)
> : "%ecx", "%edi", "%esi");
>}
Try the following (untested).
extern __inline__ void _farpokex (unsigned short selector,
unsigned long offset,
void *x, int len)
{
__asm__ __volatile__ ("pushl %%es\n"
"movw %w3, %%es\n"
"rep\n"
"movsb\n"
"popl %%es"
: "=S" (x), "=D" (offset), "=c" (len)
: "r" (selector), "0" (x), "1" (offset), "2" (len));
}
But I wonder, whether it is allowed, to change es without
wrapping it into cli/sti pairs. (An ISR may assume stanard es)
-- Regards, Dieter
- Raw text -