x86_64: acpi: create acpi bus device
This commit is contained in:
@@ -1,10 +1,28 @@
|
|||||||
#include <arch/acpi.h>
|
#include <arch/acpi.h>
|
||||||
#include <socks/printk.h>
|
#include <socks/printk.h>
|
||||||
|
#include <socks/device.h>
|
||||||
|
#include <socks/libc/stdio.h>
|
||||||
|
|
||||||
|
static kern_status_t acpi_bus_scan(struct device *dev)
|
||||||
|
{
|
||||||
|
return KERN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct bus_device_ops acpi_ops = {
|
||||||
|
.scan = acpi_bus_scan,
|
||||||
|
};
|
||||||
|
|
||||||
kern_status_t acpi_init(void)
|
kern_status_t acpi_init(void)
|
||||||
{
|
{
|
||||||
apic_init();
|
apic_init();
|
||||||
smp_init();
|
smp_init();
|
||||||
|
|
||||||
|
struct bus_device *acpi_dev = bus_device_create();
|
||||||
|
struct device *base = bus_device_base(acpi_dev);
|
||||||
|
acpi_dev->b_ops = &acpi_ops;
|
||||||
|
snprintf(base->dev_name, sizeof base->dev_name, "acpi");
|
||||||
|
|
||||||
|
device_register(base, root_device());
|
||||||
|
|
||||||
return KERN_OK;
|
return KERN_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user