hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/acpi/actypes.h
....@@ -3,7 +3,7 @@
33 *
44 * Name: actypes.h - Common data types for the entire ACPI subsystem
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -375,7 +375,7 @@
375375
376376 /* Names within the namespace are 4 bytes long */
377377
378
-#define ACPI_NAME_SIZE 4
378
+#define ACPI_NAMESEG_SIZE 4 /* Fixed by ACPI spec */
379379 #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
380380 #define ACPI_PATH_SEPARATOR '.'
381381
....@@ -442,8 +442,8 @@
442442
443443 /* Owner IDs are used to track namespace nodes for selective deletion */
444444
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 */
447447
448448 #define ACPI_INTEGER_BIT_SIZE 64
449449 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
....@@ -506,7 +506,7 @@
506506
507507 /* Pointer/Integer type conversions */
508508
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))
510510 #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
511511 #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
512512 #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
....@@ -515,17 +515,21 @@
515515 /* Optimizations for 4-character (32-bit) acpi_name manipulation */
516516
517517 #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)))
520520 #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))
523523 #endif
524524
525525 /* Support for the special RSDP signature (8 characters) */
526526
527527 #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
528528 #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)
529533
530534 /*
531535 * Algorithm to obtain access bit or byte width.
....@@ -620,8 +624,9 @@
620624 #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
621625 #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
622626 #define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E
627
+#define ACPI_NOTIFY_DISCONNECT_RECOVER (u8) 0x0F
623628
624
-#define ACPI_GENERIC_NOTIFY_MAX 0x0E
629
+#define ACPI_GENERIC_NOTIFY_MAX 0x0F
625630 #define ACPI_SPECIFIC_NOTIFY_MAX 0x84
626631
627632 /*
....@@ -816,15 +821,16 @@
816821 #define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8
817822 #define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9
818823 #define ACPI_ADR_SPACE_PLATFORM_COMM (acpi_adr_space_type) 10
824
+#define ACPI_ADR_SPACE_PLATFORM_RT (acpi_adr_space_type) 11
819825
820
-#define ACPI_NUM_PREDEFINED_REGIONS 11
826
+#define ACPI_NUM_PREDEFINED_REGIONS 12
821827
822828 /*
823829 * Special Address Spaces
824830 *
825831 * Note: A Data Table region is a special type of operation region
826832 * 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
828834 * space type of ACPI_ADR_SPACE_DATA_TABLE.
829835 */
830836 #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 0x7E /* Internal to ACPICA only */
....@@ -887,15 +893,6 @@
887893
888894 #define ACPI_ENABLE_EVENT 1
889895 #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
-};
899896
900897 /*
901898 * External ACPI object definition
....@@ -1155,7 +1152,7 @@
11551152 struct acpi_pnp_device_id_list {
11561153 u32 count; /* Number of IDs in Ids array */
11571154 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 */
11591156 };
11601157
11611158 /*
....@@ -1210,12 +1207,18 @@
12101207 u16 function;
12111208 };
12121209
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
+
12131217 struct acpi_mem_space_context {
12141218 u32 length;
12151219 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;
12191222 };
12201223
12211224 /*
....@@ -1276,10 +1279,14 @@
12761279 #define ACPI_OSI_WIN_VISTA_SP2 0x0A
12771280 #define ACPI_OSI_WIN_7 0x0B
12781281 #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
12831290
12841291 /* Definitions of getopt */
12851292