acpi: reserve 2MB for ACPI and rest is for PCI_DRV

This commit is contained in:
Alexander Boettcher 2013-02-20 08:56:08 +01:00 committed by Norman Feske
parent 6d25c735d2
commit 7e7fa81c8f

View File

@ -237,7 +237,17 @@ int main(int argc, char **argv)
{
using namespace Genode;
enum { STACK_SIZE = 2*4096 };
enum { STACK_SIZE = 2*4096, ACPI_MEMORY_SIZE = 2 * 1024 * 1024 };
/* reserve portion for acpi and give rest to pci_drv */
Genode::addr_t avail_size = Genode::env()->ram_session()->avail();
if (avail_size < ACPI_MEMORY_SIZE) {
PERR("not enough memory");
return 1;
}
avail_size -= ACPI_MEMORY_SIZE;
PINF("available memory for ACPI %d kiB, for PCI_DRV %lu kiB",
ACPI_MEMORY_SIZE / 1024, avail_size / 1024);
static Cap_connection cap;
static Rpc_entrypoint ep(&cap, STACK_SIZE, "acpi_ep");
@ -256,7 +266,7 @@ int main(int argc, char **argv)
pci_policy.configure(buf);
/* use 'pci_drv' as slave service */
static Genode::Slave pci_slave(pci_ep, pci_policy, 1024 * 1024);
static Genode::Slave pci_slave(pci_ep, pci_policy, avail_size);
/* wait until pci drv is online and then make the acpi work */
pci_policy.wait_for_pci_drv();