Пример #1
0
void acpi_init(void)
{
	pmap_create(&acpi_pmap, 0);
	struct acpi_rsdp *rsdp = apci_get_RSDP();
	if(!rsdp) return;
	printk(0, "[acpi]: found valid RSDP structure at %x\n", rsdp);
	struct acpi_dt_header *rsdt = (struct acpi_dt_header *)(rsdp->revision ? (addr_t)rsdp->xsdt_addr : (addr_t)rsdp->rsdt_addr);
	int pointer_size = (rsdp->revision ? 8 : 4);
	const char *sig = (rsdp->revision ? "XSDT" : "RSDT");
	addr_t rsdt_v = pmap_get_mapping(&acpi_pmap, (addr_t)rsdt);
	int valid = acpi_validate_dt((void *)(rsdt_v), sig);
	
	acpi_rsdt = (void *)rsdt_v;
	acpi_rsdt_pt_sz = pointer_size;
	if(valid) __acpi_enable=1;
#if CONFIG_MODULES
	loader_add_kernel_symbol(acpi_get_table_data);
	loader_add_kernel_symbol(find_RSDT_entry);
#endif
}
Пример #2
0
void acpi_init(void)
{
	struct acpi_rsdp *rsdp = apci_get_RSDP();
	if(!rsdp)
		return;
	printk(0, "[ACPI]: found valid RSDP structure at %x\n", rsdp);
	struct acpi_dt_header *rsdt = (struct acpi_dt_header *)((rsdp->revision ? (addr_t)rsdp->xsdt_addr : (addr_t)rsdp->rsdt_addr) + PHYS_PAGE_MAP);
	int pointer_size = (rsdp->revision ? 8 : 4);
	const char *sig = (rsdp->revision ? "XSDT" : "RSDT");
	int valid = acpi_validate_dt((void *)(rsdt), sig);
	
	acpi_rsdt = (void *)rsdt;
	acpi_rsdt_pt_sz = pointer_size;
	if(valid) 
		__acpi_enable = 1;
#if _DBOS_KERNEL_LOADER_MODULES
	loader_add_kernel_symbol(acpi_get_table_data);
	loader_add_kernel_symbol(find_RSDT_entry);
#endif
}