Introduce page fault handling infrastructure
This commit is contained in:
@@ -54,6 +54,7 @@ list(APPEND XTOSKRNL_SOURCE
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/mmgr.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pagemap.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/paging.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfault.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pfn.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pte.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/colors.cc
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <mm/hlpool.hh>
|
||||
#include <mm/kpool.hh>
|
||||
#include <mm/mmgr.hh>
|
||||
#include <mm/pfault.hh>
|
||||
#include <mm/pfn.hh>
|
||||
|
||||
#endif /* __XTOSKRNL_MM_HH */
|
||||
|
||||
25
xtoskrnl/includes/mm/pfault.hh
Normal file
25
xtoskrnl/includes/mm/pfault.hh
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/includes/mm/pfault.hh
|
||||
* DESCRIPTION: Page fault support
|
||||
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef __XTOSKRNL_MM_PFAULT_HH
|
||||
#define __XTOSKRNL_MM_PFAULT_HH
|
||||
|
||||
#include <xtos.hh>
|
||||
|
||||
|
||||
/* Memory Manager */
|
||||
namespace MM
|
||||
{
|
||||
class PageFault
|
||||
{
|
||||
public:
|
||||
STATIC XTFASTCALL XTSTATUS CheckPdeForPagedPool(IN PVOID VirtualAddress);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __XTOSKRNL_MM_PFAULT_HH */
|
||||
26
xtoskrnl/mm/amd64/pfault.cc
Normal file
26
xtoskrnl/mm/amd64/pfault.cc
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/mm/amd64/pfault.cc
|
||||
* DESCRIPTION: Page fault support for AMD64 architecture
|
||||
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||
*/
|
||||
|
||||
#include <xtos.hh>
|
||||
|
||||
|
||||
/**
|
||||
* Evaluates the PDE for for paged pool and per-session mappings.
|
||||
*
|
||||
* @param VirtualAddress
|
||||
* Specifies the virtual address to verify.
|
||||
*
|
||||
* @return This routine returns ACCESS_VIOLATION regardless PML4 or PML5 is used.
|
||||
*/
|
||||
XTFASTCALL
|
||||
XTSTATUS
|
||||
MM::PageFault::CheckPdeForPagedPool(IN PVOID VirtualAddress)
|
||||
{
|
||||
/* Return access violation */
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
}
|
||||
36
xtoskrnl/mm/i686/pfault.cc
Normal file
36
xtoskrnl/mm/i686/pfault.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/mm/i686/pfault.cc
|
||||
* DESCRIPTION: Page fault support for i686 architecture
|
||||
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||
*/
|
||||
|
||||
#include <xtos.hh>
|
||||
|
||||
|
||||
/**
|
||||
* Evaluates the PDE for for paged pool and per-session mappings.
|
||||
*
|
||||
* @param VirtualAddress
|
||||
* Specifies the virtual address to verify.
|
||||
*
|
||||
* @return This routine returns ACCESS_VIOLATION on PML3 or status code on PML2.
|
||||
*/
|
||||
XTFASTCALL
|
||||
XTSTATUS
|
||||
MM::PageFault::CheckPdeForPagedPool(IN PVOID VirtualAddress)
|
||||
{
|
||||
/* Check if XPA is enabled */
|
||||
if(MM::Paging::GetXpaStatus())
|
||||
{
|
||||
/* Access violation for PML3 */
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
}
|
||||
|
||||
/* Unimplemented path for PML2 */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Temporarily, just return access violation */
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
}
|
||||
Reference in New Issue
Block a user