diff -Nru fwts-0.26.05/debian/changelog fwts-0.26.06/debian/changelog --- fwts-0.26.05/debian/changelog 2013-02-07 01:36:32.000000000 +0000 +++ fwts-0.26.06/debian/changelog 2013-02-21 08:27:13.000000000 +0000 @@ -1,3 +1,23 @@ +fwts (0.26.06-0ubuntu1) raring; urgency=low + + [Alex Hung] + * lib: fwts_ioport: fix calling unmatched I/O function in a help function. + + [Colin Ian King] + * lib: fwts_ioport: add dummy stubs for non-x86 arch + * acpica: fwts_acpica: remove fwtsInstallLateHandlers + * acpi: wmi: re-write to eval _WDG rather than parse AML + * acpi: method: print out BCL brightness levels rather than dump the object + * cpu: cpufreq: tidy up information message formatting + + [Ivan Hu] + * wmi.c: fix build error when using gcc 4.6.3 + + [Keng-Yu Lin] + * debian: add fwts-efi-runtime-dkms package in the dependency + + -- Keng-Yu Lin Thu, 21 Feb 2013 14:54:18 +0800 + fwts (0.26.05-0ubuntu1) raring; urgency=low [Colin Ian King] diff -Nru fwts-0.26.05/debian/control fwts-0.26.06/debian/control --- fwts-0.26.05/debian/control 2013-02-07 01:36:32.000000000 +0000 +++ fwts-0.26.06/debian/control 2013-02-21 08:27:13.000000000 +0000 @@ -8,7 +8,7 @@ Package: fwts Architecture: any -Depends: libfwtsiasl1 (= ${binary:Version}), libfwtsacpica1 (= ${binary:Version}), libfwts1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, pciutils +Depends: libfwtsiasl1 (= ${binary:Version}), libfwtsacpica1 (= ${binary:Version}), libfwts1 (= ${binary:Version}), fwts-efi-runtime-dkms (= ${binary:Version}) [amd64] , ${shlibs:Depends}, ${misc:Depends}, pciutils Suggests: dmidecode, net-tools, wireless-tools, bluez, xinput, pulseaudio-utils Description: FirmWare Test Suite This is a firmware test suite that performs sanity checks on Intel/AMD diff -Nru fwts-0.26.05/src/acpi/method/method.c fwts-0.26.06/src/acpi/method/method.c --- fwts-0.26.05/src/acpi/method/method.c 2013-02-07 01:14:47.000000000 +0000 +++ fwts-0.26.06/src/acpi/method/method.c 2013-02-21 06:55:10.000000000 +0000 @@ -4560,6 +4560,7 @@ uint32_t i; bool failed = false; bool ascending_levels = false; + char *str = NULL; FWTS_UNUSED(private); @@ -4572,8 +4573,6 @@ if (method_package_elements_all_type(fw, name, "_BCL", obj, ACPI_TYPE_INTEGER) != FWTS_OK) return; - fwts_acpi_object_dump(fw, obj); - if (obj->Package.Elements[0].Integer.Value < obj->Package.Elements[1].Integer.Value) { fwts_failed(fw, LOG_LEVEL_MEDIUM, @@ -4614,6 +4613,24 @@ failed = true; } + fwts_log_info(fw, "Brightness levels for %s:" ,name); + fwts_log_info_verbatum(fw, " Level on full power : %" PRIu64, obj->Package.Elements[0].Integer.Value); + fwts_log_info_verbatum(fw, " Level on battery power: %" PRIu64, obj->Package.Elements[1].Integer.Value); + for (i = 2; i < obj->Package.Count; i++) { + char tmp[12]; + + snprintf(tmp, sizeof(tmp), "%s%" PRIu64, + i == 2 ? "" : ", ", + obj->Package.Elements[i].Integer.Value); + str = fwts_realloc_strcat(str, tmp); + if (!str) + break; + } + if (str) { + fwts_log_info_verbatum(fw, " Brightness Levels : %s", str); + free(str); + } + if (failed) fwts_advice(fw, "%s seems to be " diff -Nru fwts-0.26.05/src/acpi/wmi/wmi.c fwts-0.26.06/src/acpi/wmi/wmi.c --- fwts-0.26.05/src/acpi/wmi/wmi.c 2013-02-07 01:14:47.000000000 +0000 +++ fwts-0.26.06/src/acpi/wmi/wmi.c 2013-02-21 06:55:10.000000000 +0000 @@ -27,6 +27,12 @@ #include #include #include +#include +#include + +/* acpica headers */ +#include "acpi.h" +#include "fwts_acpi_object_eval.h" typedef enum { FWTS_WMI_EXPENSIVE = 0x00000001, @@ -36,9 +42,14 @@ } fwts_wmi_flags; typedef struct { - char *guid; - char *driver; - char *vendor; + const fwts_wmi_flags flags; + const char *name; +} fwts_wmi_flags_name; + +typedef struct { + const char *guid; /* GUID string */ + const char *driver; /* Kernel Driver name */ + const char *vendor; /* Machine Vendor */ } fwts_wmi_known_guid; /* @@ -50,13 +61,16 @@ uint8_t obj_id[2]; /* Object Identifier */ struct { uint8_t notify_id; /* Notify Identifier */ - uint8_t reserved; /* Reserved? */ + uint8_t reserved; /* Reserved */ }; }; uint8_t instance; /* Instance */ uint8_t flags; /* fwts_wmi_flags */ -} __attribute__ ((packed)) fwts_guid_info; +} __attribute__ ((packed)) fwts_wdg_info; +/* + * Bunch of known WMI GUIDs in the kernel + */ static fwts_wmi_known_guid fwts_wmi_known_guids[] = { { "67C3371D-95A3-4C37-BB61-DD47B491DAAB", "acer-wmi", "Acer" }, { "431F16ED-0C2B-444C-B267-27DEB140CF9C", "acer-wmi", "Acer" }, @@ -77,6 +91,46 @@ { NULL, NULL, NULL } }; +/* + * WMI flag to text mappings + */ +static const fwts_wmi_flags_name wmi_flags_name[] = { + { FWTS_WMI_EXPENSIVE, "Expensive" }, + { FWTS_WMI_METHOD, "Method" }, + { FWTS_WMI_STRING, "String" }, + { FWTS_WMI_EVENT, "Event" }, + { 0, NULL } +}; + +static bool wmi_advice_given; + +/* + * wmi_init() + * initialize ACPI + */ +static int wmi_init(fwts_framework *fw) +{ + if (fwts_acpi_init(fw) != FWTS_OK) { + fwts_log_error(fw, "Cannot initialise ACPI."); + return FWTS_ERROR; + } + + return FWTS_OK; +} + +/* + * wmi_deinit() + * de-intialize ACPI + */ +static int wmi_deinit(fwts_framework *fw) +{ + return fwts_acpi_deinit(fw); +} + +/* + * fwts_wmi_known_guid() + * find any known GUID driver info + */ static fwts_wmi_known_guid *wmi_find_guid(char *guid) { fwts_wmi_known_guid *info = fwts_wmi_known_guids; @@ -88,296 +142,268 @@ return NULL; } -#define CONSUME_WHITESPACE(str) \ - while (*str && isspace(*str)) \ - str++; \ - if (*str == '\0') return; \ +/* + * wmi_strncat() + * build up a description of flag settings + */ +static char *wmi_strncat(char *dst, const char *str, const size_t dst_len) +{ + if (*dst) + strncat(dst, " | ", dst_len); + + return strncat(dst, str, dst_len); +} +/* + * wmi_wdg_flags_to_text() + * turn WDG flags into a description string + */ static char *wmi_wdg_flags_to_text(const fwts_wmi_flags flags) { - static char buffer[256]; + static char buffer[1024]; + int i; *buffer = 0; - if (flags & FWTS_WMI_EXPENSIVE) - strcat(buffer, "WMI_EXPENSIVE "); - if (flags & FWTS_WMI_METHOD) - strcat(buffer, "WMI_METHOD"); - if (flags & FWTS_WMI_STRING) - strcat(buffer, "WMI_STRING"); - if (flags & FWTS_WMI_EVENT) - strcat(buffer, "WMI_EVENT "); + for (i = 0; wmi_flags_name[i].flags; i++) + if (flags & wmi_flags_name[i].flags) + wmi_strncat(buffer, wmi_flags_name[i].name, sizeof(buffer) - 1); + + if (!*buffer) + strncpy(buffer, "None", sizeof(buffer) - 1); return buffer; } -static void wmi_parse_wdg_data(fwts_framework *fw, - const size_t size, const uint8_t *wdg_data, bool *result) +/* + * wmi_method_exist_count() + * check if an associated method exists for the WDG object + */ +static void wmi_method_exist_count( + fwts_framework *fw, + const fwts_wdg_info *info, + const char *guid_str) { - size_t i; - int advice_given = 0; - - fwts_guid_info *info = (fwts_guid_info *)wdg_data; - - for (i=0; i<(size / sizeof(fwts_guid_info)); i++) { - uint8_t *guid = info->guid; - char guidstr[37]; - fwts_wmi_known_guid *known; - - fwts_guid_buf_to_str(guid, guidstr, sizeof(guidstr)); - - known = wmi_find_guid(guidstr); - - if (info->flags & FWTS_WMI_METHOD) { - fwts_log_info(fw, - "Found WMI Method WM%c%c with GUID: %s, " - "Instance 0x%2.2x", - info->obj_id[0], info->obj_id[1], - guidstr, info->instance); - } else if (info->flags & FWTS_WMI_EVENT) { - fwts_log_info(fw, - "Found WMI Event, Notifier ID: 0x%2.2x, " - "GUID: %s, Instance 0x%2.2x", - info->notify_id, guidstr, info->instance); - if (known == NULL) { - fwts_failed(fw, LOG_LEVEL_MEDIUM, - "WMIUnknownGUID", - "GUID %s is unknown to the kernel, " - "a driver may need to be implemented " - "for this GUID.", guidstr); - *result = true; - if (!advice_given) { - advice_given = 1; - fwts_log_nl(fw); - fwts_log_advice(fw, - "ADVICE: A WMI driver probably " - "needs to be written for this " - "event."); - fwts_log_advice(fw, - "It can checked for using: " - "wmi_has_guid(\"%s\").", - guidstr); - fwts_log_advice(fw, - "One can install a notify " - "handler using " - "wmi_install_notify_handler" - "(\"%s\", handler, NULL). ", - guidstr); - fwts_log_advice(fw, - "http://lwn.net/Articles/391230" - " describes how to write an " - "appropriate driver."); - fwts_log_nl(fw); - } - } - } else { - char *flags = wmi_wdg_flags_to_text(info->flags); - fwts_log_info(fw, - "Found WMI Object, Object ID %c%c, " - "GUID: %s, Instance 0x%2.2x, Flags: %2.2x %s", - info->obj_id[0], info->obj_id[1], guidstr, - info->instance, info->flags, flags); + fwts_list_link *item; + fwts_list *objects; + const size_t wm_name_len = 4; + char wm_name[5]; + char *objname = ""; + int count = 0; + + snprintf(wm_name, sizeof(wm_name), "WM%c%c", + info->obj_id[0], info->obj_id[1]); + + if ((objects = fwts_acpi_object_get_names()) == NULL) + return; /* Should not ever happen, bail out if it does */ + + fwts_list_foreach(item, objects) { + char *name = fwts_list_data(char*, item); + const size_t name_len = strlen(name); + if (strncmp(wm_name, name + name_len - wm_name_len, wm_name_len) == 0) { + objname = name; + count++; } - - if (known) { - fwts_passed(fw, - "GUID %s is handled by driver %s (Vendor: %s).", - guidstr, known->driver, known->vendor); - *result = true; - } - - info++; } + + if (count == 0) { + fwts_failed(fw, LOG_LEVEL_LOW, + "WMIMissingMethod", + "GUID %s should have an associated method WM%c%c defined, " + "however this does not seem to exist.", + guid_str, info->obj_id[0], info->obj_id[1]); + } else if (count > 1) { + fwts_failed(fw, LOG_LEVEL_LOW, + "WMIMultipleMethod", + "GUID %s has multiple associated methods WM%c%c defined, " + "this is a firmware bug that leads to ambigous behaviour.", + guid_str, info->obj_id[0], info->obj_id[1]); + } else + fwts_passed(fw, "%s has associated method %s", guid_str, objname); } -static void wmi_get_wdg_data(fwts_framework *fw, - fwts_list_link *item, const size_t size, uint8_t *wdg_data) +/* + * wmi_no_known_driver() + * grumble that the kernel does not have a known handler for this GUID + */ +static void wmi_no_known_driver( + fwts_framework *fw, + const char *guid_str) { - char *str; - uint8_t *data = wdg_data; - - for (;item != NULL; item=item->next) { - int i; - str = fwts_text_list_text(item); - CONSUME_WHITESPACE(str); - - if (*str == '}') break; - - if (strncmp(str, "/*", 2) == 0) { - str = strstr(str, "*/"); - if (str) - str += 2; - else - continue; - } - CONSUME_WHITESPACE(str); - for (i=0;i<8;i++) { - if (strncmp(str, "0x", 2)) - break; - *data = strtoul(str, NULL, 16); - str+=4; - if (*str != ',') break; - str++; - if (!isspace(*str)) { - data++; - break; - } - str++; - data++; - if (data > wdg_data + size) { - fwts_failed(fw, LOG_LEVEL_HIGH, - "WMI_WDGBufferBad", - "_WDG buffer was more than %zu bytes " - "long!", size); - fwts_tag_failed(fw, FWTS_TAG_ACPI_BAD_LENGTH); - return; - } - } + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "WMIUnknownGUID", + "GUID %s is unknown to the kernel, a driver may need to " + "be implemented for this GUID.", guid_str); + + if (!wmi_advice_given) { + wmi_advice_given = true; + fwts_log_advice(fw, + "A WMI driver probably needs to be written for this " + "WMI event. It can checked for using: wmi_has_guid(\"%s\"). " + "One can install a notify handler using " + "wmi_install_notify_handler(\"%s\", handler, NULL). " + "http://lwn.net/Articles/391230 describes how to write an " + "appropriate driver.", + guid_str, guid_str); } - return; } -static void wmi_parse_for_wdg(fwts_framework *fw, - fwts_list_link *item, int *count, bool *result) +/* + * wmi_dump_object() + * dump out a WDG object + */ +static void wmi_dump_object(fwts_framework *fw, const fwts_wdg_info *info) { - uint8_t *wdg_data; - size_t size; - char *str = fwts_text_list_text(item); - - /* Parse Name(_WDG, Buffer, (0xXX) */ - - CONSUME_WHITESPACE(str); - - if (strncmp(str, "Name", 4)) - return; - str += 4; - - CONSUME_WHITESPACE(str); - - if (*str != '(') return; - str++; - - CONSUME_WHITESPACE(str); - - if (strncmp(str, "_WDG",4)) - return; - str+=4; - - CONSUME_WHITESPACE(str); - - if (*str != ',') return; - str++; - - CONSUME_WHITESPACE(str); - - if (strncmp(str, "Buffer",6)) - return; - str+=6; - - CONSUME_WHITESPACE(str); - - if (*str != '(') return; - str++; - - CONSUME_WHITESPACE(str); - - size = strtoul(str, NULL, 16); - - item = item->next; - if (item == NULL) return; - - str = fwts_text_list_text(item); - CONSUME_WHITESPACE(str); - if (*str != '{') return; - - item = item->next; - if (item == NULL) return; + fwts_log_info_verbatum(fw, " Flags : 0x%2.2" PRIx8 " (%s)", + info->flags, wmi_wdg_flags_to_text(info->flags)); + fwts_log_info_verbatum(fw, " Object ID : %c%c", + info->obj_id[0], info->obj_id[1]); + fwts_log_info_verbatum(fw, " Instance : 0x%2.2" PRIx8, + info->instance); +} - if ((wdg_data = calloc(1, size)) != NULL) { - (*count)++ ; - wmi_get_wdg_data(fw, item, size, wdg_data); - wmi_parse_wdg_data(fw, size, wdg_data, result); - free(wdg_data); +/* + * wmi_known_driver() + * report info about the supported kernel driver + */ +static void wmi_known_driver( + fwts_framework *fw, + const fwts_wmi_known_guid *known) +{ + /* If we recognise the GUID then we may as well report this info */ + if (known) { + fwts_log_info_verbatum(fw, " Driver : %s (%s)", + known->driver, known->vendor); } } -static int wmi_table(fwts_framework *fw, - const char *table, const int which, const char *name, bool *result) +/* + * wmi_parse_wdg_data() + * parse over raw _WDG data and dump + sanity check the objects + */ +static void wmi_parse_wdg_data( + fwts_framework *fw, + const char *name, + const size_t size, + const uint8_t *wdg_data) { - fwts_list_link *item; - fwts_list* iasl_output; - int count = 0; - int ret; - - ret = fwts_iasl_disassemble(fw, table, which, &iasl_output); - if (ret == FWTS_NO_TABLE) /* Nothing more to do */ - return ret; - if (ret != FWTS_OK) { - fwts_aborted(fw, "Cannot disassemble and parse for " - "WMI information."); - return FWTS_ERROR; - } + size_t i; + fwts_wdg_info *info = (fwts_wdg_info *)wdg_data; + bool all_events_known = true; + bool events = false; - fwts_list_foreach(item, iasl_output) - wmi_parse_for_wdg(fw, item, &count, result); + for (i = 0; i < (size / sizeof(fwts_wdg_info)); i++, info++) { + uint8_t *guid = info->guid; + char guid_str[37]; + const fwts_wmi_known_guid *known; - if (count == 0) - fwts_log_info(fw, "No WMI data found in table %s.", name); + fwts_guid_buf_to_str(guid, guid_str, sizeof(guid_str)); + fwts_log_nl(fw); + fwts_log_info_verbatum(fw, "%s (%zd of %zd)", + name, i + 1, size / sizeof(fwts_wdg_info)); + fwts_log_info_verbatum(fw, " GUID: %s", guid_str); + known = wmi_find_guid(guid_str); - fwts_text_list_free(iasl_output); + if (info->flags & FWTS_WMI_METHOD) { + fwts_log_info_verbatum(fw, " WMI Method:"); + wmi_dump_object(fw, info); + wmi_known_driver(fw, known); + wmi_method_exist_count(fw, info, guid_str); + } else if (info->flags & FWTS_WMI_EVENT) { + events = true; + fwts_log_info_verbatum(fw, " WMI Event:"); + fwts_log_info_verbatum(fw, " Flags : 0x%2.2" PRIx8 " (%s)", + info->flags, wmi_wdg_flags_to_text(info->flags)); + fwts_log_info_verbatum(fw, " Notification ID: 0x%2.2" PRIx8, + info->notify_id); + fwts_log_info_verbatum(fw, " Reserved : 0x%2.2" PRIx8, + info->reserved); + fwts_log_info_verbatum(fw, " Instance : 0x%2.2" PRIx8, + info->instance); + wmi_known_driver(fw, known); + + /* To handle events we really need a custom kernel driver */ + if (!known) { + wmi_no_known_driver(fw, guid_str); + all_events_known = false; + } + } else { + fwts_log_info_verbatum(fw, " WMI Object:"); + wmi_dump_object(fw, info); + wmi_known_driver(fw, known); + } + } - return FWTS_OK; + if (events && all_events_known) + fwts_passed(fw, "All events associated with %s are handled by a kernel driver.", name); } -static int wmi_DSDT(fwts_framework *fw) +static int wmi_test1(fwts_framework *fw) { - bool result = false; - int ret; + fwts_list_link *item; + fwts_list *objects; + const size_t name_len = 4; + bool wdg_found = false; - ret = wmi_table(fw, "DSDT", 0, "DSDT", &result); + if ((objects = fwts_acpi_object_get_names()) == NULL) { + fwts_log_info(fw, "Cannot find any ACPI objects"); + return FWTS_ERROR; + } - if (!result) - fwts_infoonly(fw); + wmi_advice_given = false; - return ret; -} + fwts_list_foreach(item, objects) { + char *name = fwts_list_data(char*, item); + const size_t len = strlen(name); + + if (strncmp("_WDG", name + len - name_len, name_len) == 0) { + ACPI_OBJECT_LIST arg_list; + ACPI_BUFFER buf; + ACPI_OBJECT *obj; + int ret; -static int wmi_SSDT(fwts_framework *fw) -{ - int i; - bool result = false; - int ret = FWTS_OK; + arg_list.Count = 0; + arg_list.Pointer = NULL; - for (i=0; i < 16; i++) { - char buffer[10]; - snprintf(buffer, sizeof(buffer), "SSDT%d", i+1); - - ret = wmi_table(fw, "SSDT", i, buffer, &result); - if (ret == FWTS_NO_TABLE) { - ret = FWTS_OK; /* Hit the last table */ - break; - } - if (ret != FWTS_OK) { - ret = FWTS_ERROR; - break; + ret = fwts_acpi_object_evaluate(fw, name, &arg_list, &buf); + if ((ACPI_FAILURE(ret) != AE_OK) || (buf.Pointer == NULL)) + continue; + + /* Do we have a valid buffer to dump? */ + obj = buf.Pointer; + if ((obj->Type == ACPI_TYPE_BUFFER) && + (obj->Buffer.Pointer != NULL) && + (obj->Buffer.Length > 0)) { + wmi_parse_wdg_data(fw, name, + obj->Buffer.Length, + (uint8_t*)obj->Buffer.Pointer); + wdg_found = true; + } + + if (buf.Length && buf.Pointer) + free(buf.Pointer); } } - if (!result) - fwts_infoonly(fw); - return ret; + if (!wdg_found) { + fwts_log_info(fw, "No ACPI _WDG WMI data found."); + return FWTS_SKIP; + } + + return FWTS_OK; } static fwts_framework_minor_test wmi_tests[] = { - { wmi_DSDT, "Check Windows Management Instrumentation in DSDT" }, - { wmi_SSDT, "Check Windows Management Instrumentation in SSDT" }, + { wmi_test1, "Check Windows Management Instrumentation" }, { NULL, NULL } }; static fwts_framework_ops wmi_ops = { .description = "Extract and analyse Windows Management " "Instrumentation (WMI).", + .init = wmi_init, + .deinit = wmi_deinit, .minor_tests = wmi_tests }; diff -Nru fwts-0.26.05/src/acpica/fwts_acpica.c fwts-0.26.06/src/acpica/fwts_acpica.c --- fwts-0.26.05/src/acpica/fwts_acpica.c 2013-02-07 01:14:47.000000000 +0000 +++ fwts-0.26.06/src/acpica/fwts_acpica.c 2013-02-21 06:55:10.000000000 +0000 @@ -779,35 +779,6 @@ { } -int fwtsInstallLateHandlers(fwts_framework *fw) -{ - int i; - - if (!AcpiGbl_ReducedHardware) { - if (AcpiInstallFixedEventHandler(ACPI_EVENT_GLOBAL, fwts_event_handler, NULL) != AE_OK) { - fwts_log_error(fw, "Failed to install global event handler."); - return FWTS_ERROR; - } - if (AcpiInstallFixedEventHandler(ACPI_EVENT_RTC, fwts_event_handler, NULL) != AE_OK) { - fwts_log_error(fw, "Failed to install RTC event handler."); - return FWTS_ERROR; - } - } - - for (i = 0; i < ACPI_ARRAY_LENGTH(fwts_space_id_list); i++) { - if (AcpiInstallAddressSpaceHandler(AcpiGbl_RootNode, - fwts_space_id_list[i], fwts_region_handler, fwts_region_init, NULL) != AE_OK) { - fwts_log_error(fw, - "Failed to install handler for %s space(%u)", - AcpiUtGetRegionName((UINT8)fwts_space_id_list[i]), - fwts_space_id_list[i]); - return FWTS_ERROR; - } - } - - return FWTS_OK; -} - int fwtsInstallEarlyHandlers(fwts_framework *fw) { int i; @@ -889,6 +860,18 @@ return FWTS_ERROR; } } + + if (!AcpiGbl_ReducedHardware) { + if (AcpiInstallFixedEventHandler(ACPI_EVENT_GLOBAL, fwts_event_handler, NULL) != AE_OK) { + fwts_log_error(fw, "Failed to install global event handler."); + return FWTS_ERROR; + } + if (AcpiInstallFixedEventHandler(ACPI_EVENT_RTC, fwts_event_handler, NULL) != AE_OK) { + fwts_log_error(fw, "Failed to install RTC event handler."); + return FWTS_ERROR; + } + } + return FWTS_OK; } @@ -918,6 +901,7 @@ AcpiOsRedirectOutput(stderr); + if (ACPI_FAILURE(AcpiInitializeSubsystem())) { fwts_log_error(fw, "Failed to initialise ACPICA subsystem."); return FWTS_ERROR; @@ -1074,7 +1058,6 @@ (void)fwtsInstallEarlyHandlers(fw); AcpiEnableSubsystem(init_flags); AcpiInitializeObjects(init_flags); - (void)fwtsInstallLateHandlers(fw); fwts_acpica_init_called = true; diff -Nru fwts-0.26.05/src/cpu/cpufreq/cpufreq.c fwts-0.26.06/src/cpu/cpufreq/cpufreq.c --- fwts-0.26.05/src/cpu/cpufreq/cpufreq.c 2013-02-07 01:14:47.000000000 +0000 +++ fwts-0.26.06/src/cpu/cpufreq/cpufreq.c 2013-02-21 06:55:10.000000000 +0000 @@ -619,13 +619,12 @@ "various frequency states (P-states) that the BIOS advertises " "for the processor. For each processor/frequency combination, " "a quick performance value is measured. The test then validates that:"); - fwts_log_info_verbatum(fw, - " 1) Each processor has the same number of frequency states\n" - " 2) Higher advertised frequencies have a higher performance\n" - " 3) No duplicate frequency values are reported by the BIOS\n" - " 4) Is BIOS wrongly doing Sw_All P-state coordination across cores\n" - " 5) Is BIOS wrongly doing Sw_Any P-state coordination across cores\n"); - + fwts_log_info_verbatum(fw, " 1. Each processor has the same number of frequency states."); + fwts_log_info_verbatum(fw, " 2. Higher advertised frequencies have a higher performance."); + fwts_log_info_verbatum(fw, " 3. No duplicate frequency values are reported by the BIOS."); + fwts_log_info_verbatum(fw, " 4. BIOS doing Sw_All P-state coordination across cores."); + fwts_log_info_verbatum(fw, " 5. BIOS doing Sw_Any P-state coordination across cores."); + fwts_log_nl(fw); /* First set all processors to their lowest speed */ if ((dir = opendir(FWTS_CPU_PATH)) == NULL) { diff -Nru fwts-0.26.05/src/lib/src/fwts_ioport.c fwts-0.26.06/src/lib/src/fwts_ioport.c --- fwts-0.26.05/src/lib/src/fwts_ioport.c 2013-02-07 01:14:47.000000000 +0000 +++ fwts-0.26.06/src/lib/src/fwts_ioport.c 2013-02-21 06:55:10.000000000 +0000 @@ -17,13 +17,15 @@ * */ -#include #include +#include "fwts.h" + +#ifdef FWTS_ARCH_INTEL + +#include #include #include -#include "fwts.h" - static jmp_buf jmpbuf; /* @@ -129,8 +131,65 @@ return FWTS_ERROR; signal(SIGSEGV, segv_handler); - outw(port, value); + outl(port, value); signal(SIGSEGV, SIG_DFL); return FWTS_OK; } + +#else + +/* + * dummy versions of above, all return FWTS_ERROR + * for non-x86 platforms and any return values are + * set to ~0. + */ +int fwts_inb(uint32_t port, uint8_t *value) +{ + FWTS_UNUSED(port); + + *value = ~0; + return FWTS_ERROR; +} + +int fwts_inw(uint32_t port, uint16_t *value) +{ + FWTS_UNUSED(port); + + *value = ~0; + return FWTS_ERROR; +} + +int fwts_inl(uint32_t port, uint32_t *value) +{ + FWTS_UNUSED(port); + + *value = ~0; + return FWTS_ERROR; +} + +int fwts_outb(uint32_t port, uint8_t value) +{ + FWTS_UNUSED(port); + FWTS_UNUSED(value); + + return FWTS_ERROR; +} + +int fwts_outw(uint32_t port, uint16_t value) +{ + FWTS_UNUSED(port); + FWTS_UNUSED(value); + + return FWTS_ERROR; +} + +int fwts_outl(uint32_t port, uint32_t value) +{ + FWTS_UNUSED(port); + FWTS_UNUSED(value); + + return FWTS_ERROR; +} + +#endif