crossgcc: Upgrade CMake from 3.29.3 to 3.30.2
[coreboot.git] / src / arch / x86 / boot.c
blob8694ff782d0e6b8d8b0d495272469316d4fd4edb
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <arch/cpu.h>
4 #include <commonlib/helpers.h>
5 #include <console/console.h>
6 #include <mode_switch.h>
7 #include <program_loading.h>
8 #include <symbols.h>
9 #include <assert.h>
11 int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size)
13 if (start < 1 * MiB && (start + size) <= 1 * MiB) {
14 printk(BIOS_DEBUG,
15 "Payload being loaded at below 1MiB without region being marked as RAM usable.\n");
16 return 1;
19 return 0;
22 void arch_prog_run(struct prog *prog)
24 #if ENV_RAMSTAGE && ENV_X86_64
25 const uint32_t arg = pointer_to_uint32_safe(prog_entry_arg(prog));
26 const uint32_t entry = pointer_to_uint32_safe(prog_entry(prog));
28 /* On x86 coreboot payloads expect to be called in protected mode */
29 protected_mode_call_1arg((void *)(uintptr_t)entry, arg);
30 #else
31 #if ENV_X86_64
32 void (*doit)(void *arg);
33 #else
34 /* Ensure the argument is pushed on the stack. */
35 asmlinkage void (*doit)(void *arg);
36 #endif
37 doit = prog_entry(prog);
38 doit(prog_entry_arg(prog));
39 #endif