/* When enabled this indicates that SMM won't work */ staticbool test_wsmt_enabled(void)
{ struct calling_interface_token *wsmt;
/* if token doesn't exist, SMM will work */
wsmt = dell_smbios_find_token(WSMT_EN_TOKEN); if (!wsmt) returnfalse;
/* If token exists, try to access over SMM but set a dummy return. * - If WSMT disabled it will be overwritten by SMM * - If WSMT enabled then dummy value will remain
*/
buffer->cmd_class = CLASS_TOKEN_READ;
buffer->cmd_select = SELECT_TOKEN_STD;
memset(buffer, 0, sizeof(struct calling_interface_buffer));
buffer->input[0] = wsmt->location;
buffer->output[0] = 99;
dell_smbios_smm_call(buffer); if (buffer->output[0] == 99) returntrue;
returnfalse;
}
int init_dell_smbios_smm(void)
{ int ret; /* * Allocate buffer below 4GB for SMI data--only 32-bit physical addr * is passed to SMI handler.
*/
ret = dcdbas_smi_alloc(&smi_buf, PAGE_SIZE); if (ret) return ret;
buffer = (void *)smi_buf.virt;
dmi_walk(find_cmd_address, NULL);
if (test_wsmt_enabled()) {
pr_debug("Disabling due to WSMT enabled\n");
ret = -ENODEV; goto fail_wsmt;
}
platform_device = platform_device_alloc("dell-smbios", 1); if (!platform_device) {
ret = -ENOMEM; goto fail_platform_device_alloc;
}
ret = platform_device_add(platform_device); if (ret) goto fail_platform_device_add;
ret = dell_smbios_register_device(&platform_device->dev, 0, &dell_smbios_smm_call); if (ret) goto fail_register;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.