~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/asm-i386/mach-default/apm.h

Version: ~ [ linux-5.1-rc1 ] ~ [ linux-5.0.3 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.30 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.107 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.164 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.176 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.136 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  include/asm-i386/mach-default/apm.h
  3  *
  4  *  Machine specific APM BIOS functions for generic.
  5  *  Split out from apm.c by Osamu Tomita <tomita@cinet.co.jp>
  6  */
  7 
  8 #ifndef _ASM_APM_H
  9 #define _ASM_APM_H
 10 
 11 #ifdef APM_ZERO_SEGS
 12 #       define APM_DO_ZERO_SEGS \
 13                 "pushl %%ds\n\t" \
 14                 "pushl %%es\n\t" \
 15                 "xorl %%edx, %%edx\n\t" \
 16                 "mov %%dx, %%ds\n\t" \
 17                 "mov %%dx, %%es\n\t" \
 18                 "mov %%dx, %%fs\n\t" \
 19                 "mov %%dx, %%gs\n\t"
 20 #       define APM_DO_POP_SEGS \
 21                 "popl %%es\n\t" \
 22                 "popl %%ds\n\t"
 23 #else
 24 #       define APM_DO_ZERO_SEGS
 25 #       define APM_DO_POP_SEGS
 26 #endif
 27 
 28 static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
 29                                         u32 *eax, u32 *ebx, u32 *ecx,
 30                                         u32 *edx, u32 *esi)
 31 {
 32         /*
 33          * N.B. We do NOT need a cld after the BIOS call
 34          * because we always save and restore the flags.
 35          */
 36         __asm__ __volatile__(APM_DO_ZERO_SEGS
 37                 "pushl %%edi\n\t"
 38                 "pushl %%ebp\n\t"
 39                 "lcall *%%cs:apm_bios_entry\n\t"
 40                 "setc %%al\n\t"
 41                 "popl %%ebp\n\t"
 42                 "popl %%edi\n\t"
 43                 APM_DO_POP_SEGS
 44                 : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx),
 45                   "=S" (*esi)
 46                 : "a" (func), "b" (ebx_in), "c" (ecx_in)
 47                 : "memory", "cc");
 48 }
 49 
 50 static inline u8 apm_bios_call_simple_asm(u32 func, u32 ebx_in,
 51                                                 u32 ecx_in, u32 *eax)
 52 {
 53         int     cx, dx, si;
 54         u8      error;
 55 
 56         /*
 57          * N.B. We do NOT need a cld after the BIOS call
 58          * because we always save and restore the flags.
 59          */
 60         __asm__ __volatile__(APM_DO_ZERO_SEGS
 61                 "pushl %%edi\n\t"
 62                 "pushl %%ebp\n\t"
 63                 "lcall *%%cs:apm_bios_entry\n\t"
 64                 "setc %%bl\n\t"
 65                 "popl %%ebp\n\t"
 66                 "popl %%edi\n\t"
 67                 APM_DO_POP_SEGS
 68                 : "=a" (*eax), "=b" (error), "=c" (cx), "=d" (dx),
 69                   "=S" (si)
 70                 : "a" (func), "b" (ebx_in), "c" (ecx_in)
 71                 : "memory", "cc");
 72         return error;
 73 }
 74 
 75 #endif /* _ASM_APM_H */
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp