From a48433d39be4002061e8882a9c6a009a497166eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 7 Jun 2018 06:31:43 +0300 Subject: selfboot: Move x86 quirk under arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Making exceptions for some payload to be loaded near and under 1 MiB boundary sounds like a legacy 16-bit x86 BIOS thing we generally do not want under lib/. Change-Id: I8e8336a03d6f06d8f022c880a8334fe19a777f0a Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/26934 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Nico Huber --- src/arch/x86/boot.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/arch') diff --git a/src/arch/x86/boot.c b/src/arch/x86/boot.c index 2e1becf0be..d157f96380 100644 --- a/src/arch/x86/boot.c +++ b/src/arch/x86/boot.c @@ -11,6 +11,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -205,6 +206,17 @@ int arch_supports_bounce_buffer(void) return 1; } +int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size) +{ + if (start < 1 * MiB && (start + size) <= 1 * MiB) { + printk(BIOS_DEBUG, + "Payload being loaded at below 1MiB without region being marked as RAM usable.\n"); + return 1; + } + + return 0; +} + static void try_payload(struct prog *prog) { if (prog_type(prog) == PROG_PAYLOAD) { -- cgit v1.2.3