1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <commonlib/helpers.h>
5 #include <console/console.h>
6 #include <mode_switch.h>
7 #include <program_loading.h>
11 int payload_arch_usable_ram_quirk(uint64_t start
, uint64_t size
)
13 if (start
< 1 * MiB
&& (start
+ size
) <= 1 * MiB
) {
15 "Payload being loaded at below 1MiB without region being marked as RAM usable.\n");
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
);
32 void (*doit
)(void *arg
);
34 /* Ensure the argument is pushed on the stack. */
35 asmlinkage
void (*doit
)(void *arg
);
37 doit
= prog_entry(prog
);
38 doit(prog_entry_arg(prog
));