diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-09-29 12:58:23 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-10-01 08:12:43 +0200 |
commit | 2558532a3e993627fb35d087e50e8600053c6244 (patch) | |
tree | 5f013fcbe19c74ec1ff44edaa4910ec501a8d126 /arch/sandbox/board/devices.c | |
parent | 91be45ce27558bcad11376e8c5904529b085fec5 (diff) | |
download | barebox-2558532a3e993627fb35d087e50e8600053c6244.tar.gz barebox-2558532a3e993627fb35d087e50e8600053c6244.tar.xz |
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 <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/board/devices.c')
-rw-r--r-- | arch/sandbox/board/devices.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 <mach/linux.h> #include <init.h> #include <mach/linux.h> +#include <asm/io.h> + +unsigned char __pci_iobase[IO_SPACE_LIMIT]; static LIST_HEAD(sandbox_device_list); |