NeKernel dev
Loading...
Searching...
No Matches
DiskSwap.h
Go to the documentation of this file.
2/* ========================================
4 Copyright (C) 2024-2025 Amlal El Mahrouss , licensed under the Apache 2.0 license.
6======================================== */
7
8#pragma once
9
11#include <NeKit/Config.h>
12#include <hint/CompilerHint.h>
13
14#define kSwapBlockMaxSize (mib_cast(16))
15#define kSwapPageFilePath "/boot/pagefile.sys"
16
19
20namespace Kernel {
21struct SWAP_DISK_HEADER;
22class DiskSwapInterface;
23
27class DiskSwapInterface final {
28 public:
29 explicit DiskSwapInterface() = default;
30 ~DiskSwapInterface() = default;
31
34
35 public:
36 /***********************************************************************************/
42 /***********************************************************************************/
43 BOOL Write(const Char* name, SizeT name_len, SWAP_DISK_HEADER* data);
44
45 /***********************************************************************************/
51 /***********************************************************************************/
52 _Output SWAP_DISK_HEADER* Read(const Char* name, SizeT name_len, SizeT data_len);
53};
54
72} // namespace Kernel
#define _Output
Definition CompilerHint.h:15
#define NE_COPY_DELETE(KLASS)
Definition Detail.h:13
#define NE_MOVE_DELETE(KLASS)
Definition Detail.h:21
#define PACKED
#define ALIGN(X)
#define BOOL
BOOL Write(const Char *name, SizeT name_len, SWAP_DISK_HEADER *data)
Write memory chunk onto disk.
Definition DiskSwap.cc:20
_Output SWAP_DISK_HEADER * Read(const Char *name, SizeT name_len, SizeT data_len)
Read memory chunk from disk.
Definition DiskSwap.cc:43
UPS inline definitions.
Definition Device.h:12
char Char
Definition Config.h:51
__SIZE_TYPE__ SizeT
Definition Config.h:60
__UINT8_TYPE__ UInt8
Definition Config.h:55
__UINT32_TYPE__ UInt32
Definition Config.h:44
__UINT64_TYPE__ UInt64
Definition Config.h:48
Swap disk header, containing information about the held virtual memory.
Definition DiskSwap.h:63
UInt8 fBlob[1]
Definition DiskSwap.h:70
SizeT fBlobSz
Definition DiskSwap.h:69
SizeT fHeaderSz
Definition DiskSwap.h:65
UInt32 fMagic
Definition DiskSwap.h:64
UInt64 fProcessID
Definition DiskSwap.h:67
UInt64 fVirtualAddress
Definition DiskSwap.h:68
UInt64 fTeamID
Definition DiskSwap.h:66