mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 09:46:20 +00:00
parent
e527f6e5ac
commit
18b36fb339
@ -19,6 +19,7 @@
|
||||
#include <io_mem_session/connection.h>
|
||||
#include <pci_session/connection.h>
|
||||
#include <pci_device/client.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
|
||||
#include "acpi.h"
|
||||
#include "memory.h"
|
||||
@ -1016,9 +1017,19 @@ class Element : public List<Element>::Element
|
||||
text += len;
|
||||
max -= len;
|
||||
}
|
||||
len = snprintf(text, max, "</config>");
|
||||
text += len;
|
||||
max -= len;
|
||||
|
||||
Attached_rom_dataspace rom("config");
|
||||
char * rom_text = rom.local_addr<char>();
|
||||
size_t rom_len = strlen(rom_text);
|
||||
|
||||
if (max > rom_len - 9) {
|
||||
rom_text += 9;
|
||||
rom_len -= 9;
|
||||
memcpy(text, rom_text, rom_len);
|
||||
text += rom_len;
|
||||
max -= rom_len;
|
||||
} else
|
||||
PERR("could not add pci_drv policy");
|
||||
|
||||
if (max < 2)
|
||||
PERR("config file could not be generated, buffer to small");
|
||||
|
@ -265,7 +265,7 @@ int main(int argc, char **argv)
|
||||
static Pci_policy pci_policy(pci_ep, ep, irq_ep);
|
||||
|
||||
/* generate config file for pci_drv */
|
||||
char buf[256];
|
||||
char buf[1024];
|
||||
Acpi::create_pci_config_file(buf, sizeof(buf));
|
||||
pci_policy.configure(buf);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user