From 2558532a3e993627fb35d087e50e8600053c6244 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 29 Sep 2020 12:58:23 +0200 Subject: sandbox: add dummy memory-mapped I/O port region Super I/O devices on x86 have their base usually located at one of two I/O ports. They are probed by writing a "passcode" to the I/O port and then a value is read back. When COMPILE_TESTing these drivers and running them on sandbox, this fails with a segfault because all I/O port access lead to zero page dereference on that architecture. Even without running barebox, static analyzers correctly flag these accesses as invoking undefined behavior. Adding a dummy I/O region solves both issues. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/sandbox/board/devices.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/sandbox/board/devices.c') diff --git a/arch/sandbox/board/devices.c b/arch/sandbox/board/devices.c index 72e62552a3..1fd1913ae6 100644 --- a/arch/sandbox/board/devices.c +++ b/arch/sandbox/board/devices.c @@ -9,6 +9,9 @@ #include #include #include +#include + +unsigned char __pci_iobase[IO_SPACE_LIMIT]; static LIST_HEAD(sandbox_device_list); -- cgit v1.2.3