diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-09 16:26:59 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-09 16:26:59 +0100 |
commit | df343de7cca5f89f8e8d825fbcc1a49413412716 (patch) | |
tree | 5c48afbd76c5cfc4c1297fc18acb0bc71cd502b3 /Source/Kernel | |
parent | 1a1e0efa7b1894848c81d7f7e80bdcf6e8591c3f (diff) | |
download | Melon-df343de7cca5f89f8e8d825fbcc1a49413412716.tar.gz Melon-df343de7cca5f89f8e8d825fbcc1a49413412716.zip |
Corrections
Diffstat (limited to 'Source/Kernel')
-rw-r--r-- | Source/Kernel/TaskManager/Process-sc.class.cpp | 22 |
1 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 e5910af..6085e3f 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_ALLOCPAGES, &Process::allocPagesSC), - CALL1(PRIF_FREEPAGES, &Process::freePagesSC), + CALL2(PRIF_ALLOCPAGES, &Process::allocPagesSC), + CALL2(PRIF_FREEPAGES, &Process::freePagesSC), CALL0(PRIF_GETPID, &Process::getPid), CALL0(PRIF_GETPPID, &Process::getPpid), CALL0(PRIF_GETUID, &Process::getUid), @@ -51,12 +51,13 @@ u32int Process::exitSC() { return 0; } -u32int Process::allocPagesSC(u32int pos, u32int count) { +u32int Process::allocPagesSC(u32int pos, u32int end) { if (Task::currProcess() != this) return 1; if ((pos & 0x00000FFF) != 0) pos = (pos & 0xFFFFF000) + 0x1000; - if (pos + (count - 1) * 0x1000 >= 0xC0000000) return 1; - for (u32int i = 0; i < count; i++) - m_pagedir->allocFrame(pos + (i * 0x1000), true, true); + if ((end & 0x00000FFF) != 0) end = (end & 0xFFFFF000) + 0x1000; + if (end - 1 >= 0xC0000000) return 1; + for (u32int i = pos; i < end; i += 0x1000) + m_pagedir->allocFrame(i, true, true); return 0; } @@ -75,12 +76,13 @@ u32int Process::argvSC(u32int idx) { return (u32int) - 1; } -u32int Process::freePagesSC(u32int pos, u32int count) { +u32int Process::freePagesSC(u32int pos, u32int end) { if (Task::currProcess() != this) return 1; if ((pos & 0x00000FFF) != 0) pos = (pos & 0xFFFFF000) + 0x1000; - if (pos + (count - 1) * 0x1000 >= 0xC0000000) return 1; - for (u32int i = 0; i < count; i++) - m_pagedir->freeFrame(pos + (i * 0x1000)); + if ((end & 0x00000FFF) != 0) end = (end & 0xFFFFF000) + 0x1000; + if (end - 1 >= 0xC0000000) return 1; + for (u32int i = pos; i < end; i += 0x1000) + m_pagedir->freeFrame(i); return 0; } |