diff options
author | Feng Tang <feng.tang@intel.com> | 2009-06-01 11:23:28 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 20:22:39 -0700 |
commit | 7cc52cde55aa85061da67d64212e036ac74d9e73 (patch) | |
tree | 8b7a558f1c76b2cef950a440a5b5b6136930703a /sfi.h | |
parent | a24ea5cfb4209b37f8d42f9ed5584ae9cce85bfc (diff) | |
download | bootstub-7cc52cde55aa85061da67d64212e036ac74d9e73.tar.gz |
SFI: use sfi mmap table to build a e820 table for boot_parameters
Signed-off-by: Feng Tang <feng.tang@intel.com>
Diffstat (limited to 'sfi.h')
-rw-r--r-- | sfi.h | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -0,0 +1,58 @@ +#ifndef _SFI_H +#define _SFI_H + +/* Memory type definitions */ +enum sfi_mem_type { + SFI_MEM_RESERVED, + SFI_LOADER_CODE, + SFI_LOADER_DATA, + SFI_BOOT_SERVICE_CODE, + SFI_BOOT_SERVICE_DATA, + SFI_RUNTIME_SERVICE_CODE, + SFI_RUNTIME_SERVICE_DATA, + SFI_MEM_CONV, + SFI_MEM_UNUSABLE, + SFI_ACPI_RECLAIM, + SFI_ACPI_NVS, + SFI_MEM_MMIO, + SFI_MEM_IOPORT, + SFI_PAL_CODE, + SFI_MEM_TYPEMAX, +}; + +struct sfi_mem_entry { + enum sfi_mem_type type; + u64 phy_start; + u64 vir_start; + u64 pages; + u64 attrib; +}; + +struct sfi_table_header { + char signature[4]; + u32 length; + u8 revision; + u8 checksum; + char oem_id[6]; + char oem_table_id[8]; +}; + +struct sfi_table { + struct sfi_table_header header; + u64 pentry[1]; +}; + +#define SFI_TBL_HEADER_LEN 24 + +#define SFI_GET_ENTRY_NUM(ptable, entry) \ + ((ptable->header.length - SFI_TBL_HEADER_LEN) / \ + (sizeof(struct entry))) + +#define E820_RAM 1 +#define E820_RESERVED 2 +#define E820_ACPI 3 +#define E820_NVS 4 +#define E820_UNUSABLE 5 + +extern void sfi_setup_e820(struct boot_params *bp); +#endif /* _SFI_H */ |