2 * Machine specific APM BIOS functions for generic.
3 * Split out from apm.c by Osamu Tomita <tomita@cinet.co.jp>
10 # define APM_DO_ZERO_SEGS \
13 "xorl %%edx, %%edx\n\t" \
14 "mov %%dx, %%ds\n\t" \
15 "mov %%dx, %%es\n\t" \
16 "mov %%dx, %%fs\n\t" \
18 # define APM_DO_POP_SEGS \
22 # define APM_DO_ZERO_SEGS
23 # define APM_DO_POP_SEGS
26 static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
27 u32 *eax, u32 *ebx, u32 *ecx,
31 * N.B. We do NOT need a cld after the BIOS call
32 * because we always save and restore the flags.
34 __asm__ __volatile__(APM_DO_ZERO_SEGS
37 "lcall *%%cs:apm_bios_entry\n\t"
42 : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx),
44 : "a" (func), "b" (ebx_in), "c" (ecx_in)
48 static inline u8 apm_bios_call_simple_asm(u32 func, u32 ebx_in,
55 * N.B. We do NOT need a cld after the BIOS call
56 * because we always save and restore the flags.
58 __asm__ __volatile__(APM_DO_ZERO_SEGS
61 "lcall *%%cs:apm_bios_entry\n\t"
66 : "=a" (*eax), "=b" (error), "=c" (cx), "=d" (dx),
68 : "a" (func), "b" (ebx_in), "c" (ecx_in)
73 #endif /* _ASM_APM_H */