aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/user
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-03-02 18:21:59 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-03-02 18:21:59 +0100
commit1a5c518ee1536db50dccd8766ce78c3790aec059 (patch)
tree0605cabbb817270a4484d2eb8d33b615006e71ce /src/kernel/user
parentceb687b02964197133fd2236cdbc74bf3948d034 (diff)
downloadkogata-1a5c518ee1536db50dccd8766ce78c3790aec059.tar.gz
kogata-1a5c518ee1536db50dccd8766ce78c3790aec059.zip
More uses of free_some_memory()
Diffstat (limited to 'src/kernel/user')
-rw-r--r--src/kernel/user/process.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c
index 989a47a..4dea882 100644
--- a/src/kernel/user/process.c
+++ b/src/kernel/user/process.c
@@ -4,6 +4,7 @@
#include <frame.h>
#include <process.h>
+#include <freemem.h>
static int next_pid = 1;
@@ -345,14 +346,12 @@ static void proc_usermem_pf(void* p, registers_t *regs, void* addr) {
frame = file_get_page(r->file, addr - r->addr + r->file_offset);
}
if (frame == 0) {
- dbg_printf("OOM for process %d ; yielding and waiting for someone to free some RAM.\n", proc->pid);
- yield();
+ free_some_memory();
}
} while (frame == 0);
while(!pd_map_page(addr, frame, (r->mode & MM_WRITE) != 0)) {
- dbg_printf("OOM(2) for process %d ; yielding and waiting for someone to free some RAM.\n", proc->pid);
- yield();
+ free_some_memory();
}
if (r->file == 0) memset(addr, 0, PAGE_SIZE); // zero out