15 #define FW_CFG_PORT_CTL 0x0510
16 #define FW_CFG_PORT_DATA 0x0511
17 #define FW_CFG_DMA_ADDR_HIGH 0x0514
18 #define FW_CFG_DMA_ADDR_LOW 0x0518
27 static const char qsig[] =
"QEMU";
35 detected ?
"detected" :
"not found");
72 for (
int i = 0; i <
count; i++) {
75 file->size = be32_to_cpu(
file->size);
76 file->select = be16_to_cpu(
file->select);
106 if (*pos +
sizeof(*entry) > *size)
110 *pos +=
sizeof(*entry);
124 if (e.
type == 1 && limit < 4ULL * GiB && limit > top)
133 unsigned short max_cpus;
163 #define BIOS_LINKER_LOADER_FILESZ 56
230 unsigned long *addrs, current;
232 int i, j, src, dst, max;
239 max = f.
size /
sizeof(*s);
241 addrs =
malloc(max *
sizeof(*addrs));
245 for (i = 0; i < max &&
s[i].command != 0; i++) {
265 for (j = 0; j < i; j++) {
273 if (src == -1 || dst == -1)
279 ptr +=
s[i].pointer.offset;
287 ptr +=
s[i].pointer.offset;
307 for (j = 0; j < i; j++) {
317 cksum_data = (
void *)(addrs[dst] +
s[i].
cksum.start);
332 return ALIGN(current, 16);
363 for (i = 0; i <
count; i++) {
401 current +=
header->length;
406 return current + (
count ? 1 : 2);
428 unsigned long start, end;
429 int ret, i,
count = 1;
441 for (i = 0; i < 16384; i++) {
442 str = (
char*)(*current - i);
443 if (
strcmp(str,
"coreboot") == 0)
469 }
while (end < start + f.
size);
472 ret = end - *current;
516 uint32_t dma_desc_addr_hi, dma_desc_addr_lo;
518 dma.control = be32_to_cpu(control);
519 dma.length = be32_to_cpu(len);
523 dma_desc_addr_lo = (
uint32_t)(dma_desc_addr & 0xFFFFFFFFU);
525 ? (
uint32_t)(dma_desc_addr >> 32) : 0;
528 if (dma_desc_addr_hi)
u8 acpi_checksum(u8 *table, u32 length)
struct arm64_kernel_header header
static void insb(uint16_t port, void *addr, unsigned long count)
void * memcpy(void *dest, const void *src, size_t n)
#define offsetof(TYPE, MEMBER)
static uint64_t read_le64(const void *src)
static void write_le64(void *dest, uint64_t val)
static void write_le32(void *dest, uint32_t val)
static uint32_t read_le32(const void *src)
static void write_le8(void *dest, uint8_t val)
#define printk(level,...)
void outl(u32 val, u16 port)
void outw(u16 val, u16 port)
unsigned long fw_cfg_acpi_tables(unsigned long start)
static int fw_cfg_e820_read(FwCfgE820Entry *entry, uint32_t *size, uint32_t *pos)
#define BIOS_LINKER_LOADER_FILESZ
void smbios_system_set_uuid(u8 *uuid)
void fw_cfg_get(uint16_t entry, void *dst, int dstlen)
@ BIOS_LINKER_LOADER_COMMAND_ALLOCATE
@ BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM
@ BIOS_LINKER_LOADER_COMMAND_ADD_POINTER
static const char * type1_manufacturer
const char * smbios_mainboard_serial_number(void)
const char * smbios_mainboard_version(void)
const char * smbios_mainboard_manufacturer(void)
static void fw_cfg_read(void *dst, int dstlen)
int fw_cfg_check_file(FWCfgFile *file, const char *name)
const char * smbios_mainboard_product_name(void)
static int fw_cfg_find_file(FWCfgFile *file, const char *name)
struct BiosLinkerLoaderEntry __packed
static const char * type1_family
int fw_cfg_max_cpus(void)
uintptr_t fw_cfg_tolud(void)
static const char * type1_version
static int fw_cfg_present(void)
static int fw_cfg_e820_select(uint32_t *size)
static const char * type1_product_name
static const char * type1_serial_number
unsigned long fw_cfg_smbios_tables(int *handle, unsigned long *current)
static unsigned long smbios_next(unsigned long current)
static void fw_cfg_dma(int control, void *buf, int len)
@ BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH
@ BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG
static void fw_cfg_smbios_init(void)
static int fw_cfg_detected
#define FW_CFG_DMA_ADDR_HIGH
static void fw_cfg_select(uint16_t entry)
#define FW_CFG_DMA_ADDR_LOW
#define FW_CFG_SMBIOS_ENTRIES
#define FW_CFG_DMA_CTL_ERROR
#define FW_CFG_VERSION_DMA
#define SMBIOS_FIELD_ENTRY
#define FW_CFG_DMA_CTL_READ
@ SMBIOS_BIOS_INFORMATION
void * malloc(size_t size)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
unsigned long long uint64_t
int strcmp(const char *s1, const char *s2)
int memcmp(const void *s1, const void *s2, size_t n)
char * strdup(const char *s)
size_t strlen(const char *src)
struct BiosLinkerLoaderEntry::@261::@265 cksum
struct BiosLinkerLoaderEntry::@261::@264 pointer
struct BiosLinkerLoaderEntry::@261::@263 alloc
char dest_file[BIOS_LINKER_LOADER_FILESZ]
char src_file[BIOS_LINKER_LOADER_FILESZ]
#define s(param, src_bits, pmcreg, dst_bits)