/* * fwts_acpi_init() * Initialise ACPIA engine and collect method namespace */ int fwts_acpi_init(fwts_framework *fw) { if (fwts_acpica_init(fw) != FWTS_OK) return FWTS_ERROR; /* Gather all object names */ fwts_object_names = fwts_acpica_get_object_names(0); fwts_acpi_initialized = true; return FWTS_OK; }
/* Test function that makes sure processors are under the _SB_ namespace. */ static int acpi_table_sbbr_namespace_check_test1(fwts_framework *fw) { int error_count = 0; /* Initializing ACPICA library so we can call AcpiWalkNamespace. */ if (fwts_acpica_init(fw) != FWTS_OK) return FWTS_ERROR; /* Searching for all processor devices in the namespace. */ AcpiWalkNamespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, processor_handler, NULL, NULL, (void **)&error_count); /* Deinitializing ACPICA, if we don't call this the terminal will break on exit. */ fwts_acpica_deinit(); /* error_count variable counts the number of processors outside of the _SB_ namespace. */ if (error_count > 0) fwts_failed(fw, LOG_LEVEL_HIGH, "SbbrAcpiCpuWrongNamespace", "%d Processor devices " "were found outside of the _SB_ namespace.", error_count); else fwts_passed(fw, "All processor devices were located in the _SB_ namespace."); return FWTS_OK; }