summaryrefslogtreecommitdiff
path: root/Source/Library
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-09 16:26:59 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-09 16:26:59 +0100
commitdf343de7cca5f89f8e8d825fbcc1a49413412716 (patch)
tree5c48afbd76c5cfc4c1297fc18acb0bc71cd502b3 /Source/Library
parent1a1e0efa7b1894848c81d7f7e80bdcf6e8591c3f (diff)
downloadMelon-df343de7cca5f89f8e8d825fbcc1a49413412716.tar.gz
Melon-df343de7cca5f89f8e8d825fbcc1a49413412716.zip
Corrections
Diffstat (limited to 'Source/Library')
-rw-r--r--Source/Library/Common/Heap.class.cpp12
-rw-r--r--Source/Library/Interface/Process.iface.h4
-rw-r--r--Source/Library/Userland/Binding/Process.class.h8
3 files changed, 11 insertions, 13 deletions
diff --git a/Source/Library/Common/Heap.class.cpp b/Source/Library/Common/Heap.class.cpp
index 2491e00..7a6c6d8 100644
--- a/Source/Library/Common/Heap.class.cpp
+++ b/Source/Library/Common/Heap.class.cpp
@@ -34,16 +34,14 @@ void Heap::create(u32int start, u32int size, u32int idxsize) {
m_pagedir = pagedir;
m_user = user;
m_rw = rw;
-#endif
//Allocate frames for heap
-#ifdef THIS_IS_MELON_KERNEL
- for (u32int i = m_start ; i < m_end; i += 0x1000) {
+ for (u32int i = start ; i < m_end; i += 0x1000) {
m_pagedir->allocFrame(i, m_user, m_rw);
}
m_pagedir->switchTo();
#else
- m_process.allocPages(start, (m_end - start) / 0x1000);
+ m_process.allocPages(start, m_end);
#endif
m_index.data = (heap_header_t **)start; //Set index start. start == start of all heap
@@ -73,11 +71,11 @@ void Heap::expand(u32int quantity) {
u32int newEnd = m_end + quantity;
#ifdef THIS_IS_MELON_KERNEL
- for (u32int i = m_start ; i < m_end; i += 0x1000) {
+ for (u32int i = m_end ; i < newEnd; i += 0x1000) {
m_pagedir->allocFrame(i, m_user, m_rw);
}
#else
- m_process.allocPages(m_start, (m_end - m_start) / 0x1000);
+ m_process.allocPages(m_end, newEnd);
#endif
heap_footer_t *last_footer = (heap_footer_t*) (m_end - sizeof(heap_footer_t));
@@ -136,7 +134,7 @@ void Heap::contract() { //Automatically work out how much we can contract
m_pagedir->freeFrame(i);
}
#else
- m_process.freePages(newEnd, (m_end - newEnd) / 0x1000);
+ m_process.freePages(newEnd, m_end);
#endif
m_end = newEnd;
diff --git a/Source/Library/Interface/Process.iface.h b/Source/Library/Interface/Process.iface.h
index b387801..261afa7 100644
--- a/Source/Library/Interface/Process.iface.h
+++ b/Source/Library/Interface/Process.iface.h
@@ -11,8 +11,8 @@
#define PRIF_SWAIT 2 //Wait for a process to end (i:return value) | R:process to wait for
#define PRIF_EXIT 0x01 //Exit from current process (v) | no arguments
-#define PRIF_ALLOCPAGES 0x02 //Allocate frames for pages (v) | i:position, i:count
-#define PRIF_FREEPAGES 0x03 //Free frames for pages (v) | i:position, i:count
+#define PRIF_ALLOCPAGES 0x02 //Allocate frames for pages (v) | i:start, i:end
+#define PRIF_FREEPAGES 0x03 //Free frames for pages (v) | i:start, i:end
#define PRIF_GETPID 0x04 //Get PID of a process (i) | no arguments
#define PRIF_GETPPID 0x05 //Get PPID of a process (i) | no arguments
#define PRIF_GETUID 0x06 //Get UID of a process (i) | no arguments
diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h
index 1a1481f..2200f59 100644
--- a/Source/Library/Userland/Binding/Process.class.h
+++ b/Source/Library/Userland/Binding/Process.class.h
@@ -21,11 +21,11 @@ class Process : public RessourceCaller {
void exit() {
doCall(PRIF_EXIT);
}
- void allocPages(u32int pos, u32int count) {
- doCall(PRIF_ALLOCPAGES, pos, count);
+ void allocPages(u32int pos, u32int end) {
+ doCall(PRIF_ALLOCPAGES, pos, end);
}
- void freePages(u32int pos, u32int count) {
- doCall(PRIF_FREEPAGES, pos, count);
+ void freePages(u32int pos, u32int end) {
+ doCall(PRIF_FREEPAGES, pos, end);
}
u32int getPid() {
return doCall(PRIF_GETPID);