1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-30 00:00:15 +01:00

add also the option to map bss section on demand

This commit is contained in:
Stefan Lankes 2018-05-16 22:54:34 +02:00
parent 0b1c47092a
commit 0c6061bc6c

View file

@ -49,6 +49,7 @@
/* Note that linker symbols are not variables, they have no memory
* allocated for maintaining a value, rather their address is their value. */
extern const void kernel_start;
extern const void __bss_start;
/** Single-address space operating system => one lock for all tasks */
static spinlock_irqsave_t page_lock = SPINLOCK_IRQSAVE_INIT;
@ -220,7 +221,8 @@ void page_fault_handler(struct state *s)
spinlock_irqsave_lock(&page_lock);
if ((task->heap) && (viraddr >= task->heap->start) && (viraddr < task->heap->end)) {
if (((task->heap) && (viraddr >= task->heap->start) && (viraddr < task->heap->end))
|| ((viraddr >= (size_t) &__bss_start) && (viraddr < (size_t) &kernel_start + image_size))) {
size_t flags;
int ret;