Power off the computer using APM.
42 {
47
48
50 "adc %%edx,0\n\t" )
51 : "=a" ( apm_version ), "=b" ( apm_signature ),
52 "=c" ( apm_flags ),
"=d" (
carry )
53 : "a" ( 0x5300 ), "b" ( 0x0000 ),
54 "d" ( 0x0000 ) );
56 DBG (
"APM not present\n" );
58 }
59 if ( apm_signature != 0x504d ) {
60 DBG (
"APM not present\n" );
62 }
63 if ( apm_version < 0x0101 ) {
64 DBG (
"APM 1.1+ not supported\n" );
66 }
67 if ( ( apm_flags & 0x8 ) == 0x8 ) {
68 DBG (
"APM power management disabled\n" );
70 }
71 DBG2 (
"APM check completed\n" );
72
73
75 "adc %%edx,0\n\t" )
77 : "a" ( 0x5301 ), "b" ( 0x0000 ),
78 "d" ( 0x0000 ) );
80 DBG (
"APM initialisation failed\n" );
82 }
83 DBG2 (
"APM initialisation completed\n" );
84
85
87 "adc %%edx,0\n\t" )
89 : "a" ( 0x530e ), "b" ( 0x0000 ),
90 "c" ( 0x0101 ), "d" ( 0x0000 ) );
92 DBG (
"APM setting driver version failed\n" );
94 }
95 DBG2 (
"APM driver version set\n" );
96
97
99 "adc %%edx,0\n\t" )
101 : "a" ( 0x5307 ), "b" ( 0x0001 ),
102 "c" ( 0x0003 ), "d" ( 0x0000) );
104 DBG (
"APM setting power state failed\n" );
106 }
107
108
110}
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
#define DBG(...)
Print a debugging message.
#define EIO
Input/output error.
#define ENOTSUP
Operation not supported.
#define ECANCELED
Operation canceled.
#define ENOTTY
Inappropriate I/O control operation.
#define EPERM
Operation not permitted.
#define REAL_CODE(asm_code_str)
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")