/* memory.h - describe the memory map */ /* * VAS_EBOOT -- GRand Unified Bootloader * Copyright (C) 2002,2007,2010 Free Software Foundation, Inc. * * VAS_EBOOT is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VAS_EBOOT is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VAS_EBOOT. If not, see . */ #ifndef _VAS_EBOOT_MACHINE_LBIO_HEADER #define _VAS_EBOOT_MACHINE_LBIO_HEADER 1 #include #include struct VasEBoot_linuxbios_table_header { VasEBoot_uint8_t signature[4]; VasEBoot_uint32_t header_size; VasEBoot_uint32_t header_checksum; VasEBoot_uint32_t table_size; VasEBoot_uint32_t table_checksum; VasEBoot_uint32_t table_entries; }; typedef struct VasEBoot_linuxbios_table_header *VasEBoot_linuxbios_table_header_t; struct VasEBoot_linuxbios_timestamp_entry { VasEBoot_uint32_t id; VasEBoot_uint64_t tsc; } VAS_EBOOT_PACKED; struct VasEBoot_linuxbios_timestamp_table { VasEBoot_uint64_t base_tsc; VasEBoot_uint32_t capacity; VasEBoot_uint32_t used; struct VasEBoot_linuxbios_timestamp_entry entries[0]; } VAS_EBOOT_PACKED; struct VasEBoot_linuxbios_mainboard { VasEBoot_uint8_t vendor; VasEBoot_uint8_t part_number; char strings[0]; }; struct VasEBoot_linuxbios_table_item { VasEBoot_uint32_t tag; VasEBoot_uint32_t size; }; typedef struct VasEBoot_linuxbios_table_item *VasEBoot_linuxbios_table_item_t; enum { VAS_EBOOT_LINUXBIOS_MEMBER_UNUSED = 0x00, VAS_EBOOT_LINUXBIOS_MEMBER_MEMORY = 0x01, VAS_EBOOT_LINUXBIOS_MEMBER_MAINBOARD = 0x03, VAS_EBOOT_LINUXBIOS_MEMBER_CONSOLE = 0x10, VAS_EBOOT_LINUXBIOS_MEMBER_LINK = 0x11, VAS_EBOOT_LINUXBIOS_MEMBER_FRAMEBUFFER = 0x12, VAS_EBOOT_LINUXBIOS_MEMBER_TIMESTAMPS = 0x16, VAS_EBOOT_LINUXBIOS_MEMBER_CBMEMC = 0x17 }; struct VasEBoot_linuxbios_table_framebuffer { VasEBoot_uint64_t lfb; VasEBoot_uint32_t width; VasEBoot_uint32_t height; VasEBoot_uint32_t pitch; VasEBoot_uint8_t bpp; VasEBoot_uint8_t red_field_pos; VasEBoot_uint8_t red_mask_size; VasEBoot_uint8_t green_field_pos; VasEBoot_uint8_t green_mask_size; VasEBoot_uint8_t blue_field_pos; VasEBoot_uint8_t blue_mask_size; VasEBoot_uint8_t reserved_field_pos; VasEBoot_uint8_t reserved_mask_size; } VAS_EBOOT_PACKED; struct VasEBoot_linuxbios_mem_region { VasEBoot_uint64_t addr; VasEBoot_uint64_t size; #define VAS_EBOOT_MACHINE_MEMORY_AVAILABLE 1 VasEBoot_uint32_t type; } VAS_EBOOT_PACKED; typedef struct VasEBoot_linuxbios_mem_region *mem_region_t; VasEBoot_err_t EXPORT_FUNC(VasEBoot_linuxbios_table_iterate) (int (*hook) (VasEBoot_linuxbios_table_item_t, void *), void *hook_data); VasEBoot_linuxbios_table_header_t VasEBoot_linuxbios_get_tables (void); int VasEBoot_linuxbios_check_signature (VasEBoot_linuxbios_table_header_t tbl_header); #endif