summaryrefslogtreecommitdiff
path: root/Source/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel')
-rw-r--r--Source/Kernel/TaskManager/Process-sc.class.cpp18
-rw-r--r--Source/Kernel/TaskManager/Process.class.h4
2 files changed, 12 insertions, 10 deletions
diff --git a/Source/Kernel/TaskManager/Process-sc.class.cpp b/Source/Kernel/TaskManager/Process-sc.class.cpp
index 5a94c81..8564c22 100644
--- a/Source/Kernel/TaskManager/Process-sc.class.cpp
+++ b/Source/Kernel/TaskManager/Process-sc.class.cpp
@@ -9,8 +9,8 @@
call_t Process::m_callTable[] = {
CALL0(PRIF_EXIT, &Process::exitSC),
- CALL1(PRIF_ALLOCPAGE, &Process::allocPageSC),
- CALL1(PRIF_FREEPAGE, &Process::freePageSC),
+ CALL1(PRIF_ALLOCPAGES, &Process::allocPagesSC),
+ CALL1(PRIF_FREEPAGES, &Process::freePagesSC),
CALL0(PRIF_GETPID, &Process::getPid),
CALL0(PRIF_GETPPID, &Process::getPpid),
CALL0(PRIF_ARGC, &Process::argcSC),
@@ -50,11 +50,12 @@ u32int Process::exitSC() {
return 0;
}
-u32int Process::allocPageSC(u32int pos) {
+u32int Process::allocPagesSC(u32int pos, u32int count) {
if (Task::currProcess() != this) return 1;
if ((pos & 0x00000FFF) != 0) pos = (pos & 0xFFFFF000) + 0x1000;
- if (pos >= 0xC0000000) return 1;
- m_pagedir->allocFrame(pos, true, true);
+ if (pos + (count - 1) * 0x1000 >= 0xC0000000) return 1;
+ for (u32int i = 0; i < count; i++)
+ m_pagedir->allocFrame(pos + (i * 0x1000), true, true);
return 0;
}
@@ -73,11 +74,12 @@ u32int Process::argvSC(u32int idx) {
return (u32int) - 1;
}
-u32int Process::freePageSC(u32int pos) {
+u32int Process::freePagesSC(u32int pos, u32int count) {
if (Task::currProcess() != this) return 1;
if ((pos & 0x00000FFF) != 0) pos = (pos & 0xFFFFF000) + 0x1000;
- if (pos >= 0xC0000000) return 1;
- m_pagedir->freeFrame(pos);
+ if (pos + (count - 1) * 0x1000 >= 0xC0000000) return 1;
+ for (u32int i = 0; i < count; i++)
+ m_pagedir->freeFrame(pos + (i * 0x1000));
return 0;
}
diff --git a/Source/Kernel/TaskManager/Process.class.h b/Source/Kernel/TaskManager/Process.class.h
index 053a640..852c6cc 100644
--- a/Source/Kernel/TaskManager/Process.class.h
+++ b/Source/Kernel/TaskManager/Process.class.h
@@ -57,8 +57,8 @@ class Process : public Ressource {
u32int exitSC();
u32int argcSC();
u32int argvSC(u32int);
- u32int allocPageSC(u32int);
- u32int freePageSC(u32int);
+ u32int allocPagesSC(u32int, u32int);
+ u32int freePagesSC(u32int, u32int);
u32int startSC(); //Permits parent process to start run of process
u32int autoDeleteSC(u32int); //If true, process will auto-delete when it finishes. Else, it must be deleted by parent, while waiting for it.
u32int pushArgSC(u32int);