coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock_normal.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
cbfs.h
>
4
#include <
fallback.h
>
5
#include <
program_loading.h
>
6
#include <
stddef.h
>
7
8
static
const
char
*
get_fallback
(
const
char
*stagelist)
9
{
10
while
(*stagelist)
11
stagelist++;
12
return
++stagelist;
13
}
14
15
enum
cb_err
legacy_romstage_select_and_load
(
struct
prog
*
romstage
)
16
{
17
static
const
char
*default_filenames =
"normal/romstage\0fallback/romstage"
;
18
const
char
*boot_candidate;
19
size_t
stages_len;
20
21
boot_candidate =
cbfs_map
(
"coreboot-stages"
, &stages_len);
22
if
(!boot_candidate)
23
boot_candidate = default_filenames;
24
25
if
(
do_normal_boot
()) {
26
romstage
->name = boot_candidate;
27
if
(
cbfs_prog_stage_load
(
romstage
) ==
CB_SUCCESS
)
28
return
CB_SUCCESS
;
29
}
30
31
romstage
->name =
get_fallback
(boot_candidate);
32
return
cbfs_prog_stage_load
(
romstage
);
33
}
legacy_romstage_select_and_load
enum cb_err legacy_romstage_select_and_load(struct prog *romstage)
Definition:
bootblock_normal.c:15
get_fallback
static const char * get_fallback(const char *stagelist)
Definition:
bootblock_normal.c:8
cb_err
cb_err
coreboot error codes
Definition:
cb_err.h:15
CB_SUCCESS
@ CB_SUCCESS
Call completed successfully.
Definition:
cb_err.h:16
cbfs.h
cbfs_prog_stage_load
enum cb_err cbfs_prog_stage_load(struct prog *prog)
Definition:
cbfs.c:523
cbfs_map
static void * cbfs_map(const char *name, size_t *size_out)
Definition:
cbfs.h:246
fallback.h
romstage
static void romstage(void)
Definition:
romstage.c:24
do_normal_boot
int do_normal_boot(void)
Definition:
mc146818rtc_boot.c:32
program_loading.h
stddef.h
prog
Definition:
program_loading.h:42
src
arch
x86
bootblock_normal.c
Generated by
1.9.1