aboutsummaryrefslogtreecommitdiff
path: root/src/memmap.h
AgeCommit message (Collapse)AuthorFilesLines
2024-01-04memmap: Fix 64-bit buildHelge Deller1-4/+4
Signed-off-by: Helge Deller <deller@gmx.de>
2015-10-15memmap: Introduce SYMBOL() macro to access linker script symbolsKevin O'Connor1-0/+4
Use a macro to define and obtain the value of a symbol introduced by the linker scripts (scripts/layoutrom.py). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15malloc: Don't mix virtual and physical addressesKevin O'Connor1-0/+3
Consistently use 'u32' for physical addresses and pointers for virtual addresses in the malloc code. Introduce and use memremap() where a physical address needs to be converted to a virtual address. Use virt_to_phys() for the inverse. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15virtio: Move standard definitions from virtio-ring.h to standard headersKevin O'Connor1-0/+7
Move PAGE_SHIFT / virt_to_phys() to memmap.h and smp_[rw]mb() to x86.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15e820: Rename memmap.c to e820map.c and use consistent "e820_" prefixKevin O'Connor1-25/+3
Rename memmap.c to e820map.c as the code in that file only deals with maintaining the e820 map. Move all the e820 definitions to new file e820map.h and use a consistent "e820_" prefix on all exported functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15e820: Introduce e820_remove() and avoid exporting E820_HOLEKevin O'Connor1-1/+1
The E820_HOLE definition is used internally in the e820 manipulation code to remove entries from the e820 map. Introduce the e820_remove() function so that the E820_HOLE definition does not need to be exported from the memmap.c code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Convert VAR16VISIBLE, VAR16EXPORT, and VAR32VISIBLE to VARFSEG.Kevin O'Connor1-4/+1
Convert all users of the alternative variable exports to VARFSEG. There isn't a significant distinction between the existing types of exports, so it's simpler to just use one type going forward. The new VARFSEG declaration is only emitting when in 32bit mode, so update and move some variables as needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-05Normalize POST initialization function name suffixes.Kevin O'Connor1-1/+1
The POST phase has to invoke many initialization functions, and these functions can have complex inter-dependencies. Try to categorize the functions into 4 classes: preinit - functions called very early in POST where function ordering is very important and the code has limited access to other interfaces. init - functions that initialize internal interfaces and standard external interfaces. This code is generally not dependent on particular hardware and typically does not communicate directly with any hardware devices. setup - functions which access hardware or are dependent on particular hardware or platform devices. prepboot - functions that finalize internal interfaces and that prepare for the boot phase. This patch attempts to normalize the suffixes - functions that used _init(), _setup(), _finalize(), or similar that did not follow the above pattern were renamed. Other than function name changes, there should be no code impact to this patch. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2010-09-25Cleanup - it's no longer necessary to manually reset global variables.Kevin O'Connor1-1/+0
Now that a soft-reboot forces a hard-reboot, it is no longer necessary to manually reset global variables.
2010-06-06Rework malloc to use a "first fit" algorithm.Kevin O'Connor1-1/+0
The existing malloc implementation effectively uses a stack - all new allocations come from the top of the stack. When allocating memory with a large alignment, the pad used to align the new memory is unavailable to other users. Also, memory released by calling free() is only available to other users when all memory allocated after it is also freed. This new malloc scheme uses a first fit approach to finding available memory. It makes it possible to use alignment padding and freed space for new allocations. This helps reduce the required memory in the permanent memory zones (ZoneHigh and ZoneLow) where users have the need to allocate structures with high alignment (eg, virtio and usb).
2010-01-03Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor1-2/+2
Omitting "void" leads to a K&R style declaration which was not intended.
2009-08-30Cleanups for malloc code.Kevin O'Connor1-0/+3
Fix bug where zones over 2gig may fail to allocate. Add memalign_high() and use for acpi facs allocation. Misc code cleanups.
2009-08-16Add support for using floppy images in CBFS.Kevin O'Connor1-0/+1
Add new "ramdisk" type for disk accesses. Extract out high-mem finding code from pmm into find_high_area(). Fix bug in GDB_BASE and GDT_LIMIT macros (wrong bit shifts).
2009-08-01Add Post Memory Manager (PMM) support.Kevin O'Connor1-5/+0
Complete the initial implementation of PMM. Default new PMM code to be enabled. Move malloc code from memmap.c to pmm.c. Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh). Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit PMM code use "big real" mode and requires 32bit accesses). Allow pmm allocations to occur during bcv executions also. Add low-memory clearing before boot. Also, align the default f-seg memory.
2009-07-25Add malloc_high/fseg() and rework bios table creation to use them.Kevin O'Connor1-1/+5
Add malloc like functions for memory management instead of open-coding memory reservation in all callers. Add ability for unused high ram to be returned for general purpose use. Break up acpi table creation into multiple functions. Also, move smbios tables into high ram (instead of f-segment).
2009-01-17Reserve space for buffers in f-segment; don't allocate from freespace.Kevin O'Connor1-2/+3
Define the e820list as a regular array. Define a buffer for run-time built bios tables. Reserving the space in advance should help prevent run-time errors when space becomes tight.
2008-11-08Update e820 map in place instead of copying it.Kevin O'Connor1-0/+4
Allocate the e820 map space in the 0xf0000 segment and do all updates in place. This reduces the need to access external memory during post. Also, move e820 pointer and count from ebda to variables in 0xf0000.
2008-06-21Make 0xa0000 - 0x10000 a "gap" in the e820 map.Kevin O'Connor1-0/+1
Declaring memory between 0xa0000 - 0x10000 confuses windows, so don't do that. Add capability to remove mappings in the memory mapping code.
2008-06-08Enhance e820 memory map generation - include files missing from last commit.Kevin O'Connor1-0/+25