74 #define DATA(...) { __VA_ARGS__ } 77 #define ACPI_TABLE( name, SIGNATURE, DATA ) \ 78 static const uint8_t name ## _data[] = DATA; \ 79 static struct acpi_test_table name = { \ 83 .data = name ## _data, \ 87 #define ACPI_TABLES( name, ... ) \ 88 static struct acpi_test_table * name ## _table[] = \ 90 static struct acpi_test_tables name = { \ 91 .table = name ## _table, \ 92 .count = ( sizeof ( name ## _table ) / \ 93 sizeof ( name ## _table[0] ) ), \ 97 #define ACPI_MAC( name, TABLES, EXPECTED ) \ 98 static struct acpi_mac_test name = { \ 100 .expected = EXPECTED, \ 114 DATA ( 0x53, 0x53, 0x44, 0x54, 0x5d, 0x00, 0x00, 0x00, 0x02,
115 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
117 0x00, 0x49, 0x4e, 0x54, 0x4c, 0x04, 0x06, 0x21, 0x20,
118 0x10, 0x38, 0x5c, 0x5f, 0x53, 0x42, 0x5f, 0x14, 0x08,
119 0x48, 0x57, 0x30, 0x30, 0x08, 0xa4, 0x00, 0x14, 0x1e,
120 0x41, 0x4d, 0x41, 0x43, 0x08, 0x0d, 0x5f, 0x41, 0x55,
121 0x58, 0x4d, 0x41, 0x43, 0x5f, 0x23, 0x35, 0x32, 0x35,
122 0x34, 0x30, 0x30, 0x61, 0x61, 0x62, 0x62, 0x63, 0x63,
123 0x23, 0x00, 0x14, 0x09, 0x48, 0x57, 0x34, 0x32, 0x08,
124 0xa4, 0x0a, 0x2a ) );
131 DATA ( 0x52, 0x54, 0x00, 0xaa, 0xbb, 0xcc ) );
135 DATA ( 0x53, 0x53, 0x44, 0x54, 0x3e, 0x00, 0x00, 0x00, 0x02,
136 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138 0x00, 0x49, 0x4e, 0x54, 0x4c, 0x04, 0x06, 0x21, 0x20,
139 0x10, 0x19, 0x5c, 0x5f, 0x53, 0x42, 0x5f, 0x14, 0x08,
140 0x48, 0x57, 0x30, 0x30, 0x08, 0xa4, 0x00, 0x14, 0x09,
141 0x48, 0x57, 0x34, 0x32, 0x08, 0xa4, 0x0a, 0x2a ) );
145 DATA ( 0x53, 0x53, 0x44, 0x54, 0x54, 0x00, 0x00, 0x00, 0x02,
146 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
148 0x00, 0x49, 0x4e, 0x54, 0x4c, 0x04, 0x06, 0x21, 0x20,
149 0x10, 0x2f, 0x5c, 0x5f, 0x53, 0x42, 0x5f, 0x14, 0x1e,
150 0x4d, 0x41, 0x43, 0x41, 0x08, 0x0d, 0x5f, 0x41, 0x55,
151 0x58, 0x4d, 0x41, 0x43, 0x5f, 0x23, 0x35, 0x32, 0x35,
152 0x34, 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33,
153 0x23, 0x00, 0x14, 0x09, 0x48, 0x57, 0x39, 0x39, 0x08,
154 0xa4, 0x0a, 0x63 ) );
157 ACPI_TABLES ( maca_tables, &maca_ssdt1, &maca_ssdt2 );
161 DATA ( 0x52, 0x54, 0x00, 0x11, 0x22, 0x33 ) );
165 DATA ( 0x53, 0x53, 0x44, 0x54, 0x44, 0x00, 0x00, 0x00, 0x02,
166 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
168 0x00, 0x49, 0x4e, 0x54, 0x4c, 0x04, 0x06, 0x21, 0x20,
169 0x10, 0x1f, 0x5c, 0x5f, 0x53, 0x42, 0x5f, 0x14, 0x18,
170 0x52, 0x54, 0x4d, 0x41, 0x08, 0x0d, 0x5f, 0x52, 0x54,
171 0x58, 0x4d, 0x41, 0x43, 0x5f, 0x23, 0x52, 0x54, 0x30,
172 0x30, 0x30, 0x31, 0x23, 0x00 ) );
179 DATA ( 0x52, 0x54, 0x30, 0x30, 0x30, 0x31 ) );
192 unsigned int index ) {
223 const char *file,
unsigned int line ) {
232 okx (
rc == 0, file, line );
240 #define acpi_mac_ok( test ) \ 241 acpi_mac_okx ( test, __FILE__, __LINE__ ) struct arbelprm_rc_send_wqe rc
static const struct acpi_header * acpi_test_find(uint32_t signature, unsigned int index)
Locate ACPI test table.
#define le32_to_cpu(value)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const struct acpi_header *(* acpi_finder)(uint32_t signature, unsigned int index)
struct acpi_test_table ** table
Tables.
An ACPI MAC extraction test.
#define ACPI_MAC(name, TABLES, EXPECTED)
Define an ACPI MAC extraction test.
typeof(acpi_find)
Override ACPI table finder.
struct self_test acpi_test __self_test
ACPI self-test.
Self-test infrastructure.
const char * name
Test set name.
static acpi_find(uint32_t signature, unsigned int index)
Locate ACPI table.
uint8_t mac[ETH_ALEN]
MAC address.
uint8_t expected[ETH_ALEN]
Expected MAC address.
An ACPI test table signature.
int acpi_mac(uint8_t *hw_addr)
Extract MAC address from DSDT/SSDT.
#define okx(success, file, line)
Report test result.
unsigned int count
Number of tables.
#define ACPI_TABLES(name,...)
Define an ACPI test table set.
static struct acpi_test_tables * acpi_test_tables
Current ACPI test table set.
union acpi_test_signature signature
Signature.
struct acpi_test_tables * tables
ACPI test table set.
#define acpi_mac_ok(test)
#define DATA(...)
Define inline data.
u8 signature
CPU signature.
#define ACPI_TABLE(name, SIGNATURE, DATA)
Define an ACPI test table.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
static void acpi_test_exec(void)
Perform ACPI self-test.
const void * data
Table content.