FSP 1.0: Fix CAR issues - broken timestamps and console
[coreboot.git] / src / include / bootmem.h
blob0665058d14b8e86b1fd1f0ed36349f16875c2fdf
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2014 Google Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef BOOTMEM_H
17 #define BOOTMEM_H
19 #include <memrange.h>
20 #include <stdint.h>
21 #include <boot/coreboot_tables.h>
24 * Initialize the memory address space prior to payload loading. The bootmem
25 * serves as the source for the lb_mem table.
27 void bootmem_init(void);
29 /* Add a range of a given type to the bootmem address space. */
30 void bootmem_add_range(uint64_t start, uint64_t size, uint32_t type);
32 /* Write memory coreboot table. */
33 void bootmem_write_memory_table(struct lb_memory *mem);
35 /* Print current range map of boot memory. */
36 void bootmem_dump_ranges(void);
38 /* Return 1 if region targets usable RAM, 0 otherwise. */
39 int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size);
41 /* Allocate a temporary buffer from the unused RAM areas. */
42 void *bootmem_allocate_buffer(size_t size);
44 #endif /* BOOTMEM_H */