coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
boot.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <arch/boot/boot.h>
4 #include <arch/cpu.h>
5 #include <commonlib/helpers.h>
6 #include <console/console.h>
7 #include <program_loading.h>
8 #include <ip_checksum.h>
9 #include <symbols.h>
10 #include <assert.h>
11 
13 {
14  if (start < 1 * MiB && (start + size) <= 1 * MiB) {
16  "Payload being loaded at below 1MiB without region being marked as RAM usable.\n");
17  return 1;
18  }
19 
20  return 0;
21 }
22 
23 void arch_prog_run(struct prog *prog)
24 {
25 #if ENV_RAMSTAGE && ENV_X86_64
28 
29  /* On x86 coreboot payloads expect to be called in protected mode */
30  protected_mode_jump(entry, arg);
31 #else
32 #if ENV_X86_64
33  void (*doit)(void *arg);
34 #else
35  /* Ensure the argument is pushed on the stack. */
36  asmlinkage void (*doit)(void *arg);
37 #endif
38  doit = prog_entry(prog);
39  doit(prog_entry_arg(prog));
40 #endif
41 }
#define asmlinkage
Definition: cpu.h:8
void arch_prog_run(struct prog *prog)
Definition: boot.c:9
#define pointer_to_uint32_safe(x)
Definition: assert.h:104
#define MiB
Definition: helpers.h:76
#define printk(level,...)
Definition: stdlib.h:16
struct bootblock_arg arg
Definition: decompressor.c:22
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
static void * prog_entry(const struct prog *prog)
static void * prog_entry_arg(const struct prog *prog)
unsigned int uint32_t
Definition: stdint.h:14
unsigned long long uint64_t
Definition: stdint.h:17
int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size)
Definition: boot.c:12
void protected_mode_jump(uint32_t func_ptr, uint32_t argument)
typedef void(X86APIP X86EMU_intrFuncs)(int num)