aboutsummaryrefslogtreecommitdiffstats
path: root/src/pmm.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce memcpy_fl - a memcpy on "flat" pointers.Kevin O'Connor2010-06-061-15/+5
|
* Rework malloc to use a "first fit" algorithm.Kevin O'Connor2010-06-061-217/+313
| | | | | | | | | | | | | | | | | 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).
* Add __attribute__((__malloc__)) declaration to internal malloc funcs.Kevin O'Connor2010-04-171-2/+2
|
* Don't move EBDA while an optionrom is running (CONFIG_THREAD_OPTIONROMS).Kevin O'Connor2010-03-201-6/+12
| | | | | Moving the ebda while an optionrom is running could confuse it. So, avoid doing that.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-6/+6
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Add support for 32bit PCI BIOS entry.Kevin O'Connor2009-12-301-3/+4
| | | | | | | | | Create a new code blob (code32seg) with support for 32bit functions that need to utilize explicit segment accesses. This code blob uses global variables relative to %gs and with a dynamic code offset (determined by get_global_offset()). Add BIOS32 structure and code. Add code for 32bit PCI BIOS code.
* Only add "addr32" to memory accesses that require them.Kevin O'Connor2009-12-271-2/+7
| | | | Extract out addr32 to a parameter to the READx/WRITEx_SEG macros.
* Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.Kevin O'Connor2009-12-261-8/+8
| | | | | Prepare for support of segmented 32bit code. Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
* Clear unused parts of f-segment.Kevin O'Connor2009-11-251-0/+4
| | | | | | On coreboot, the unused parts of the f-segment could contain leftover bios tables which may confuse an OS. So clear unused parts of f-segment.
* Clear PMMAllocs even if CONFIG_PMM not set.Kevin O'Connor2009-11-251-61/+61
| | | | | The pmm based allocations are used for internal allocations now, so be sure to do a full reset even if external PMM not configured.
* Use pmm_malloc() for internal allocations.Kevin O'Connor2009-10-121-64/+51
| | | | | | Using pmm_malloc permits free() to be used on internal allocations. Rework low zone expanding so that it doesn't cause gcc v4.3 error. Allow pmm_malloc to use ZoneTmpLow if ZoneTmpHigh isn't available.
* Workaround gcc4.3 compiler error - disable pmm low mem allocations.Kevin O'Connor2009-10-041-0/+2
| | | | | | For some unknown reason, the 16bit version of low memory expansion is confusing gcc4.3. For now, just disable it as it isn't used in practice.
* Add support for permanent low memory allocations.Kevin O'Connor2009-09-241-8/+92
| | | | | Support pmm style permanent low-memory allocations. When used, relocate ebda and store permanent memory at top of 640K.
* Cleanups for malloc code.Kevin O'Connor2009-08-301-18/+5
| | | | | | Fix bug where zones over 2gig may fail to allocate. Add memalign_high() and use for acpi facs allocation. Misc code cleanups.
* Add initial support for PMM allocations of permanent memory.Kevin O'Connor2009-08-221-10/+20
| | | | | Support PCIv3 PMM requests for permanent memory. Only support permanent high memory requests for now.
* Add support for using floppy images in CBFS.Kevin O'Connor2009-08-161-15/+5
| | | | | | 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).
* Fix some PMM corner-cases.Kevin O'Connor2009-08-021-13/+29
| | | | | | | | | | Make sure not to divide by zero when calculating usage percent in debug messages. Make sure high memory zones are aligned; make sure zone is big enough even after loss due to alignment. Be sure to reset ZoneTmpHigh and PMMAllocs on failure paths. Fix corner case in pmm_free() where an allocation might not get freed due to ordering of pmmalloc_s structs.
* Add Post Memory Manager (PMM) support.Kevin O'Connor2009-08-011-13/+320
| | | | | | | | | | | | 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.
* Add PMM stubs.Kevin O'Connor2009-07-261-0/+117
Add initial code for Post Memory Manager - it's just the stubs for now. Also, fix PnP entry point not clearing irqs and direction flags.