diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-01 19:47:27 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-01 19:47:27 +0100 |
| commit | 50c7c5676d110681528cc933c4b99844b11f1dd1 (patch) | |
| tree | 62ea871cae6949f4332e1973b9da9c5fcbcd4420 /dev | |
| parent | ed70659693e6cc9d48827113b23ebaf85c9dfe70 (diff) | |
ADD: Add GPU API regarding Mesa3D support for OpenGL ES.
IMP: Refactor SCI Kit to have a better filesystem structure.
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/Modules/FB/FB.h | 2 | ||||
| -rw-r--r-- | dev/SCIKit/CompilerHint.h | 2 | ||||
| -rw-r--r-- | dev/SCIKit/GPU.h | 50 | ||||
| -rw-r--r-- | dev/SCIKit/LPC.h | 6 | ||||
| -rw-r--r-- | dev/SCIKit/SCI.h (renamed from dev/SCIKit/Foundation.h) | 37 | ||||
| -rw-r--r-- | dev/SCIKit/sci.json | 2 | ||||
| -rw-r--r-- | dev/SCIKit/src/GPU.cc | 10 | ||||
| -rw-r--r-- | dev/SCIKit/src/LPC.cc | 10 | ||||
| -rw-r--r-- | dev/SCIKit/src/Makefile | 2 | ||||
| -rw-r--r-- | dev/SCIKit/src/SCI.cc (renamed from dev/SCIKit/src/MemoryMgr.cc) | 6 | ||||
| -rw-r--r-- | dev/SCIKit/src/SysCallDispatcher.asm (renamed from dev/SCIKit/src/DispatchSysCalls.asm) | 0 | ||||
| -rw-r--r-- | dev/ZKAKit/FSKit/NeFS.h | 14 | ||||
| -rw-r--r-- | dev/ZKAKit/FirmwareKit/EFI/EFI.h | 18 | ||||
| -rw-r--r-- | dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc | 2 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/DriveMgr.h | 4 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/LPC.h | 6 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/LoaderInterface.h | 6 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/UserProcessScheduler.inl | 2 | ||||
| -rw-r--r-- | dev/ZKAKit/src/FS/NeFS.cc | 38 | ||||
| -rw-r--r-- | dev/ZKAKit/src/Network/IPC.cc | 2 |
20 files changed, 156 insertions, 63 deletions
diff --git a/dev/Modules/FB/FB.h b/dev/Modules/FB/FB.h index ffd6edf9..f309c41c 100644 --- a/dev/Modules/FB/FB.h +++ b/dev/Modules/FB/FB.h @@ -76,7 +76,7 @@ *(((volatile Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) = cg_get_clear_clr(); \ + 4 * u))) = cg_get_clear_clr(); \ } \ } diff --git a/dev/SCIKit/CompilerHint.h b/dev/SCIKit/CompilerHint.h index 60838479..e38d5c7e 100644 --- a/dev/SCIKit/CompilerHint.h +++ b/dev/SCIKit/CompilerHint.h @@ -7,7 +7,9 @@ #ifndef __SCI_HINT_H__ #define __SCI_HINT_H__ +#ifdef __TK__ #pragma compiler(hint_manifest) +#endif #define _Input #define _Output diff --git a/dev/SCIKit/GPU.h b/dev/SCIKit/GPU.h new file mode 100644 index 00000000..0c69a73d --- /dev/null +++ b/dev/SCIKit/GPU.h @@ -0,0 +1,50 @@ +/* ------------------------------------------- + +Copyright (C) 2024, ELMH Group, all rights reserved. + +File: GPU.h +Purpose: GFX System Calls. + +------------------------------------------- */ + +#ifndef SCIKIT_GPU_H +#define SCIKIT_GPU_H + +#include <SCIKit/SCI.h> + +// ------------------------------------------------------------------------------------------ // +// GPU API. +// ------------------------------------------------------------------------------------------ // + +// ------------------------------------------------------------------------------------------ // +// @brief Command buffer structure type. +// ------------------------------------------------------------------------------------------ // +struct GPU_CMD_BUFFER final +{ + SizeT X, Y, Z; + VoidPtr FrameData; + SizeT FrameDataSz; + SizeT BackBufferLayer; + Bool IsGPGPUData; + Bool BackBufferFirst; + + Bool isGPGPUData() + { + return !this->BackBufferFirst && this->IsGPGPUData; + } + + Bool isValid() + { + return this->FrameData && this->FrameDataSz > 0; + } +}; + +typedef VoidPtr GPUObject; + +IMPORT_C GPUObject GPUNewFromDeviceName(_Input const Char* device_name); + +IMPORT_C SInt32 GPUDisposeDevice(GPUObject gpu_handle, Bool cancel_all, Bool flush_all); + +IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPU_CMD_BUFFER** cmd_list, SizeT cmd_list_cnt); + +#endif // ifndef SCIKIT_GPU_H
\ No newline at end of file diff --git a/dev/SCIKit/LPC.h b/dev/SCIKit/LPC.h index 4f2a4e86..60de8cb7 100644 --- a/dev/SCIKit/LPC.h +++ b/dev/SCIKit/LPC.h @@ -11,9 +11,9 @@ /// @file LPC.h /// @brief Local Process Code type and values. -#define ErrLocalIsOk() (kLastError == kErrorSuccess) -#define ErrLocalFailed() (kLastError != kErrorSuccess) -#define ErrLocal() (kLastError) +#define err_local_ok() (kLastError == kErrorSuccess) +#define err_local_fail() (kLastError != kErrorSuccess) +#define err_local_get() (kLastError) typedef SInt32 ErrObject; diff --git a/dev/SCIKit/Foundation.h b/dev/SCIKit/SCI.h index 039fe6ce..a4b0dd96 100644 --- a/dev/SCIKit/Foundation.h +++ b/dev/SCIKit/SCI.h @@ -2,8 +2,8 @@ Copyright (C) 2024, ELMH Group, all rights reserved.
-File: Foundation.h
-Purpose: SCIKit Foundation header.
+File: SCI.h
+Purpose: System Calls.
------------------------------------------- */
@@ -137,75 +137,94 @@ IMPORT_C Void ThrExitMainThread(_Input SInt32 exit_code); IMPORT_C Void ThrExitThread(_Input ThreadObject thread, _Input SInt32 exit_code);
/// @brief Thread procedure function type.
-typedef Void (*ThreadProc)(Void);
+typedef Void (*thread_proc_kind)(Void);
/// @brief Creates a thread.
/// @param procedure the thread procedure.
/// @param argument_count number of arguments inside that thread.
/// @param flags Thread flags.
/// @return the thread object.
-IMPORT_C ThreadObject ThrCreateThread(ThreadProc procedure, SInt32 argument_count, SInt32 flags);
+IMPORT_C ThreadObject ThrCreateThread(thread_proc_kind procedure, SInt32 argument_count, SInt32 flags);
/// @brief Yields the current thread.
/// @param thread the thread to yield.
-IMPORT_C Void ThrYieldThread(Void);
+IMPORT_C Void ThrYieldThread(ThreadObject thrd);
/// @brief Joins a thread.
/// @param thread the thread to join.
-IMPORT_C Void ThrJoinThread(Void);
+IMPORT_C Void ThrJoinThread(ThreadObject thrd);
-/// @brief Detach sa thread.
+/// @brief Detach a thread.
/// @param thread the thread to detach.
-IMPORT_C Void ThrDetachThread(Void);
+IMPORT_C Void ThrDetachThread(ThreadObject thrd);
// ------------------------------------------------------------------------
// Drive Management API.
// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------ //
/// @brief Get the default drive letter.
/// @param void.
/// @return the drive letter.
+// ------------------------------------------------------------------------------------------ //
IMPORT_C Char* DrvGetDefaultDriveLetter(Void);
+// ------------------------------------------------------------------------------------------ //
/// @brief Get the drive letter from a path.
/// @param path the path.
/// @return the drive letter.
+// ------------------------------------------------------------------------------------------ //
IMPORT_C Char* DrvGetDriveLetterFromPath(_Input const Char* path);
+// ------------------------------------------------------------------------------------------ //
/// @brief Get a mounted drive from a letter.
/// @param letter the letter (A..Z).
/// @return the drive object.
+// ------------------------------------------------------------------------------------------ //
IMPORT_C SCIObject DrvGetMountedDrive(_Input const Char letter);
+// ------------------------------------------------------------------------------------------ //
/// @brief Mount a drive.
/// @param path the path to mount.
/// @param letter the letter to mount.
+// ------------------------------------------------------------------------------------------ //
IMPORT_C Void DrvMountDrive(_Input const Char* path, _Input const Char* letter);
+// ------------------------------------------------------------------------------------------ //
/// @brief Unmount a drive.
/// @param letter the letter to unmount.
+// ------------------------------------------------------------------------------------------ //
IMPORT_C Void DrvUnmountDrive(_Input const Char letter);
// ------------------------------------------------------------------------
// Event handling API, use to listen to OS specific events.
// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------ //
/// @brief Add an event listener.
/// @param event_name the event name.
/// @param listener the listener to add.
/// @return the event listener.
+// ------------------------------------------------------------------------------------------ //
+
IMPORT_C Void EvtAddListener(_Input const Char* event_name, _Input SCIObject listener);
+// ------------------------------------------------------------------------------------------ //
/// @brief Remove an event listener.
/// @param event_name the event name.
/// @param listener the listener to remove.
/// @return the event listener.
+// ------------------------------------------------------------------------------------------ //
+
IMPORT_C Void EvtRemoveListener(_Input const Char* event_name, _Input SCIObject listener);
+// ------------------------------------------------------------------------------------------ //
/// @brief Dispatch an event.
/// @param event_name the event name.
/// @param event_data the event data.
/// @return the event data.
+// ------------------------------------------------------------------------------------------ //
+
IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr event_data);
// ------------------------------------------------------------------------------------------ //
@@ -213,7 +232,9 @@ IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr // ------------------------------------------------------------------------------------------ //
IMPORT_C Void PwrShutdownMachine(const Char* _Input msg, _Input SInt32 code);
+
IMPORT_C Void PwrRebootMachine(const Char* _Input msg, _Input SInt32 code);
+
IMPORT_C Void PwrSleepMachine(const Char* _Input msg, _Input SInt32 code);
IMPORT_C SInt32 PwrGetCode(_Output SInt32& code);
diff --git a/dev/SCIKit/sci.json b/dev/SCIKit/sci.json index eb8bece9..b0e267d2 100644 --- a/dev/SCIKit/sci.json +++ b/dev/SCIKit/sci.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["../"], - "sources_path": ["src/*.cc", "src/*.obj"], + "sources_path": ["src/*.cc", "src/*.o"], "output_name": "SCIKit.dylib", "compiler_flags": [ "-fPIC", diff --git a/dev/SCIKit/src/GPU.cc b/dev/SCIKit/src/GPU.cc new file mode 100644 index 00000000..f2947ec9 --- /dev/null +++ b/dev/SCIKit/src/GPU.cc @@ -0,0 +1,10 @@ +/* ------------------------------------------- + +Copyright (C) 2024, ELMH Group, all rights reserved. + +File: GPU.cc +Purpose: GPU Interface. + +------------------------------------------- */ + +#include <SCIKit/LPC.h>
\ No newline at end of file diff --git a/dev/SCIKit/src/LPC.cc b/dev/SCIKit/src/LPC.cc new file mode 100644 index 00000000..b33c15f6 --- /dev/null +++ b/dev/SCIKit/src/LPC.cc @@ -0,0 +1,10 @@ +/* ------------------------------------------- + +Copyright (C) 2024, ELMH Group, all rights reserved. + +File: LPC.cc +Purpose: Local Procedure Codes. + +------------------------------------------- */ + +#include <SCIKit/LPC.h>
\ No newline at end of file diff --git a/dev/SCIKit/src/Makefile b/dev/SCIKit/src/Makefile index 588f233a..ba4b6008 100644 --- a/dev/SCIKit/src/Makefile +++ b/dev/SCIKit/src/Makefile @@ -8,4 +8,4 @@ FLAGS=-f win64 .PHONY: syscall_unit syscall_unit: - $(ASM) $(FLAGS) DispatchSysCalls.asm -o DispatchSysCalls.obj + $(ASM) $(FLAGS) SysCallDispatcher.asm -o SysCallDispatcher.o diff --git a/dev/SCIKit/src/MemoryMgr.cc b/dev/SCIKit/src/SCI.cc index ea9e6ad3..4263b8f0 100644 --- a/dev/SCIKit/src/MemoryMgr.cc +++ b/dev/SCIKit/src/SCI.cc @@ -4,10 +4,10 @@ ------------------------------------------- */
-#include <SCIKit/Foundation.h>
+#include <SCIKit/SCI.h>
-/// @file MemoryMgr.cc
-/// @brief Source file for the memory functions.
+/// @file SCI.cc
+/// @brief Source file for the memory functions of the SCI.
/// @brief Copy memory region.
IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len)
diff --git a/dev/SCIKit/src/DispatchSysCalls.asm b/dev/SCIKit/src/SysCallDispatcher.asm index 368e8a92..368e8a92 100644 --- a/dev/SCIKit/src/DispatchSysCalls.asm +++ b/dev/SCIKit/src/SysCallDispatcher.asm diff --git a/dev/ZKAKit/FSKit/NeFS.h b/dev/ZKAKit/FSKit/NeFS.h index efd42107..e6f984e7 100644 --- a/dev/ZKAKit/FSKit/NeFS.h +++ b/dev/ZKAKit/FSKit/NeFS.h @@ -239,15 +239,15 @@ namespace Kernel /// @param theFork the fork itself. /// @return the fork _Output NFS_FORK_STRUCT* CreateFork(_Input NFS_CATALOG_STRUCT* catalog, - _Input NFS_FORK_STRUCT& theFork); + _Input NFS_FORK_STRUCT& theFork); /// @brief Find fork inside New filesystem. /// @param catalog the catalog. /// @param name the fork name. /// @return the fork. _Output NFS_FORK_STRUCT* FindFork(_Input NFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - Boolean dataOrRsrc); + _Input const Char* name, + Boolean dataOrRsrc); _Output Void RemoveFork(_Input NFS_FORK_STRUCT* fork); @@ -257,7 +257,7 @@ namespace Kernel _Output NFS_CATALOG_STRUCT* GetCatalog(_Input const Char* name); - _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name, + _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name, _Input const Int32& flags, _Input const Int32& kind); @@ -267,12 +267,12 @@ namespace Kernel _Input Bool isRsrcFork, _Input VoidPtr data, _Input SizeT sizeOfData, - _Input const Char* forkName); + _Input const Char* forkName); VoidPtr ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, _Input Bool isRsrcFork, _Input SizeT dataSz, - _Input const Char* forkName); + _Input const Char* forkName); bool Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT off); @@ -284,7 +284,7 @@ namespace Kernel /// @brief Make a EPM+NeFS drive out of the disk. /// @param drive The drive to write on. - /// @return If it was sucessful, see ErrLocal(). + /// @return If it was sucessful, see err_local_get(). bool Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name); public: diff --git a/dev/ZKAKit/FirmwareKit/EFI/EFI.h b/dev/ZKAKit/FirmwareKit/EFI/EFI.h index 523e2156..2905678a 100644 --- a/dev/ZKAKit/FirmwareKit/EFI/EFI.h +++ b/dev/ZKAKit/FirmwareKit/EFI/EFI.h @@ -823,11 +823,11 @@ typedef struct _EfiProcessorInformation typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS)( IN struct _EfiMpServicesProtocol* Self, - OUT UInt32* NumberOfProcessors, - OUT UInt32* NumberOfEnabledProcessors); + OUT UInt32* NumberOfProcessors, + OUT UInt32* NumberOfEnabledProcessors); typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_GET_PROCESSOR_INFO)( - IN struct _EfiMpServicesProtocol* Self, + IN struct _EfiMpServicesProtocol* Self, IN UInt32* ProcessorNumber, OUT struct _EfiProcessorInformation* NumberOfEnabledProcessors); @@ -842,8 +842,8 @@ typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_STARTUP_ALL_APS)( IN Boolean SingleThread, IN VoidPtr WaitEvent OPTIONAL, // EFI_EVENT first, but unused here. IN UInt32 TimeoutInMicroSeconds, - IN Void* ProcedureArgument OPTIONAL, - OUT UInt32** FailedCpuList OPTIONAL); + IN Void* ProcedureArgument OPTIONAL, + OUT UInt32** FailedCpuList OPTIONAL); typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_SWITCH_BSP)( IN struct _EfiMpServicesProtocol* This, @@ -856,18 +856,18 @@ typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_STARTUP_THIS_AP)( IN UInt32 ProcessorNumber, IN VoidPtr WaitEvent OPTIONAL, IN UInt32 TimeoutInMicroseconds, - IN Void* ProcedureArgument OPTIONAL, - OUT Boolean* Finished OPTIONAL); + IN Void* ProcedureArgument OPTIONAL, + OUT Boolean* Finished OPTIONAL); typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_ENABLEDISABLEAP)( IN struct _EfiMpServicesProtocol* This, IN UInt32 ProcessorNumber, IN Boolean EnableAP, - IN UInt32* HealthFlag OPTIONAL); + IN UInt32* HealthFlag OPTIONAL); typedef EfiStatusType EFI_API (*EFI_MP_SERVICES_WHOAMI)( IN struct _EfiMpServicesProtocol* This, - OUT UInt32* ProcessorNumber); + OUT UInt32* ProcessorNumber); typedef struct _EfiMpServicesProtocol { diff --git a/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc b/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc index 179bc593..80abfdc1 100644 --- a/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc +++ b/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc @@ -49,7 +49,7 @@ enum }; STATIC Kernel::PCI::Device kAhciDevice; -STATIC HbaPort* kAhciPort = nullptr; +STATIC HbaPort* kAhciPort = nullptr; STATIC Kernel::Lba kCurrentDiskSectorCount = 0UL; Kernel::Void drv_calculate_disk_geometry() diff --git a/dev/ZKAKit/KernelKit/DriveMgr.h b/dev/ZKAKit/KernelKit/DriveMgr.h index a8a410ba..e4d5dd68 100644 --- a/dev/ZKAKit/KernelKit/DriveMgr.h +++ b/dev/ZKAKit/KernelKit/DriveMgr.h @@ -120,7 +120,7 @@ namespace Kernel DriveTraitPtr GetAddressOf(const Int32& index) { - ErrLocal() = kErrorSuccess; + err_local_get() = kErrorSuccess; switch (index) { @@ -133,7 +133,7 @@ namespace Kernel case kDriveIndexD: return &mD; default: { - ErrLocal() = kErrorNoSuchDisk; + err_local_get() = kErrorNoSuchDisk; kcout << "No such disk index.\n"; break; diff --git a/dev/ZKAKit/KernelKit/LPC.h b/dev/ZKAKit/KernelKit/LPC.h index 68bc9196..0c4b0a56 100644 --- a/dev/ZKAKit/KernelKit/LPC.h +++ b/dev/ZKAKit/KernelKit/LPC.h @@ -11,9 +11,9 @@ /// @file LPC.h /// @brief Local Process Codes. -#define ErrLocalIsOk() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode() == Kernel::kErrorSuccess) -#define ErrLocalFailed() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode() != Kernel::kErrorSuccess) -#define ErrLocal() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode()) +#define err_local_ok() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode() == Kernel::kErrorSuccess) +#define err_local_fail() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode() != Kernel::kErrorSuccess) +#define err_local_get() (Kernel::UserProcessScheduler::The().GetCurrentProcess().Leak().GetLocalCode()) #define ErrGlobalIsOk() (Kernel::kErrorLocalNumber == Kernel::kErrorSuccess) #define ErrGlobalFailed() (Kernel::kErrorLocalNumber != Kernel::kErrorSuccess) diff --git a/dev/ZKAKit/KernelKit/LoaderInterface.h b/dev/ZKAKit/KernelKit/LoaderInterface.h index dc9bc477..a95aae4e 100644 --- a/dev/ZKAKit/KernelKit/LoaderInterface.h +++ b/dev/ZKAKit/KernelKit/LoaderInterface.h @@ -25,9 +25,9 @@ namespace Kernel public: virtual _Output ErrorOr<VoidPtr> GetBlob() = 0; - virtual _Output const Char* AsString() = 0; - virtual _Output const Char* MIME() = 0; - virtual _Output const Char* Path() = 0; + virtual _Output const Char* AsString() = 0; + virtual _Output const Char* MIME() = 0; + virtual _Output const Char* Path() = 0; virtual _Output ErrorOr<VoidPtr> FindStart() = 0; virtual _Output VoidPtr FindSymbol(_Input const Char* name, _Input Int32 kind) = 0; }; diff --git a/dev/ZKAKit/KernelKit/UserProcessScheduler.inl b/dev/ZKAKit/KernelKit/UserProcessScheduler.inl index b99fafbf..8da934ed 100644 --- a/dev/ZKAKit/KernelKit/UserProcessScheduler.inl +++ b/dev/ZKAKit/KernelKit/UserProcessScheduler.inl @@ -4,7 +4,7 @@ namespace Kernel /** @brief Free pointer from usage. */ /***********************************************************************************/ - template <typename T> + template <typename T> Boolean UserProcess::Delete(ErrorOr<T*> ptr, const SizeT& sz) { if (!ptr || diff --git a/dev/ZKAKit/src/FS/NeFS.cc b/dev/ZKAKit/src/FS/NeFS.cc index e1a844c6..a5671763 100644 --- a/dev/ZKAKit/src/FS/NeFS.cc +++ b/dev/ZKAKit/src/FS/NeFS.cc @@ -61,7 +61,7 @@ STATIC MountpointInterface kDiskMountpoint; /// @return the fork /***********************************************************************************/ _Output NFS_FORK_STRUCT* NeFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catalog, - _Input NFS_FORK_STRUCT& the_fork) + _Input NFS_FORK_STRUCT& the_fork) { if (catalog && the_fork.ForkName[0] != 0 && the_fork.DataSize <= kNeFSForkDataSz) @@ -170,8 +170,8 @@ _Output NFS_FORK_STRUCT* NeFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catal /// @return the fork. /***********************************************************************************/ _Output NFS_FORK_STRUCT* NeFSParser::FindFork(_Input NFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - Boolean isDataFork) + _Input const Char* name, + Boolean isDataFork) { auto drv = kDiskMountpoint.A(); NFS_FORK_STRUCT* the_fork = nullptr; @@ -193,12 +193,12 @@ _Output NFS_FORK_STRUCT* NeFSParser::FindFork(_Input NFS_CATALOG_STRUCT* catalog switch (res) { case 1: - ErrLocal() = kErrorDiskReadOnly; + err_local_get() = kErrorDiskReadOnly; break; case 2: - ErrLocal() = kErrorDiskIsFull; + err_local_get() = kErrorDiskIsFull; break; - ErrLocal() = kErrorNoSuchDisk; + err_local_get() = kErrorNoSuchDisk; break; default: @@ -236,7 +236,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name) /// @param kind the catalog kind. /// @return catalog pointer. /***********************************************************************************/ -_Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, +_Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, _Input const Int32& flags, _Input const Int32& kind) { @@ -261,7 +261,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, if (catalog_copy) { kcout << "Catalog already exists: " << name << ".\r"; - ErrLocal() = kErrorFileExists; + err_local_get() = kErrorFileExists; return catalog_copy; } @@ -276,7 +276,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, if (*parentName == 0) { kcout << "Parent name is NUL.\r"; - ErrLocal() = kErrorFileNotFound; + err_local_get() = kErrorFileNotFound; return nullptr; } @@ -464,7 +464,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, /// @brief Make a EPM+NeFS drive out of the disk. /// @param drive The drive to write on. -/// @return If it was sucessful, see ErrLocal(). +/// @return If it was sucessful, see err_local_get(). bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name) { if (*part_name == 0 || @@ -480,7 +480,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb // if disk isn't good, then error out. if (false == drive->fPacket.fPacketGood) { - ErrLocal() = kErrorDiskIsCorrupted; + err_local_get() = kErrorDiskIsCorrupted; return false; } @@ -665,7 +665,7 @@ bool NeFSParser::WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, Bool i // check the fork, if it's position is valid. if (fork_data_input->DataOffset <= kNeFSCatalogStartAddress) { - ErrLocal() = kErrorDiskIsCorrupted; + err_local_get() = kErrorDiskIsCorrupted; kcout << "Invalid fork offset.\r"; @@ -875,7 +875,7 @@ Boolean NeFSParser::RemoveCatalog(_Input const Char* catalogName) if (!catalogName || StringBuilder::Equals(catalogName, NeFileSystemHelper::Root())) { - ErrLocal() = kErrorInternal; + err_local_get() = kErrorInternal; return false; } @@ -936,11 +936,11 @@ Boolean NeFSParser::RemoveCatalog(_Input const Char* catalogName) VoidPtr NeFSParser::ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, _Input Bool is_rsrc_fork, _Input SizeT dataSz, - _Input const Char* forkName) + _Input const Char* forkName) { if (!catalog) { - ErrLocal() = kErrorFileNotFound; + err_local_get() = kErrorFileNotFound; return nullptr; } @@ -1000,11 +1000,11 @@ bool NeFSParser::Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT off) { if (!catalog) { - ErrLocal() = kErrorFileNotFound; + err_local_get() = kErrorFileNotFound; return false; } - ErrLocal() = kErrorUnimplemented; + err_local_get() = kErrorUnimplemented; return false; } @@ -1018,11 +1018,11 @@ SizeT NeFSParser::Tell(_Input _Output NFS_CATALOG_STRUCT* catalog) { if (!catalog) { - ErrLocal() = kErrorFileNotFound; + err_local_get() = kErrorFileNotFound; return 0; } - ErrLocal() = kErrorUnimplemented; + err_local_get() = kErrorUnimplemented; return 0; } diff --git a/dev/ZKAKit/src/Network/IPC.cc b/dev/ZKAKit/src/Network/IPC.cc index 4f979dda..e1f969fd 100644 --- a/dev/ZKAKit/src/Network/IPC.cc +++ b/dev/ZKAKit/src/Network/IPC.cc @@ -49,7 +49,7 @@ Bool ipc_int_sanitize_packet(IPCMessage* pckt) return pckt->IpcPacketSize > 1 && pckt->IpcHeaderMagic == kIPCHeaderMagic; ipc_check_failed: - ErrLocal() = kErrorIPC; + err_local_get() = kErrorIPC; return false; } |
