| .. | .. |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Name: actypes.h - Common data types for the entire ACPI subsystem |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
|---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | *****************************************************************************/ |
|---|
| 9 | 9 | |
|---|
| .. | .. |
|---|
| 375 | 375 | |
|---|
| 376 | 376 | /* Names within the namespace are 4 bytes long */ |
|---|
| 377 | 377 | |
|---|
| 378 | | -#define ACPI_NAME_SIZE 4 |
|---|
| 378 | +#define ACPI_NAMESEG_SIZE 4 /* Fixed by ACPI spec */ |
|---|
| 379 | 379 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ |
|---|
| 380 | 380 | #define ACPI_PATH_SEPARATOR '.' |
|---|
| 381 | 381 | |
|---|
| .. | .. |
|---|
| 442 | 442 | |
|---|
| 443 | 443 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
|---|
| 444 | 444 | |
|---|
| 445 | | -typedef u8 acpi_owner_id; |
|---|
| 446 | | -#define ACPI_OWNER_ID_MAX 0xFF |
|---|
| 445 | +typedef u16 acpi_owner_id; |
|---|
| 446 | +#define ACPI_OWNER_ID_MAX 0xFFF /* 4095 possible owner IDs */ |
|---|
| 447 | 447 | |
|---|
| 448 | 448 | #define ACPI_INTEGER_BIT_SIZE 64 |
|---|
| 449 | 449 | #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ |
|---|
| .. | .. |
|---|
| 506 | 506 | |
|---|
| 507 | 507 | /* Pointer/Integer type conversions */ |
|---|
| 508 | 508 | |
|---|
| 509 | | -#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (acpi_size) (i)) |
|---|
| 509 | +#define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (acpi_size) (i)) |
|---|
| 510 | 510 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0) |
|---|
| 511 | 511 | #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0) |
|---|
| 512 | 512 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
|---|
| .. | .. |
|---|
| 515 | 515 | /* Optimizations for 4-character (32-bit) acpi_name manipulation */ |
|---|
| 516 | 516 | |
|---|
| 517 | 517 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
|---|
| 518 | | -#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) |
|---|
| 519 | | -#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) |
|---|
| 518 | +#define ACPI_COMPARE_NAMESEG(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) |
|---|
| 519 | +#define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) |
|---|
| 520 | 520 | #else |
|---|
| 521 | | -#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) |
|---|
| 522 | | -#define ACPI_MOVE_NAME(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) |
|---|
| 521 | +#define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE)) |
|---|
| 522 | +#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE)) |
|---|
| 523 | 523 | #endif |
|---|
| 524 | 524 | |
|---|
| 525 | 525 | /* Support for the special RSDP signature (8 characters) */ |
|---|
| 526 | 526 | |
|---|
| 527 | 527 | #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) |
|---|
| 528 | 528 | #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) |
|---|
| 529 | + |
|---|
| 530 | +/* Support for OEMx signature (x can be any character) */ |
|---|
| 531 | +#define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\ |
|---|
| 532 | + strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE) |
|---|
| 529 | 533 | |
|---|
| 530 | 534 | /* |
|---|
| 531 | 535 | * Algorithm to obtain access bit or byte width. |
|---|
| .. | .. |
|---|
| 620 | 624 | #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C |
|---|
| 621 | 625 | #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D |
|---|
| 622 | 626 | #define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E |
|---|
| 627 | +#define ACPI_NOTIFY_DISCONNECT_RECOVER (u8) 0x0F |
|---|
| 623 | 628 | |
|---|
| 624 | | -#define ACPI_GENERIC_NOTIFY_MAX 0x0E |
|---|
| 629 | +#define ACPI_GENERIC_NOTIFY_MAX 0x0F |
|---|
| 625 | 630 | #define ACPI_SPECIFIC_NOTIFY_MAX 0x84 |
|---|
| 626 | 631 | |
|---|
| 627 | 632 | /* |
|---|
| .. | .. |
|---|
| 816 | 821 | #define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8 |
|---|
| 817 | 822 | #define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9 |
|---|
| 818 | 823 | #define ACPI_ADR_SPACE_PLATFORM_COMM (acpi_adr_space_type) 10 |
|---|
| 824 | +#define ACPI_ADR_SPACE_PLATFORM_RT (acpi_adr_space_type) 11 |
|---|
| 819 | 825 | |
|---|
| 820 | | -#define ACPI_NUM_PREDEFINED_REGIONS 11 |
|---|
| 826 | +#define ACPI_NUM_PREDEFINED_REGIONS 12 |
|---|
| 821 | 827 | |
|---|
| 822 | 828 | /* |
|---|
| 823 | 829 | * Special Address Spaces |
|---|
| 824 | 830 | * |
|---|
| 825 | 831 | * Note: A Data Table region is a special type of operation region |
|---|
| 826 | 832 | * that has its own AML opcode. However, internally, the AML |
|---|
| 827 | | - * interpreter simply creates an operation region with an an address |
|---|
| 833 | + * interpreter simply creates an operation region with an address |
|---|
| 828 | 834 | * space type of ACPI_ADR_SPACE_DATA_TABLE. |
|---|
| 829 | 835 | */ |
|---|
| 830 | 836 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 0x7E /* Internal to ACPICA only */ |
|---|
| .. | .. |
|---|
| 887 | 893 | |
|---|
| 888 | 894 | #define ACPI_ENABLE_EVENT 1 |
|---|
| 889 | 895 | #define ACPI_DISABLE_EVENT 0 |
|---|
| 890 | | - |
|---|
| 891 | | -/* Sleep function dispatch */ |
|---|
| 892 | | - |
|---|
| 893 | | -typedef acpi_status (*acpi_sleep_function) (u8 sleep_state); |
|---|
| 894 | | - |
|---|
| 895 | | -struct acpi_sleep_functions { |
|---|
| 896 | | - acpi_sleep_function legacy_function; |
|---|
| 897 | | - acpi_sleep_function extended_function; |
|---|
| 898 | | -}; |
|---|
| 899 | 896 | |
|---|
| 900 | 897 | /* |
|---|
| 901 | 898 | * External ACPI object definition |
|---|
| .. | .. |
|---|
| 1155 | 1152 | struct acpi_pnp_device_id_list { |
|---|
| 1156 | 1153 | u32 count; /* Number of IDs in Ids array */ |
|---|
| 1157 | 1154 | u32 list_size; /* Size of list, including ID strings */ |
|---|
| 1158 | | - struct acpi_pnp_device_id ids[1]; /* ID array */ |
|---|
| 1155 | + struct acpi_pnp_device_id ids[]; /* ID array */ |
|---|
| 1159 | 1156 | }; |
|---|
| 1160 | 1157 | |
|---|
| 1161 | 1158 | /* |
|---|
| .. | .. |
|---|
| 1210 | 1207 | u16 function; |
|---|
| 1211 | 1208 | }; |
|---|
| 1212 | 1209 | |
|---|
| 1210 | +struct acpi_mem_mapping { |
|---|
| 1211 | + acpi_physical_address physical_address; |
|---|
| 1212 | + u8 *logical_address; |
|---|
| 1213 | + acpi_size length; |
|---|
| 1214 | + struct acpi_mem_mapping *next_mm; |
|---|
| 1215 | +}; |
|---|
| 1216 | + |
|---|
| 1213 | 1217 | struct acpi_mem_space_context { |
|---|
| 1214 | 1218 | u32 length; |
|---|
| 1215 | 1219 | acpi_physical_address address; |
|---|
| 1216 | | - acpi_physical_address mapped_physical_address; |
|---|
| 1217 | | - u8 *mapped_logical_address; |
|---|
| 1218 | | - acpi_size mapped_length; |
|---|
| 1220 | + struct acpi_mem_mapping *cur_mm; |
|---|
| 1221 | + struct acpi_mem_mapping *first_mm; |
|---|
| 1219 | 1222 | }; |
|---|
| 1220 | 1223 | |
|---|
| 1221 | 1224 | /* |
|---|
| .. | .. |
|---|
| 1276 | 1279 | #define ACPI_OSI_WIN_VISTA_SP2 0x0A |
|---|
| 1277 | 1280 | #define ACPI_OSI_WIN_7 0x0B |
|---|
| 1278 | 1281 | #define ACPI_OSI_WIN_8 0x0C |
|---|
| 1279 | | -#define ACPI_OSI_WIN_10 0x0D |
|---|
| 1280 | | -#define ACPI_OSI_WIN_10_RS1 0x0E |
|---|
| 1281 | | -#define ACPI_OSI_WIN_10_RS2 0x0F |
|---|
| 1282 | | -#define ACPI_OSI_WIN_10_RS3 0x10 |
|---|
| 1282 | +#define ACPI_OSI_WIN_8_1 0x0D |
|---|
| 1283 | +#define ACPI_OSI_WIN_10 0x0E |
|---|
| 1284 | +#define ACPI_OSI_WIN_10_RS1 0x0F |
|---|
| 1285 | +#define ACPI_OSI_WIN_10_RS2 0x10 |
|---|
| 1286 | +#define ACPI_OSI_WIN_10_RS3 0x11 |
|---|
| 1287 | +#define ACPI_OSI_WIN_10_RS4 0x12 |
|---|
| 1288 | +#define ACPI_OSI_WIN_10_RS5 0x13 |
|---|
| 1289 | +#define ACPI_OSI_WIN_10_19H1 0x14 |
|---|
| 1283 | 1290 | |
|---|
| 1284 | 1291 | /* Definitions of getopt */ |
|---|
| 1285 | 1292 | |
|---|