From: Geoff Levand Date: Thu, 2 Aug 2018 17:29:40 +0000 (+0000) Subject: discover: Add platform-dummy X-Git-Tag: v1.9.0~17 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=fed2c4da36c2708f2a5a7a09eba61d014b9339d6 discover: Add platform-dummy With the new configure enable-platform parameters it is possible configure no platform support. Add a new minimal 'dummy' platform so that the __start_platforms and __stop_platforms variables needed by platform_init are created. Signed-off-by: Geoff Levand Signed-off-by: Samuel Mendoza-Jonas --- diff --git a/discover/Makefile.am b/discover/Makefile.am index 3992a66..f9625ec 100644 --- a/discover/Makefile.am +++ b/discover/Makefile.am @@ -86,6 +86,9 @@ discover_platform_ro_SOURCES = \ discover_platform_ro_CPPFLAGS = \ $(AM_CPPFLAGS) +# Build dummy last to put it at the end of the platforms section. +discover_platform_ro_SOURCES += discover/platform-dummy.c + if ENABLE_MTD discover_platform_ro_SOURCES += \ discover/hostboot.c diff --git a/discover/platform-dummy.c b/discover/platform-dummy.c new file mode 100644 index 0000000..7c2e1dc --- /dev/null +++ b/discover/platform-dummy.c @@ -0,0 +1,16 @@ +#include "platform.h" + +static bool probe(struct platform *p, void *ctx) +{ + (void)p; + (void)ctx; + + return false; +} + +static struct platform dummy = { + .name = "dummy", + .probe = probe, +}; + +register_platform(dummy);