| 1 |
|
| 2 |
|
| 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> |
| 10 |
|
| 11 |
int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size) |
| 12 |
{ |
| 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; |
| 17 |
} |
| 18 |
|
| 19 |
return 0; |
| 20 |
} |
| 21 |
|
| 22 |
void arch_prog_run(struct prog *prog) |
| 23 |
{ |
| 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)); |
| 27 |
|
| 28 |
|
| 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 |
|
| 35 |
asmlinkage void (*doit)(void *arg); |
| 36 |
#endif |
| 37 |
doit = prog_entry(prog); |
| 38 |
doit(prog_entry_arg(prog)); |
| 39 |
#endif |
| 40 |
} |