summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/SwapKit/SwapDisk.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 17:24:21 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 17:24:21 +0100
commitb8f7ef086d1d1b1cd686fff04d0a587f8fd39d81 (patch)
treeb6c2eb3ca2c51dc87ddd81b6170d5f63eabb9090 /dev/kernel/SwapKit/SwapDisk.h
parenteb86df50ec5afb392998e2e171de54e1f26d8e7a (diff)
add: new driver device kit API. (DDK)
refactor: rename SCIKit -> user (then libuser.dylib) boot/modules/netboot: fixed compilation for amd64. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/SwapKit/SwapDisk.h')
-rw-r--r--dev/kernel/SwapKit/SwapDisk.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/dev/kernel/SwapKit/SwapDisk.h b/dev/kernel/SwapKit/SwapDisk.h
deleted file mode 100644
index b9c31a65..00000000
--- a/dev/kernel/SwapKit/SwapDisk.h
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/* -------------------------------------------
-
- Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <NewKit/Defines.h>
-#include <CompilerKit/CompilerKit.h>
-
-#define kSwapBlockMaxSize (mib_cast(16))
-#define kSwapPageFile "/boot/pagefile.sys"
-
-/// @file SwapDisk.h
-/// @brief Virtual memory swap disk.
-
-namespace NeOS
-{
- struct SWAP_DISK_HEADER;
-
- /// @brief Virtual memory interface to swap memory chunks onto disk.
- class SwapDiskInterface final
- {
- public:
- explicit SwapDiskInterface() = default;
- ~SwapDiskInterface() = default;
-
- NE_COPY_DEFAULT(SwapDiskInterface);
-
- public:
- /***********************************************************************************/
- /// @brief Write memory chunk onto disk.
- /// @param fork_name The swap name to recognize this memory region.
- /// @param fork_name_len length of fork name.
- /// @param data the data packet.
- /// @return Whether the swap was written to disk, or not.
- /***********************************************************************************/
- BOOL Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data);
-
- /***********************************************************************************/
- /// @brief Read memory chunk from disk.
- /// @param fork_name The swap name to recognize this memory region.
- /// @param fork_name_len length of fork name.
- /// @param data the data packet length.
- /// @return Whether the swap was fetched to disk, or not.
- /***********************************************************************************/
- SWAP_DISK_HEADER* Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len);
- };
-
- /// @brief Swap disk header, containing information about the held virtual memory.
- /// @param fMagic Ident number.
- /// @param fHeaderSz This header size.
- /// @param fTeamID Process Team ID.
- /// @param fProcessID Process ID.
- /// @param fVirtualAddress Virtual address pointed by data.
- /// @param fBlobSz Blob's size.
- /// @param fBlob Data blob.
- typedef struct SWAP_DISK_HEADER
- {
- UInt32 fMagic;
- SizeT fHeaderSz;
- UInt64 fTeamID;
- UInt64 fProcessID;
- UInt64 fVirtualAddress;
- SizeT fBlobSz;
- UInt8 fBlob[];
- } PACKED SWAP_DISK_HEADER;
-} // namespace NeOS