40 #define colour FADT_SIGNATURE 43 #define S5_SIGNATURE ACPI_SIGNATURE ( '_', 'S', '5', '_' ) 67 unsigned int *sx =
data;
81 DBGC (
colour,
"ACPI found \\_Sx containing %02x:%02x:%02x:%02x\n",
103 *sx |= ( *
byte << 8 );
118 unsigned int pm1a_cnt;
119 unsigned int pm1b_cnt;
120 unsigned int slp_typa;
121 unsigned int slp_typb;
128 DBGC (
colour,
"ACPI could not find FADT\n" );
142 DBGC (
colour,
"ACPI could not extract \\_S5: %s\n",
149 slp_typa = ( ( s5 >> 0 ) & 0xff );
150 DBGC (
colour,
"ACPI PM1a sleep type %#x => %04x\n",
151 slp_typa, pm1a_cnt );
156 slp_typb = ( ( s5 >> 8 ) & 0xff );
157 DBGC (
colour,
"ACPI PM1b sleep type %#x => %04x\n",
158 slp_typb, pm1b_cnt );
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
int acpi_poweroff(void)
Power off the computer using ACPI.
#define le32_to_cpu(value)
#define outw(data, io_addr)
#define ACPI_PM1_CNT
ACPI PM1 Control Register (within PM1a_CNT_BLK or PM1A_CNT_BLK)
static int acpi_extract_sx(userptr_t zsdt, size_t len, size_t offset, void *data)
Extract _Sx value from DSDT/SSDT.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
userptr_t acpi_table(uint32_t signature, unsigned int index)
Locate ACPI table.
#define ENOENT
No such file or directory.
#define colour
Colour for debug messages.
int acpi_extract(uint32_t signature, void *data, int(*extract)(userptr_t zsdt, size_t len, size_t offset, void *data))
Extract value from DSDT/SSDT.
uint32_t userptr_t
A pointer to a user buffer.
Fixed ACPI Description Table (FADT)
#define FADT_SIGNATURE
Fixed ACPI Description Table (FADT) signature.
uint32_t pm1a_cnt_blk
PM1a Control Register Block.
#define ACPI_PM1_CNT_SLP_EN
Sleep enable.
#define EPROTO
Protocol error.
char * strerror(int errno)
Retrieve string representation of error number.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
#define ACPI_PM1_CNT_SLP_TYP(x)
Sleep type.
uint32_t pm1b_cnt_blk
PM1b Control Register Block.
#define S5_SIGNATURE
S5 signature
uint8_t data[48]
Additional event data.
uint16_t offset
Offset to command line.