summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/SwapKit/DiskSwap.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-16 10:05:50 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-16 10:08:17 +0100
commitc258c2e5fa9f5134dbc56f717ba37231a08a9081 (patch)
treeb2a2fd77e4672aa605fa3755e165fd16a93b53a5 /src/kernel/SwapKit/DiskSwap.h
parent3f7d7c7b64e4d731143f0d82cd52ded5c2fb091f (diff)
chore: kernel improvements and tweaks on the kernel.
- Two default domains: - Computable domain, alias: Domain<T>. - Non-Computable domain, alias: NullDomain. - DiskSwap API improvements. - Vettable Now returns the Result object instead of its value. - Kernel shall not panic when `ptr_new` returns null. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/SwapKit/DiskSwap.h')
-rw-r--r--src/kernel/SwapKit/DiskSwap.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/kernel/SwapKit/DiskSwap.h b/src/kernel/SwapKit/DiskSwap.h
index 7b3cb0f1..c3297c66 100644
--- a/src/kernel/SwapKit/DiskSwap.h
+++ b/src/kernel/SwapKit/DiskSwap.h
@@ -18,19 +18,19 @@
/// @brief Virtual memory swap disk.
namespace Kernel {
-struct SWAP_DISK_HEADER;
-class DiskSwapInterface;
+struct SwapDiskHdr;
+class IDiskSwap;
/// @brief Virtual memory interface to swap memory chunks onto disk.
/// @note The class only supports the NeFS as of right now, as it is using forks to write data into
/// disk.
-class DiskSwapInterface final {
+class IDiskSwap final {
public:
- explicit DiskSwapInterface() = default;
- ~DiskSwapInterface() = default;
+ explicit IDiskSwap() = default;
+ ~IDiskSwap() = default;
- NE_COPY_DELETE(DiskSwapInterface)
- NE_MOVE_DELETE(DiskSwapInterface)
+ NE_COPY_DELETE(IDiskSwap)
+ NE_MOVE_DELETE(IDiskSwap)
public:
/***********************************************************************************/
@@ -40,7 +40,7 @@ class DiskSwapInterface final {
/// @param data the data packet.
/// @return Whether the swap was written to disk, or not.
/***********************************************************************************/
- BOOL Write(const Char* name, SizeT name_len, SWAP_DISK_HEADER* data);
+ BOOL Write(const Char* name, SizeT name_len, SwapDiskHdr* data);
/***********************************************************************************/
/// @brief Read memory chunk from disk.
@@ -49,7 +49,7 @@ class DiskSwapInterface final {
/// @param data the data packet length.
/// @return Whether the swap was fetched to disk, or not.
/***********************************************************************************/
- _Output SWAP_DISK_HEADER* Read(const Char* name, SizeT name_len, SizeT data_len);
+ _Output SwapDiskHdr* Read(const Char* name, SizeT name_len, SizeT data_len);
};
/// @brief Swap disk header, containing information about the held virtual memory.
@@ -60,7 +60,7 @@ class DiskSwapInterface final {
/// @param fVirtualAddress Virtual address pointed by data.
/// @param fBlobSz Blob's size.
/// @param fBlob Data blob.
-typedef struct SWAP_DISK_HEADER {
+typedef struct SwapDiskHdr {
UInt32 fMagic;
SizeT fHeaderSz;
UInt64 fTeamID;
@@ -68,5 +68,5 @@ typedef struct SWAP_DISK_HEADER {
UInt64 fVirtualAddress;
SizeT fBlobSz;
UInt8 fBlob[1];
-} PACKED ALIGN(8) SWAP_DISK_HEADER;
+} PACKED ALIGN(8) SwapDiskHdr;
} // namespace Kernel