使用ACPI后,在driver/acpi/acpi_platform.c中会为bios 传过来的设备create device. 知道这个后,我们除了可以再grub中添加blacklist来禁止某个驱动外,还可以在driver/acpi/acpi_platform.c中的forbidden_id_list添加,这样kernel 就不会为这个设备创建device
在driver/acpi/acpi_platform.c 中已经禁止的device如下
static const struct acpi_device_id forbidden_id_list[] = {
{"PNP0000", 0}, /* PIC */
{"PNP0100", 0}, /* Timer */
{"PNP0200", 0}, /* AT DMA Controller */
{"ACPI0009", 0}, /* IOxAPIC */
{"ACPI000A", 0}, /* IOAPIC */
{"SMB0001", 0}, /* ACPI SMBUS virtual device */
{"", 0},
};
我们可以将需要禁止的驱动的id放到这个list中,这样在
struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
struct property_entry *properties)
{
struct platform_device *pdev = NULL;
struct platform_device_info pdevinfo;
struct resource_entry *rentry;
struct list_head resource_list;
struct resource *resources = NULL;
int count;
/* If the ACPI node already has a physical device attached, skip it. */
if (adev->physical_node_count)
return NULL;
#检测到需要禁止的设备的id,就退出
if (!acpi_match_device_ids(adev, forbidden_id_list))
return ERR_PTR(-EINVAL);
}
ACPI的forbidden_id_list
猜你喜欢
转载自blog.csdn.net/tiantao2012/article/details/111149594
今日推荐
周排行