diff options
Diffstat (limited to 'Kernel/KernelKit')
| -rw-r--r-- | Kernel/KernelKit/FileManager.hpp | 46 | ||||
| -rw-r--r-- | Kernel/KernelKit/HError.hpp | 10 | ||||
| -rw-r--r-- | Kernel/KernelKit/PEFCodeManager.hxx | 8 | ||||
| -rw-r--r-- | Kernel/KernelKit/ProcessScheduler.hxx | 16 |
4 files changed, 44 insertions, 36 deletions
diff --git a/Kernel/KernelKit/FileManager.hpp b/Kernel/KernelKit/FileManager.hpp index c154438e..a687b301 100644 --- a/Kernel/KernelKit/FileManager.hpp +++ b/Kernel/KernelKit/FileManager.hpp @@ -50,7 +50,8 @@ namespace NewOS }; /// @brief filesystem node generic type. - struct PACKED FMNode final { + struct PACKED FMNode final + { VoidPtr _Unused; }; @@ -95,19 +96,23 @@ namespace NewOS virtual NodePtr Open(_Input const char* path, _Input const char* r) = 0; public: - virtual Void Write(_Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, _Input SizeT size) = 0; - + virtual Void Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size) = 0; + virtual _Output VoidPtr Read(_Input NodePtr node, - _Input Int32 flags, _Input SizeT sz) = 0; - + _Input Int32 flags, + _Input SizeT sz) = 0; + virtual Void Write(_Input const Char* name, - _Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, _Input SizeT size) = 0; + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) = 0; virtual _Output VoidPtr Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, _Input SizeT sz) = 0; + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) = 0; + public: virtual bool Seek(_Input NodePtr node, _Input SizeT off) = 0; @@ -143,17 +148,18 @@ namespace NewOS bool Seek(NodePtr node, SizeT off); SizeT Tell(NodePtr node) override; bool Rewind(NodePtr node) override; - + Void Write(_Input const Char* name, - _Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, - _Input SizeT size) override; + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) override; _Output VoidPtr Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, - _Input SizeT sz) override; - + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) override; + public: void SetResourceFork(const char* forkName); void SetDataFork(const char* forkName); @@ -292,7 +298,7 @@ namespace NewOS using FileStreamUTF16 = FileStream<WideChar>; typedef UInt64 CursorType; - + /// @brief constructor template <typename Encoding, typename Class> FileStream<Encoding, Class>::FileStream(const Encoding* path, @@ -303,7 +309,7 @@ namespace NewOS } /// @brief destructor - template<typename Encoding, typename Class> + template <typename Encoding, typename Class> FileStream<Encoding, Class>::~FileStream() { delete fFile; diff --git a/Kernel/KernelKit/HError.hpp b/Kernel/KernelKit/HError.hpp index 61cfd5af..a160508d 100644 --- a/Kernel/KernelKit/HError.hpp +++ b/Kernel/KernelKit/HError.hpp @@ -8,6 +8,10 @@ #include <NewKit/Defines.hpp> +#define DbgOk() (kLastError == NewOS::kErrorSuccess) +#define DbgFailed() (kLastError != NewOS::kErrorSuccess) +#define DbgLastError() kLastError + namespace NewOS { typedef Int32 HError; @@ -37,13 +41,11 @@ namespace NewOS inline constexpr HError kErrorDiskIsCorrupted = 54; inline constexpr HError kErrorDisk = 55; inline constexpr HError kErrorInvalidData = 56; + inline constexpr HError kErrorAsync = 57; + inline constexpr HError kErrorNonBlocking = 58; inline constexpr HError kErrorUnimplemented = 0; Boolean ke_bug_check(void) noexcept; } // namespace NewOS -#define DbgOk() (kLastError == NewOS::kErrorSuccess) -#define DbgFailed() (kLastError != NewOS::kErrorSuccess) -#define DbgLastError() kLastError - inline NewOS::HError kLastError = 0; diff --git a/Kernel/KernelKit/PEFCodeManager.hxx b/Kernel/KernelKit/PEFCodeManager.hxx index 32ebfe8e..1faecb5e 100644 --- a/Kernel/KernelKit/PEFCodeManager.hxx +++ b/Kernel/KernelKit/PEFCodeManager.hxx @@ -47,10 +47,10 @@ namespace NewOS private: OwnPtr<FileStream<Char>> fFile; - Ref<StringView> fPath; - VoidPtr fCachedBlob; - bool fFatBinary; - bool fBad; + Ref<StringView> fPath; + VoidPtr fCachedBlob; + bool fFatBinary; + bool fBad; }; namespace Utils diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx index 633cdca3..98008d69 100644 --- a/Kernel/KernelKit/ProcessScheduler.hxx +++ b/Kernel/KernelKit/ProcessScheduler.hxx @@ -121,8 +121,8 @@ namespace NewOS }; // Helper types. - using ImagePtr = VoidPtr; - using HeapPtrKind = VoidPtr; + using ImagePtr = VoidPtr; + using HeapPtrKind = VoidPtr; // @name ProcessHeader // @brief Process Header (PH) @@ -152,9 +152,9 @@ namespace NewOS ProcessStatus Status; // Memory, images. - HeapPtrKind HeapCursor{nullptr}; - ImagePtr Image{nullptr}; - HeapPtrKind HeapPtr{nullptr}; + HeapPtrKind HeapCursor{nullptr}; + ImagePtr Image{nullptr}; + HeapPtrKind HeapPtr{nullptr}; // memory usage SizeT UsedMemory{0}; @@ -266,9 +266,9 @@ namespace NewOS class ProcessHelper final { public: - static bool Switch(HAL::StackFrame* newStack, const PID& newPid); - static bool CanBeScheduled(Ref<ProcessHeader>& process); - static PID& TheCurrentPID(); + static bool Switch(HAL::StackFrame* newStack, const PID& newPid); + static bool CanBeScheduled(Ref<ProcessHeader>& process); + static PID& TheCurrentPID(); static SizeT StartScheduling(); }; |
