* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
}
/* Latency or Bandwidth Entries */
- entry_list = g_malloc0(num_initiator * num_target * sizeof(uint16_t));
+ entry_list = g_new0(uint16_t, num_initiator * num_target);
for (i = 0; i < hmat_lb->list->len; i++) {
lb_data = &g_array_index(hmat_lb->list, HMAT_LB_Data, i);
index = lb_data->initiator * num_target + lb_data->target;
HMAT_LB_Info *hmat_lb;
NumaHmatCacheOptions *hmat_cache;
+ build_append_int_noprefix(table_data, 0, 4); /* Reserved */
+
for (i = 0; i < numa_state->num_nodes; i++) {
flags = 0;
}
}
-void build_hmat(GArray *table_data, BIOSLinker *linker, NumaState *numa_state)
+void build_hmat(GArray *table_data, BIOSLinker *linker, NumaState *numa_state,
+ const char *oem_id, const char *oem_table_id)
{
- int hmat_start = table_data->len;
-
- /* reserve space for HMAT header */
- acpi_data_push(table_data, 40);
+ AcpiTable table = { .sig = "HMAT", .rev = 2,
+ .oem_id = oem_id, .oem_table_id = oem_table_id };
+ acpi_table_begin(&table, table_data);
hmat_build_table_structs(table_data, numa_state);
-
- build_header(linker, table_data,
- (void *)(table_data->data + hmat_start),
- "HMAT", table_data->len - hmat_start, 2, NULL, NULL);
+ acpi_table_end(linker, &table);
}