Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151215209
D12368.id33187.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12368.id33187.diff
View Options
Index: head/sys/boot/i386/libi386/biosmem.c
===================================================================
--- head/sys/boot/i386/libi386/biosmem.c
+++ head/sys/boot/i386/libi386/biosmem.c
@@ -125,7 +125,7 @@
}
/*
- * Look for the largest segment in 'extended' memory beyond
+ * Look for the highest segment in 'extended' memory beyond
* 1MB but below 4GB.
*/
if ((smap.type == SMAP_TYPE_MEMORY) &&
@@ -140,9 +140,13 @@
if (smap.base + size > 0x100000000ull)
size = 0x100000000ull - smap.base;
- if (size > high_heap_size) {
- high_heap_size = size;
- high_heap_base = smap.base;
+ /*
+ * To make maximum space for the kernel and the modules,
+ * set heap to use highest HEAP_MIN bytes below 4GB.
+ */
+ if (high_heap_base < smap.base && size >= HEAP_MIN) {
+ high_heap_base = smap.base + size - HEAP_MIN;
+ high_heap_size = HEAP_MIN;
}
}
} while (v86.ebx != 0);
@@ -203,7 +207,11 @@
}
/* Set memtop to actual top of memory */
- memtop = memtop_copyin = 0x100000 + bios_extmem;
+ if (high_heap_size != 0) {
+ memtop = memtop_copyin = high_heap_base;
+ } else {
+ memtop = memtop_copyin = 0x100000 + bios_extmem;
+ }
/*
* If we have extended memory and did not find a suitable heap
@@ -213,6 +221,7 @@
if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) {
high_heap_size = HEAP_MIN;
high_heap_base = memtop - HEAP_MIN;
+ memtop = memtop_copyin = high_heap_base;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 9:51 PM (2 m, 31 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31051009
Default Alt Text
D12368.id33187.diff (1 KB)
Attached To
Mode
D12368: loader: biosmem allocate heap just below 4GB
Attached
Detach File
Event Timeline
Log In to Comment