coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
agesawrapper_call.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef AMD_BLOCK_AGESAWRAPPER_CALL_H
4 #define AMD_BLOCK_AGESAWRAPPER_CALL_H
5 
7 #include <stdint.h>
8 #include <console/console.h>
9 
10 /*
11  * Possible AGESA_STATUS values:
12  *
13  * 0x0 = AGESA_SUCCESS
14  * 0x1 = AGESA_UNSUPPORTED
15  * 0x2 = AGESA_BOUNDS_CHK
16  * 0x3 = AGESA_ALERT
17  * 0x4 = AGESA_WARNING
18  * 0x5 = AGESA_ERROR
19  * 0x6 = AGESA_CRITICAL
20  * 0x7 = AGESA_FATAL
21  */
22 static const char *decodeAGESA_STATUS(AGESA_STATUS sret)
23 {
24  const char *statusStrings[] = { "AGESA_SUCCESS", "AGESA_UNSUPPORTED",
25  "AGESA_BOUNDS_CHK", "AGESA_ALERT",
26  "AGESA_WARNING", "AGESA_ERROR",
27  "AGESA_CRITICAL", "AGESA_FATAL"
28  };
29  if (sret >= ARRAY_SIZE(statusStrings))
30  return "unknown"; /* Non-AGESA error code */
31  return statusStrings[sret];
32 }
33 
34 static inline u32 do_agesawrapper(AGESA_STRUCT_NAME func, const char *name)
35 {
36  AGESA_STATUS ret;
37  printk(BIOS_DEBUG, "agesawrapper_%s() entry\n", name);
38  ret = agesa_execute_state(func);
39  printk(BIOS_DEBUG, "agesawrapper_%s() returned %s\n",
40  name, decodeAGESA_STATUS(ret));
41  return (u32)ret;
42 }
43 
44 #endif /* AMD_BLOCK_AGESAWRAPPER_CALL_H */
unsigned int AGESA_STATUS
Definition: Amd.h:36
static const char * decodeAGESA_STATUS(AGESA_STATUS sret)
static u32 do_agesawrapper(AGESA_STRUCT_NAME func, const char *name)
const char * name
Definition: mmu.c:92
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
uint32_t u32
Definition: stdint.h:51