7 static inline uint32_t eflags(void)
11 #if __SIZEOF_POINTER__ == 4
13 asm volatile("pushfl ; popl %0" : "=rm" (v
));
14 #elif __SIZEOF_POINTER__ == 8
16 asm volatile("pushfq ; pop %0" : "=rm" (v
));
18 #error "Unable to build for to-be-defined architecture type"
23 void __farcall(uint16_t cs
, uint16_t ip
,
24 const com32sys_t
* ireg
, com32sys_t
* oreg
)
26 com32sys_t xreg
= *ireg
;
28 /* Enable interrupts if and only if they are enabled in the caller */
29 xreg
.eflags
.l
= (xreg
.eflags
.l
& ~EFLAGS_IF
) | (eflags() & EFLAGS_IF
);
31 __com32
.cs_farcall((cs
<< 16) + ip
, &xreg
, oreg
);