diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-18 18:46:59 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-18 18:46:59 +0200 |
commit | 776753bfa0c411f4b1a5680409104904961fcbeb (patch) | |
tree | 8e1d90bbc91a6925b86adbda9d91f6be50fd2388 /Source/Kernel/MemoryManager | |
parent | ccf807eb4ff541bb849c4f370d34123cb23d7d76 (diff) | |
download | Melon-776753bfa0c411f4b1a5680409104904961fcbeb.tar.gz Melon-776753bfa0c411f4b1a5680409104904961fcbeb.zip |
Mem::kalloc and Mem::kfree renamed to Mem::alloc and Mem::kfree
I renamed them so that they could have the same name in userland and in
kernel space. We'll just know that if we're writing kernel code then we
are allocating stuff in kernel memory, and if we're writing user code
then we're allocating userland memory.
Diffstat (limited to 'Source/Kernel/MemoryManager')
-rw-r--r-- | Source/Kernel/MemoryManager/Mem.ns.cpp | 4 | ||||
-rw-r--r-- | Source/Kernel/MemoryManager/Mem.ns.h | 4 | ||||
-rw-r--r-- | Source/Kernel/MemoryManager/PageAlloc.ns.cpp | 4 | ||||
-rw-r--r-- | Source/Kernel/MemoryManager/PhysMem.ns.cpp | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/Source/Kernel/MemoryManager/Mem.ns.cpp b/Source/Kernel/MemoryManager/Mem.ns.cpp index c705b3b..c7f07f0 100644 --- a/Source/Kernel/MemoryManager/Mem.ns.cpp +++ b/Source/Kernel/MemoryManager/Mem.ns.cpp @@ -39,14 +39,14 @@ void createHeap() { kheap.create(heapStart, heapSize, heapIndexSize, kernelPageDirectory, false, false); } -void *kalloc(u32int sz, bool align) { +void *alloc(u32int sz, bool align) { if (!kheap.usable()) return kallocInternal(sz, align); if (align) return 0; return kheap.alloc(sz); } -void kfree(void *ptr) { +void free(void *ptr) { kheap.free(ptr); } diff --git a/Source/Kernel/MemoryManager/Mem.ns.h b/Source/Kernel/MemoryManager/Mem.ns.h index 15935c0..0d2b1da 100644 --- a/Source/Kernel/MemoryManager/Mem.ns.h +++ b/Source/Kernel/MemoryManager/Mem.ns.h @@ -8,8 +8,8 @@ namespace Mem { extern u32int placementAddress; void createHeap(); - void *kalloc(u32int sz, bool align = false); - void kfree(void *ptr); + void *alloc(u32int sz, bool align = false); + void free(void *ptr); u32int kheapSize(), kheapFree(); } diff --git a/Source/Kernel/MemoryManager/PageAlloc.ns.cpp b/Source/Kernel/MemoryManager/PageAlloc.ns.cpp index 34d4f74..d8ede2a 100644 --- a/Source/Kernel/MemoryManager/PageAlloc.ns.cpp +++ b/Source/Kernel/MemoryManager/PageAlloc.ns.cpp @@ -14,7 +14,7 @@ bool usable = false, locked = false; void init() { freec = CACHED_PAGES; for (u32int i = 0; i < CACHED_PAGES; i++) { - freePage[i] = Mem::kalloc(0x1000, true); + freePage[i] = Mem::alloc(0x1000, true); } usable = true; } @@ -26,7 +26,7 @@ void* alloc(u32int* phys) { locked = true; void* next = 0; if (!Mem::pagingEnabled) { - next = Mem::kalloc(0x1000, true); + next = Mem::alloc(0x1000, true); } else { u32int i = 0xFFFFF000; page_t *p; diff --git a/Source/Kernel/MemoryManager/PhysMem.ns.cpp b/Source/Kernel/MemoryManager/PhysMem.ns.cpp index 25869f1..1b40e88 100644 --- a/Source/Kernel/MemoryManager/PhysMem.ns.cpp +++ b/Source/Kernel/MemoryManager/PhysMem.ns.cpp @@ -14,7 +14,7 @@ void initPaging(u32int mem_size) { frames = new Bitset(nframes); - kernelPageDirectory = new (Mem::kalloc(sizeof(PageDirectory), true)) PageDirectory(); + kernelPageDirectory = new (Mem::alloc(sizeof(PageDirectory), true)) PageDirectory(); u32int i = 0xC0000000; while (i < Mem::placementAddress) { |