drivers/acpi/osi.c
Source file repositories/reference/linux-study-clean/drivers/acpi/osi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/osi.c- Extension
.c- Size
- 12663 bytes
- Lines
- 502
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/acpi.hlinux/dmi.hlinux/platform_data/x86/apple.hinternal.h
Detected Declarations
struct acpi_osi_entryfunction acpi_osi_handlerfunction acpi_osi_setupfunction __acpi_osi_setup_darwinfunction acpi_osi_setup_darwinfunction _OSIfunction acpi_osi_setup_linuxfunction acpi_osi_setup_latefunction osi_setupfunction acpi_osi_is_win8function acpi_osi_dmi_darwinfunction acpi_osi_dmi_linuxfunction dmi_enable_osi_linuxfunction dmi_disable_osi_vistafunction dmi_disable_osi_win7function dmi_disable_osi_win8function acpi_osi_dmi_blacklistedfunction early_acpi_osi_initfunction acpi_osi_initexport acpi_osi_is_win8
Annotated Snippet
struct acpi_osi_entry {
char string[OSI_STRING_LENGTH_MAX];
bool enable;
};
static struct acpi_osi_config {
u8 default_disabling;
unsigned int linux_enable:1;
unsigned int linux_dmi:1;
unsigned int linux_cmdline:1;
unsigned int darwin_enable:1;
unsigned int darwin_dmi:1;
unsigned int darwin_cmdline:1;
} osi_config;
static struct acpi_osi_config osi_config;
static struct acpi_osi_entry
osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = {
{"Module Device", true},
{"Processor Device", true},
{"Processor Aggregator Device", true},
};
static u32 acpi_osi_handler(acpi_string interface, u32 supported)
{
if (!strcmp("Linux", interface)) {
pr_notice_once(FW_BUG
"BIOS _OSI(Linux) query %s%s\n",
osi_config.linux_enable ? "honored" : "ignored",
osi_config.linux_cmdline ? " via cmdline" :
osi_config.linux_dmi ? " via DMI" : "");
}
if (!strcmp("Darwin", interface)) {
pr_notice_once(
"BIOS _OSI(Darwin) query %s%s\n",
osi_config.darwin_enable ? "honored" : "ignored",
osi_config.darwin_cmdline ? " via cmdline" :
osi_config.darwin_dmi ? " via DMI" : "");
}
return supported;
}
void __init acpi_osi_setup(char *str)
{
struct acpi_osi_entry *osi;
bool enable = true;
int i;
if (!acpi_gbl_create_osi_method)
return;
if (str == NULL || *str == '\0') {
pr_info("_OSI method disabled\n");
acpi_gbl_create_osi_method = FALSE;
return;
}
if (*str == '!') {
str++;
if (*str == '\0') {
/* Do not override acpi_osi=!* */
if (!osi_config.default_disabling)
osi_config.default_disabling =
ACPI_DISABLE_ALL_VENDOR_STRINGS;
return;
} else if (*str == '*') {
osi_config.default_disabling = ACPI_DISABLE_ALL_STRINGS;
for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
osi = &osi_setup_entries[i];
osi->enable = false;
}
return;
} else if (*str == '!') {
osi_config.default_disabling = 0;
return;
}
enable = false;
}
for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
osi = &osi_setup_entries[i];
if (!strcmp(osi->string, str)) {
osi->enable = enable;
break;
} else if (osi->string[0] == '\0') {
osi->enable = enable;
strscpy(osi->string, str, OSI_STRING_LENGTH_MAX);
break;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/acpi.h`, `linux/dmi.h`, `linux/platform_data/x86/apple.h`, `internal.h`.
- Detected declarations: `struct acpi_osi_entry`, `function acpi_osi_handler`, `function acpi_osi_setup`, `function __acpi_osi_setup_darwin`, `function acpi_osi_setup_darwin`, `function _OSI`, `function acpi_osi_setup_linux`, `function acpi_osi_setup_late`, `function osi_setup`, `function acpi_osi_is_win8`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.