Add skeleton for memory pool allocator
This commit is contained in:
@@ -51,12 +51,14 @@ list(APPEND XTOSKRNL_SOURCE
|
|||||||
${XTOSKRNL_SOURCE_DIR}/ke/spinlock.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/spinlock.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/sysres.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/sysres.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ke/timer.cc
|
${XTOSKRNL_SOURCE_DIR}/ke/timer.cc
|
||||||
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/alloc.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/mmgr.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/mmgr.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pagemap.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pagemap.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/paging.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/paging.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfault.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfault.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfn.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfn.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pte.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pte.cc
|
||||||
|
${XTOSKRNL_SOURCE_DIR}/mm/alloc.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/colors.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/colors.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/data.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/data.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/hlpool.cc
|
${XTOSKRNL_SOURCE_DIR}/mm/hlpool.cc
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include XTOS_ARCH_HEADER(mm, paging.hh)
|
#include XTOS_ARCH_HEADER(mm, paging.hh)
|
||||||
#include XTOS_ARCH_HEADER(mm, pte.hh)
|
#include XTOS_ARCH_HEADER(mm, pte.hh)
|
||||||
|
|
||||||
|
#include <mm/alloc.hh>
|
||||||
#include <mm/colors.hh>
|
#include <mm/colors.hh>
|
||||||
#include <mm/hlpool.hh>
|
#include <mm/hlpool.hh>
|
||||||
#include <mm/kpool.hh>
|
#include <mm/kpool.hh>
|
||||||
|
|||||||
25
xtoskrnl/includes/mm/alloc.hh
Normal file
25
xtoskrnl/includes/mm/alloc.hh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtoskrnl/includes/mm/alloc.hh
|
||||||
|
* DESCRIPTION: Memory manager pool allocation
|
||||||
|
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __XTOSKRNL_MM_ALLOC_HH
|
||||||
|
#define __XTOSKRNL_MM_ALLOC_HH
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
/* Memory Manager */
|
||||||
|
namespace MM
|
||||||
|
{
|
||||||
|
class Allocator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
STATIC XTAPI VOID InitializeNonPagedPool(VOID);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __XTOSKRNL_MM_ALLOC_HH */
|
||||||
11
xtoskrnl/mm/alloc.cc
Normal file
11
xtoskrnl/mm/alloc.cc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtoskrnl/mm/alloc.cc
|
||||||
|
* DESCRIPTION: Memory manager pool allocation
|
||||||
|
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
29
xtoskrnl/mm/amd64/alloc.cc
Normal file
29
xtoskrnl/mm/amd64/alloc.cc
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtoskrnl/mm/amd64/alloc.cc
|
||||||
|
* DESCRIPTION: Memory manager pool allocation
|
||||||
|
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
MM::Allocator::InitializeNonPagedPool(VOID)
|
||||||
|
{
|
||||||
|
PMMMEMORY_LAYOUT MemoryLayout;
|
||||||
|
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
/* Retrieve memory layout */
|
||||||
|
MemoryLayout = MM::Manager::GetMemoryLayout();
|
||||||
|
|
||||||
|
/* Map PPE and PDE for whole non-paged pool */
|
||||||
|
MM::Pte::MapPPE(MemoryLayout->NonPagedPoolStart, MemoryLayout->NonPagedExpansionPoolEnd, MM::Pte::GetValidPte());
|
||||||
|
MM::Pte::MapPDE(MemoryLayout->NonPagedPoolStart, MemoryLayout->NonPagedExpansionPoolEnd, MM::Pte::GetValidPte());
|
||||||
|
|
||||||
|
/* Map PTE only for the base of the non-paged pool */
|
||||||
|
MM::Pte::MapPTE(MemoryLayout->NonPagedPoolStart, (PCHAR)MemoryLayout->NonPagedPoolEnd - 1, MM::Pte::GetValidPte());
|
||||||
|
}
|
||||||
17
xtoskrnl/mm/i686/alloc.cc
Normal file
17
xtoskrnl/mm/i686/alloc.cc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtoskrnl/mm/i686/alloc.cc
|
||||||
|
* DESCRIPTION: Memory manager pool allocation
|
||||||
|
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
MM::Allocator::InitializeNonPagedPool(VOID)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user