summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKAKit/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-11-21 20:50:22 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-11-21 20:50:22 +0100
commit47a0e9b901e9e51b3f0ee5dd30d52ff1a5c8fcc0 (patch)
tree1c2e86bd4313bb40dfa3e70e7e31a8be71bf0c61 /dev/ZKAKit/KernelKit
parentd5397d2f3be6f3de742736e5d1fdfc3121879f70 (diff)
IMP: Compile using -Wall and scheduler improvements.
Diffstat (limited to 'dev/ZKAKit/KernelKit')
-rw-r--r--dev/ZKAKit/KernelKit/DeviceMgr.h4
-rw-r--r--dev/ZKAKit/KernelKit/DriveMgr.h30
-rw-r--r--dev/ZKAKit/KernelKit/FileMgr.h4
-rw-r--r--dev/ZKAKit/KernelKit/LPC.h4
-rw-r--r--dev/ZKAKit/KernelKit/UserProcessScheduler.h17
5 files changed, 31 insertions, 28 deletions
diff --git a/dev/ZKAKit/KernelKit/DeviceMgr.h b/dev/ZKAKit/KernelKit/DeviceMgr.h
index 57ecab3a..1b60c998 100644
--- a/dev/ZKAKit/KernelKit/DeviceMgr.h
+++ b/dev/ZKAKit/KernelKit/DeviceMgr.h
@@ -41,7 +41,9 @@ namespace Kernel
{
public:
explicit IDeviceObject(void (*Out)(T), void (*In)(T))
- : fOut(Out), fIn(In) {}
+ : fOut(Out), fIn(In)
+ {
+ }
virtual ~IDeviceObject() = default;
diff --git a/dev/ZKAKit/KernelKit/DriveMgr.h b/dev/ZKAKit/KernelKit/DriveMgr.h
index 5cc0571e..87f3a5e2 100644
--- a/dev/ZKAKit/KernelKit/DriveMgr.h
+++ b/dev/ZKAKit/KernelKit/DriveMgr.h
@@ -16,10 +16,10 @@
#include <NewKit/KString.h>
#include <NewKit/Ref.h>
-#define kDriveMaxCount (4U)
-#define kDriveSectorSz (512U)
-#define kDriveInvalidID (-1)
-#define kDriveNameLen (32)
+#define kDriveMaxCount (4U)
+#define kDriveSectorSz (512U)
+#define kDriveInvalidID (-1)
+#define kDriveNameLen (32)
#define drv_sector_cnt(SIZE, SECTOR_SZ) (((SIZE) + (SECTOR_SZ)) / (SECTOR_SZ))
@@ -30,14 +30,14 @@ namespace Kernel
kInvalidDisc = -1,
/// Storage types, combine with flags.
- kBlockDevice = 0xAD,
+ kBlockDevice = 0xAD,
kMassStorageDisc = 0xDA,
- kFloppyDisc = 0xCD,
- kOpticalDisc = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray
- kTapeDisc = 0xD7,
+ kFloppyDisc = 0xCD,
+ kOpticalDisc = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray
+ kTapeDisc = 0xD7,
/// Storage flags, combine with types.
- kReadOnlyDrive = 0x10, // Read only drive
+ kReadOnlyDrive = 0x10, // Read only drive
kEPMDrive = 0x11, // Explicit Partition Map.
kEPTDrive = 0x12, // ESP w/ EPM partition.
kMBRDrive = 0x13, // PC classic partition scheme
@@ -49,17 +49,17 @@ namespace Kernel
/// @brief Media drive trait type.
struct DriveTrait final
{
- Char fName[kDriveNameLen]; // /System, /Boot, //./Devices/USB...
- Int32 fKind; // fMassStorage, fFloppy, fOpticalDisc.
- Int32 fFlags; // fReadOnly, fXPMDrive, fXPTDrive
+ Char fName[kDriveNameLen]; // /System, /Boot, //./Devices/USB...
+ Int32 fKind; // fMassStorage, fFloppy, fOpticalDisc.
+ Int32 fFlags; // fReadOnly, fXPMDrive, fXPTDrive
/// @brief Packet drive (StorageKit compilant.)
struct DrivePacket final
{
- VoidPtr fPacketContent{nullptr}; //! packet body.
+ VoidPtr fPacketContent{nullptr}; //! packet body.
Char fPacketMime[kDriveNameLen] = "*/*"; //! identify what we're sending.
- SizeT fPacketSize{0UL}; //! packet size
- UInt32 fPacketCRC32{0UL}; //! sanity crc, in case if good is set to false
+ SizeT fPacketSize{0UL}; //! packet size
+ UInt32 fPacketCRC32{0UL}; //! sanity crc, in case if good is set to false
Boolean fPacketGood{YES};
Lba fPacketLba{0UL};
Boolean fPacketReadOnly{NO};
diff --git a/dev/ZKAKit/KernelKit/FileMgr.h b/dev/ZKAKit/KernelKit/FileMgr.h
index a466f763..f8a9c268 100644
--- a/dev/ZKAKit/KernelKit/FileMgr.h
+++ b/dev/ZKAKit/KernelKit/FileMgr.h
@@ -377,10 +377,10 @@ namespace Kernel
/// @brief constructor
template <typename Encoding, typename Class>
inline FileStream<Encoding, Class>::FileStream(const Encoding* path,
- const Encoding* restrict_type)
+ const Encoding* restrict_type)
: fFile(Class::GetMounted()->Open(path, restrict_type))
{
- const SizeT kRestrictCount = kRestrictMax;
+ const SizeT kRestrictCount = kRestrictMax;
const FileRestrictKind kRestrictList[] = {
{
.fRestrict = kRestrictR,
diff --git a/dev/ZKAKit/KernelKit/LPC.h b/dev/ZKAKit/KernelKit/LPC.h
index 66fd3a4d..1bb30e91 100644
--- a/dev/ZKAKit/KernelKit/LPC.h
+++ b/dev/ZKAKit/KernelKit/LPC.h
@@ -15,9 +15,9 @@
#define ErrLocalFailed() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode() != Kernel::kErrorSuccess)
#define ErrLocal() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode())
-#define ErrGlobalIsOk() (Kernel::kErrorLocalNumber == Kernel::kErrorSuccess)
+#define ErrGlobalIsOk() (Kernel::kErrorLocalNumber == Kernel::kErrorSuccess)
#define ErrGlobalFailed() (Kernel::kErrorLocalNumber != Kernel::kErrorSuccess)
-#define ErrGlobal() (Kernel::kErrorLocalNumber)
+#define ErrGlobal() (Kernel::kErrorLocalNumber)
namespace Kernel
{
diff --git a/dev/ZKAKit/KernelKit/UserProcessScheduler.h b/dev/ZKAKit/KernelKit/UserProcessScheduler.h
index 2ffb27c0..dc96010e 100644
--- a/dev/ZKAKit/KernelKit/UserProcessScheduler.h
+++ b/dev/ZKAKit/KernelKit/UserProcessScheduler.h
@@ -39,7 +39,7 @@ namespace Kernel
typedef Int64 ProcessID;
//! @brief Local Process name length.
- inline constexpr SizeT kProcessNameLen = 128U;
+ inline constexpr SizeT kProcessNameLen = 128U;
inline constexpr ProcessID kProcessInvalidID = -1;
//! @brief Local Process status enum.
@@ -50,7 +50,8 @@ namespace Kernel
kRunning,
kKilled,
kFrozen,
- kDead,
+ KFinishing,
+ kFinished,
kCount,
};
@@ -131,7 +132,7 @@ namespace Kernel
{
ImagePtr fCode;
ImagePtr fBlob;
-
+
operator bool()
{
return this->fCode;
@@ -161,11 +162,11 @@ namespace Kernel
User* Owner{nullptr};
HAL::StackFramePtr StackFrame{nullptr};
AffinityKind Affinity{AffinityKind::kStandard};
- ProcessStatusKind Status{ProcessStatusKind::kDead};
+ ProcessStatusKind Status{ProcessStatusKind::kFinished};
UInt8* StackReserve{nullptr};
UserProcessImage Image;
SizeT StackSize{kSchedMaxStackSz};
- IDLLObject* PefDLLDelegate{nullptr};
+ IDLLObject* PefDLLDelegate{nullptr};
SizeT MemoryCursor{0};
SizeT MemoryLimit{kSchedMaxMemoryLimit};
@@ -181,12 +182,12 @@ namespace Kernel
struct UserProcessSignal final
{
- UIntPtr SignalIP;
+ UIntPtr SignalIP;
ProcessStatusKind PreviousStatus;
- UIntPtr SignalID;
+ UIntPtr SignalID;
};
- UserProcessSignal ProcessSignal;
+ UserProcessSignal ProcessSignal;
UserProcessHeapList* MemoryHeap{nullptr};
VoidPtr VMRegister{0UL};