From df343de7cca5f89f8e8d825fbcc1a49413412716 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 9 Dec 2009 16:26:59 +0100 Subject: Corrections --- Source/Library/Common/Heap.class.cpp | 12 +++++------- Source/Library/Interface/Process.iface.h | 4 ++-- Source/Library/Userland/Binding/Process.class.h | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'Source/Library') 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); -- cgit v1.2.3