mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
MFC: r200253 and r200255
Reduce diffs against i386.
This commit is contained in:
parent
823e5012b0
commit
abe32331b6
2 changed files with 26 additions and 10 deletions
|
|
@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$");
|
|||
#include "libi386.h"
|
||||
#include "btxv86.h"
|
||||
|
||||
vm_offset_t memtop, memtop_copyin;
|
||||
u_int32_t bios_basemem, bios_extmem;
|
||||
vm_offset_t memtop, memtop_copyin, high_heap_base;
|
||||
uint32_t bios_basemem, bios_extmem, high_heap_size;
|
||||
|
||||
/*
|
||||
* The minimum amount of memory to reserve in bios_extmem for the heap.
|
||||
*/
|
||||
#define HEAP_MIN (3 * 1024 * 1024)
|
||||
|
||||
void
|
||||
bios_getmem(void)
|
||||
|
|
@ -48,5 +53,12 @@ bios_getmem(void)
|
|||
/* Set memtop to actual top of memory */
|
||||
memtop = memtop_copyin = 0x100000 + bios_extmem;
|
||||
|
||||
/*
|
||||
* If we have extended memory, use the last 3MB of 'extended' memory
|
||||
* as a high heap candidate.
|
||||
*/
|
||||
if (bios_extmem >= HEAP_MIN) {
|
||||
high_heap_size = HEAP_MIN;
|
||||
high_heap_base = memtop - HEAP_MIN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,14 +96,18 @@ main(void)
|
|||
*/
|
||||
bios_getmem();
|
||||
|
||||
#ifdef LOADER_BZIP2_SUPPORT
|
||||
heap_top = PTOV(memtop_copyin);
|
||||
memtop_copyin -= 0x300000;
|
||||
heap_bottom = PTOV(memtop_copyin);
|
||||
#else
|
||||
heap_top = (void *)bios_basemem;
|
||||
heap_bottom = (void *)end;
|
||||
#if defined(LOADER_BZIP2_SUPPORT)
|
||||
if (high_heap_size > 0) {
|
||||
heap_top = PTOV(high_heap_base + high_heap_size);
|
||||
heap_bottom = PTOV(high_heap_base);
|
||||
if (high_heap_base < memtop_copyin)
|
||||
memtop_copyin = high_heap_base;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
heap_top = (void *)PTOV(bios_basemem);
|
||||
heap_bottom = (void *)end;
|
||||
}
|
||||
setheap(heap_bottom, heap_top);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue