From db1d0e53cc21678ace07b72652ed7b3b1054da30 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 17 Aug 2025 18:12:58 +0200 Subject: feat: libSystem/SystemProc.asm: Move r8, to rax, cleanup rax before entering calling system call handler too. Signed-off-by: Amlal --- dev/libSystem/src/SystemProc.asm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'dev/libSystem') diff --git a/dev/libSystem/src/SystemProc.asm b/dev/libSystem/src/SystemProc.asm index 299b59f9..8adcea0b 100644 --- a/dev/libSystem/src/SystemProc.asm +++ b/dev/libSystem/src/SystemProc.asm @@ -1,7 +1,7 @@ ;; /* ;; * ======================================================== ;; * -;; * libSystem/src/SystemCalls+IO.asm +;; * libSystem/src/SystemProc.asm ;; * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. ;; * ;; * ======================================================== @@ -22,6 +22,8 @@ libsys_syscall_arg_1: mov r8, rcx + xor rax, rax + int 50 pop rbp @@ -34,7 +36,9 @@ libsys_syscall_arg_2: mov r8, rcx mov r9, rdx - + + xor rax, rax + int 50 pop rbp @@ -49,6 +53,8 @@ libsys_syscall_arg_3: mov r9, rdx mov r10, rbx + xor rax, rax + int 50 pop rbp @@ -59,11 +65,15 @@ libsys_syscall_arg_4: push rbp mov rbp, rsp + mov rax, r8 + mov r8, rcx mov r9, rdx mov r10, rbx mov r11, rax + xor rax, rax + int 50 pop rbp -- cgit v1.2.3 From 918690e78ae54e4f763bb5756d7b9a5d5b04108a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 18 Aug 2025 15:47:44 +0200 Subject: feat: SystemProc.asm: Make use of `syscall` instead of `int 50` --- dev/libSystem/src/SystemProc.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dev/libSystem') diff --git a/dev/libSystem/src/SystemProc.asm b/dev/libSystem/src/SystemProc.asm index 8adcea0b..991a371f 100644 --- a/dev/libSystem/src/SystemProc.asm +++ b/dev/libSystem/src/SystemProc.asm @@ -24,7 +24,7 @@ libsys_syscall_arg_1: xor rax, rax - int 50 + syscall pop rbp @@ -39,7 +39,7 @@ libsys_syscall_arg_2: xor rax, rax - int 50 + syscall pop rbp @@ -55,7 +55,7 @@ libsys_syscall_arg_3: xor rax, rax - int 50 + syscall pop rbp @@ -74,7 +74,7 @@ libsys_syscall_arg_4: xor rax, rax - int 50 + syscall pop rbp -- cgit v1.2.3 From 27fd1ba438eecbe184a5deda6d9f468509ec4f42 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 21 Aug 2025 09:23:13 +0200 Subject: feat: refactor and fixed python scripts. Signed-off-by: Amlal El Mahrouss --- dev/boot/BootKit/BootKit.h | 16 +-- dev/boot/modules/BootNet/BootNet.cc | 4 +- dev/boot/src/HEL/AMD64/BootATA.cc | 13 +- dev/boot/src/HEL/ARM64/BootPlatform.cc | 3 +- dev/boot/src/New+Delete.cc | 3 +- dev/kernel/FSKit/HeFS.h | 6 +- dev/kernel/FirmwareKit/EFI/EFI.h | 134 ++++++++------------- dev/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc | 3 +- dev/kernel/HALKit/AMD64/HalKernelMain.cc | 3 +- dev/kernel/HALKit/AMD64/Paging.h | 4 +- dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 9 +- dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc | 10 +- dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc | 13 +- dev/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc | 3 +- dev/kernel/HALKit/ARM64/HalKernelMain.cc | 3 +- dev/kernel/HALKit/ARM64/Paging.h | 4 +- dev/kernel/HALKit/POWER/HalApplicationProcessor.cc | 3 +- dev/kernel/HALKit/RISCV/HalApplicationProcessor.cc | 3 +- dev/kernel/KernelKit/CoreProcessScheduler.h | 5 +- dev/kernel/KernelKit/HardwareThreadScheduler.h | 2 +- dev/kernel/KernelKit/KernelTaskScheduler.h | 2 +- dev/kernel/KernelKit/LoaderInterface.h | 6 +- dev/kernel/KernelKit/PCI/DMA.h | 2 +- dev/kernel/KernelKit/UserProcessScheduler.h | 4 +- dev/kernel/NeKit/Macros.h | 2 +- dev/kernel/NeKit/OwnPtr.h | 2 +- dev/kernel/src/AsciiUtils.cc | 3 +- dev/kernel/src/FS/NeFS+FileSystemParser.cc | 6 +- dev/kernel/src/IndexableProperty.cc | 16 +-- dev/kernel/src/UserProcessScheduler.cc | 2 +- dev/libSystem/SystemKit/Macros.h | 2 +- dev/modules/Power/PowerFactory.h | 2 +- docs/tex/core_process_scheduler.tex | 4 +- .../CoreFoundation.fwrk/headers/String.h | 2 +- .../KernelTest.fwrk/headers/KernelTest.h | 20 ++- public/tools/diutil/vendor/Dialogs.h | 41 ++++--- tools/fsck.hefs.cc | 6 +- tools/mk_app.py | 0 tools/mk_fwrk.py | 0 tools/mk_htman.py | 0 40 files changed, 171 insertions(+), 195 deletions(-) mode change 100644 => 100755 tools/mk_app.py mode change 100644 => 100755 tools/mk_fwrk.py mode change 100644 => 100755 tools/mk_htman.py (limited to 'dev/libSystem') diff --git a/dev/boot/BootKit/BootKit.h b/dev/boot/BootKit/BootKit.h index 12a5861f..68e4b484 100644 --- a/dev/boot/BootKit/BootKit.h +++ b/dev/boot/BootKit/BootKit.h @@ -293,16 +293,16 @@ inline Boolean BDiskFormatFactory::Format(const Char* part_name) { CopyMem(gpt_part->Signature, reinterpret_cast(const_cast(kMagicGPT)), StrLen(kMagicGPT)); - gpt_part->Revision = 0x00010000; + gpt_part->Revision = 0x00010000; gpt_part->HeaderSize = sizeof(GPT_PARTITION_TABLE); gpt_part->CRC32 = 0x00000000; - gpt_part->Reserved1 = 0x00000000; - gpt_part->LBAHeader = 0x00000000; - gpt_part->LBAAltHeader = 0x00000000; + gpt_part->Reserved1 = 0x00000000; + gpt_part->LBAHeader = 0x00000000; + gpt_part->LBAAltHeader = 0x00000000; gpt_part->FirstGPTEntry = 0x00000000; - gpt_part->LastGPTEntry = 0x00000000; + gpt_part->LastGPTEntry = 0x00000000; gpt_part->Guid.Data1 = 0x00000000; gpt_part->Guid.Data2 = 0x0000; @@ -312,10 +312,10 @@ inline Boolean BDiskFormatFactory::Format(const Char* part_name) { gpt_part->Revision = 0x00010000; - gpt_part->StartingLBA = 0x00000000; + gpt_part->StartingLBA = 0x00000000; gpt_part->NumPartitionEntries = 0x00000000; - gpt_part->SizeOfEntries = 0x00000000; - gpt_part->CRC32PartEntry = 0x00000000; + gpt_part->SizeOfEntries = 0x00000000; + gpt_part->CRC32PartEntry = 0x00000000; SetMem(gpt_part->Reserved2, 0, kSectorAlignGPT_PartTbl); diff --git a/dev/boot/modules/BootNet/BootNet.cc b/dev/boot/modules/BootNet/BootNet.cc index d8ea5799..8236dd0d 100644 --- a/dev/boot/modules/BootNet/BootNet.cc +++ b/dev/boot/modules/BootNet/BootNet.cc @@ -12,8 +12,8 @@ #include #include -STATIC EFI_GUID kEfiSimpleProtoGUID = EFI_SIMPLE_NETWORK_PROTOCOL_GUID; -STATIC EFI_SIMPLE_NETWORK_PROTOCOL* kEfiProtocol = nullptr; +STATIC EFI_GUID kEfiSimpleProtoGUID = EFI_SIMPLE_NETWORK_PROTOCOL_GUID; +STATIC EFI_SIMPLE_NETWORK_PROTOCOL* kEfiProtocol = nullptr; STATIC Void bootnet_read_ip_packet(BOOTNET_INTERNET_HEADER inet, BOOTNET_INTERNET_HEADER** inet_out); diff --git a/dev/boot/src/HEL/AMD64/BootATA.cc b/dev/boot/src/HEL/AMD64/BootATA.cc index e5e0d8c2..25810222 100644 --- a/dev/boot/src/HEL/AMD64/BootATA.cc +++ b/dev/boot/src/HEL/AMD64/BootATA.cc @@ -88,7 +88,8 @@ ATAInit_Retry: /// fetch serial info /// model, speed, number of sectors... - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) { kATAData[indexData] = rt_in16(IO + ATA_REG_DATA); @@ -114,14 +115,15 @@ Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeASCII* Buf, rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { boot_ata_wait_io(IO); @@ -147,14 +149,15 @@ Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeASCII* Buf rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { boot_ata_wait_io(IO); diff --git a/dev/boot/src/HEL/ARM64/BootPlatform.cc b/dev/boot/src/HEL/ARM64/BootPlatform.cc index 683245fb..9dd03afe 100644 --- a/dev/boot/src/HEL/ARM64/BootPlatform.cc +++ b/dev/boot/src/HEL/ARM64/BootPlatform.cc @@ -13,7 +13,8 @@ using namespace Boot; EXTERN_C void rt_halt() { - while (Yes); + while (Yes) + ; } EXTERN_C void rt_cli() {} diff --git a/dev/boot/src/New+Delete.cc b/dev/boot/src/New+Delete.cc index f7ad2898..d4d5dfed 100644 --- a/dev/boot/src/New+Delete.cc +++ b/dev/boot/src/New+Delete.cc @@ -17,7 +17,8 @@ void* operator new(size_t sz) { void* buf = nullptr; - while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk); + while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk) + ; return buf; } diff --git a/dev/kernel/FSKit/HeFS.h b/dev/kernel/FSKit/HeFS.h index bb4e3dc0..845ef467 100644 --- a/dev/kernel/FSKit/HeFS.h +++ b/dev/kernel/FSKit/HeFS.h @@ -259,7 +259,7 @@ inline UInt32 hefs_hour_get(ATime raw_atime) noexcept { /// @return the minute value. /// @note The minute is stored in the lower 8 bits of the ATime value. inline UInt32 hefs_minute_get(ATime raw_atime) noexcept { - return (raw_atime) & 0xFF; + return (raw_atime) &0xFF; } inline constexpr UInt32 kHeFSBaseYear = 1970; @@ -379,10 +379,10 @@ class HeFileSystemParser final { ~HeFileSystemParser() = default; public: - HeFileSystemParser(const HeFileSystemParser&) = delete; + HeFileSystemParser(const HeFileSystemParser&) = delete; HeFileSystemParser& operator=(const HeFileSystemParser&) = delete; - HeFileSystemParser(HeFileSystemParser&&) = delete; + HeFileSystemParser(HeFileSystemParser&&) = delete; HeFileSystemParser& operator=(HeFileSystemParser&&) = delete; public: diff --git a/dev/kernel/FirmwareKit/EFI/EFI.h b/dev/kernel/FirmwareKit/EFI/EFI.h index 9b22f5b6..97e3ad01 100644 --- a/dev/kernel/FirmwareKit/EFI/EFI.h +++ b/dev/kernel/FirmwareKit/EFI/EFI.h @@ -57,7 +57,7 @@ typedef Char16 EfiChar16Type; /// @brief Core Handle Kind /// Self is like NT's Win32 HANDLE type. typedef struct EfiHandle { -}* EfiHandlePtr; +} * EfiHandlePtr; /* UEFI uses wide characters by default. */ typedef WideChar EfiCharType; @@ -239,85 +239,63 @@ typedef struct EfiTableHeader { UInt32 Reserved; } EfiTableHeader; -#define EFI_ACPI_TABLE_PROTOCOL_GUID \ - { \ - 0xffe06bdd, 0x6107, 0x46a6, { \ - 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c \ - } \ +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { \ + 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c } \ } -#define EFI_LOAD_FILE_PROTOCOL_GUID \ - { \ - 0x56EC3091, 0x954C, 0x11d2, { \ - 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_LOAD_FILE_PROTOCOL_GUID \ + { \ + 0x56EC3091, 0x954C, 0x11d2, { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define EFI_LOAD_FILE2_PROTOCOL_GUID \ - { \ - 0x4006c0c1, 0xfcb3, 0x403e, { \ - 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d \ - } \ +#define EFI_LOAD_FILE2_PROTOCOL_GUID \ + { \ + 0x4006c0c1, 0xfcb3, 0x403e, { 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \ } -#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ - { \ - 0x5B1B31A1, 0x9562, 0x11d2, { \ - 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B \ - } \ +#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ + { \ + 0x5B1B31A1, 0x9562, 0x11d2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - { \ - 0x9042a9de, 0x23dc, 0x4a38, { \ - 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a \ - } \ +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { \ + 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \ } -#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \ - { \ - 0xA19832B9, 0xAC25, 0x11D3, { \ - 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \ - } \ +#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \ + { \ + 0xA19832B9, 0xAC25, 0x11D3, { 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000 -#define EFI_IP4_PROTOCOL_GUID \ - { \ - 0x41d94cd2, 0x35b6, 0x455a, { \ - 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd \ - } \ +#define EFI_IP4_PROTOCOL_GUID \ + { \ + 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \ } #define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - { \ - 0x0964e5b22, 0x6459, 0x11d2, { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0xbc62157e, 0x3e33, 0x4fec, { \ - 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf \ - } \ +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \ } -#define EFI_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0x9576e91, 0x6d3f, 0x11d2, { \ - 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0x9576e91, 0x6d3f, 0x11d2, { 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - { \ - 0x0964e5b22, 0x6459, 0x11d2, { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } typedef UInt64(EfiImageUnload)(EfiHandlePtr ImageHandle); @@ -373,17 +351,17 @@ typedef struct { typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_TRANSMIT)(IN EFI_SIMPLE_NETWORK_PROTOCOL* This, IN UInt32 HeaderSize, IN UInt32 BufferSize, - IN Void* Buffer, - IN EfiMacAddress* SrcAddr OPTIONAL, + IN Void* Buffer, + IN EfiMacAddress* SrcAddr OPTIONAL, IN EfiMacAddress* DestAddr OPTIONAL, - IN UInt16* Protocol OPTIONAL); + IN UInt16* Protocol OPTIONAL); typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_RECEIVE)(IN EFI_SIMPLE_NETWORK_PROTOCOL* This, - OUT UInt32* HeaderSize OPTIONAL, + OUT UInt32* HeaderSize OPTIONAL, IN OUT UInt32* BufferSize, OUT Void* Buffer, - OUT EfiMacAddress* SrcAddr OPTIONAL, + OUT EfiMacAddress* SrcAddr OPTIONAL, OUT EfiMacAddress* DestAddr OPTIONAL, - OUT UInt16* Protocol OPTIONAL); + OUT UInt16* Protocol OPTIONAL); typedef struct EFI_SIMPLE_NETWORK_PROTOCOL { UInt64 Revision; @@ -528,11 +506,9 @@ typedef struct EFI_GUID EFI_FINAL { * Protocol stuff... */ -#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ - { \ - 0x387477c1, 0x69c7, 0x11d2, { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ + { \ + 0x387477c1, 0x69c7, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } /** some helpers */ @@ -631,7 +607,7 @@ typedef struct { } EfiInputKey; typedef EfiStatusType(EFI_API* EfiInputReadKey)(IN EfiSimpleTextInputProtocol* This, - OUT EfiInputKey* Key); + OUT EfiInputKey* Key); typedef EfiStatusType(EFI_API* EfiInputReset)(IN EfiSimpleTextInputProtocol* This, IN Boolean ExtendedChk); @@ -689,7 +665,7 @@ typedef struct EfiSystemTable { struct { EFI_GUID VendorGUID; VoidPtr VendorTable; - }* ConfigurationTable; + } * ConfigurationTable; } EfiSystemTable; #define kEfiOk 0 @@ -750,11 +726,9 @@ enum { #define EFI_EXTRA_DESCRIPTOR_SIZE 8 -#define EFI_MP_SERVICES_PROTOCOL_GUID \ - { \ - 0x3fdda605, 0xa76e, 0x4f46, { \ - 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08 \ - } \ +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + { \ + 0x3fdda605, 0xa76e, 0x4f46, { 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08 } \ } #define PROCESSOR_AS_BSP_BIT 0x00000001 @@ -851,11 +825,9 @@ typedef struct EfiTime { UInt8 Pad2; } EfiTime; -#define EFI_FILE_INFO_GUID \ - { \ - 0x09576e92, 0x6d3f, 0x11d2, { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ +#define EFI_FILE_INFO_GUID \ + { \ + 0x09576e92, 0x6d3f, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } struct EfiFileInfo EFI_FINAL { @@ -924,8 +896,8 @@ typedef EfiStatusType EFI_API (*EfiMpServicesStartupThisAP)( IN Void* ProcedureArgument OPTIONAL, OUT Boolean* Finished OPTIONAL); typedef EfiStatusType EFI_API (*EfiMpServicesDisableThisAP)(IN struct _EfiMpServicesProtocol* Self, - IN UInt32 ProcessorNumber, - IN Boolean EnableAP, + IN UInt32 ProcessorNumber, + IN Boolean EnableAP, IN UInt32* HealthFlag OPTIONAL); typedef EfiStatusType EFI_API (*EfiMpServicesWhoAmI)(IN struct _EfiMpServicesProtocol* Self, diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc index 0c2d0960..b837497e 100644 --- a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc +++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc @@ -61,7 +61,8 @@ EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp) { hal_idt_send_eoi(32); - while (kIsRunning); + while (kIsRunning) + ; kIsRunning = YES; diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc index c7a87b13..3c6e7d36 100644 --- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -168,6 +168,7 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept { idt_loader.Load(idt_reg); - while (YES); + while (YES) + ; } #endif // ifndef __NE_MODULAR_KERNEL_COMPONENTS__ diff --git a/dev/kernel/HALKit/AMD64/Paging.h b/dev/kernel/HALKit/AMD64/Paging.h index cf297632..079acde4 100644 --- a/dev/kernel/HALKit/AMD64/Paging.h +++ b/dev/kernel/HALKit/AMD64/Paging.h @@ -57,9 +57,7 @@ namespace Detail { PageEnable = 31, }; - inline UInt8 control_register_cast(ControlRegisterBits reg) { - return static_cast(reg); - } + inline UInt8 control_register_cast(ControlRegisterBits reg) { return static_cast(reg); } } // namespace Detail auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page, SizeT pad = 0) -> VoidPtr; diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 3363e809..77e3331d 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -294,7 +294,8 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz goto ahci_io_end; } else { kout << "ahci: Disk still busy after command completion!\r"; - while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)); + while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) + ; } ahci_io_end: @@ -307,15 +308,13 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz @brief Gets the number of sectors inside the drive. @return Sector size in bytes. */ -STATIC ATTRIBUTE(unused) -SizeT drv_get_sector_count_ahci() { +STATIC ATTRIBUTE(unused) SizeT drv_get_sector_count_ahci() { return kSATASectorCount; } /// @brief Get the drive size. /// @return Disk size in bytes. -STATIC ATTRIBUTE(unused) -SizeT drv_get_size_ahci() { +STATIC ATTRIBUTE(unused) SizeT drv_get_size_ahci() { return drv_std_get_sector_count() * kAHCISectorSize; } diff --git a/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc index 4688203f..39efb7d3 100644 --- a/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc @@ -105,7 +105,7 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz - 1) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); @@ -123,7 +123,8 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz rt_out8(kATADevice.Bar(0x20) + 0x00, 0x09); // Start DMA engine - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01); + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine @@ -146,7 +147,7 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz - 1)) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); @@ -162,7 +163,8 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS rt_out8(IO + 0x00, 0x09); // Start DMA engine - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01); + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine diff --git a/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc index 9c5b3931..6fccbdfa 100644 --- a/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc @@ -83,7 +83,8 @@ ATAInit_Retry: rt_out8(OutBus + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; /// fetch serial info /// model, speed, number of sectors... @@ -116,14 +117,15 @@ Void drv_pio_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT Sect rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { drv_pio_std_wait_io(IO); @@ -147,14 +149,15 @@ Void drv_pio_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT Sec rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { drv_pio_std_wait_io(IO); diff --git a/dev/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc b/dev/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc index 63a42de8..0c26f4cb 100644 --- a/dev/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc +++ b/dev/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc @@ -56,7 +56,8 @@ EXTERN_C void int_handle_scheduler(Kernel::UIntPtr rsp) { hal_int_send_eoi(32); - while (kIsRunning); + while (kIsRunning) + ; kIsRunning = YES; diff --git a/dev/kernel/HALKit/ARM64/HalKernelMain.cc b/dev/kernel/HALKit/ARM64/HalKernelMain.cc index d8e6843b..20bd3d8a 100644 --- a/dev/kernel/HALKit/ARM64/HalKernelMain.cc +++ b/dev/kernel/HALKit/ARM64/HalKernelMain.cc @@ -71,6 +71,7 @@ EXTERN_C void hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) { Kernel::mp_init_cores(); - while (YES); + while (YES) + ; } #endif \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/Paging.h b/dev/kernel/HALKit/ARM64/Paging.h index be9fb116..7a022141 100644 --- a/dev/kernel/HALKit/ARM64/Paging.h +++ b/dev/kernel/HALKit/ARM64/Paging.h @@ -86,9 +86,7 @@ namespace Detail { PageEnable = 31, }; - inline UInt8 control_register_cast(ControlRegisterBits reg) { - return static_cast(reg); - } + inline UInt8 control_register_cast(ControlRegisterBits reg) { return static_cast(reg); } } // namespace Detail struct PDE_4KB final { diff --git a/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc b/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc index 6059e3be..daa26e53 100644 --- a/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc @@ -10,7 +10,8 @@ namespace Kernel::Detail { STATIC void mp_hang_fn(void) { - while (YES); + while (YES) + ; } } // namespace Kernel::Detail diff --git a/dev/kernel/HALKit/RISCV/HalApplicationProcessor.cc b/dev/kernel/HALKit/RISCV/HalApplicationProcessor.cc index e6fdddfb..31d4a62e 100644 --- a/dev/kernel/HALKit/RISCV/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/RISCV/HalApplicationProcessor.cc @@ -13,7 +13,8 @@ using namespace Kernel; namespace Kernel { namespace Detail { STATIC void mp_hang_fn(void) { - while (YES); + while (YES) + ; } } // namespace Detail diff --git a/dev/kernel/KernelKit/CoreProcessScheduler.h b/dev/kernel/KernelKit/CoreProcessScheduler.h index a7908b7d..ee848ffc 100644 --- a/dev/kernel/KernelKit/CoreProcessScheduler.h +++ b/dev/kernel/KernelKit/CoreProcessScheduler.h @@ -201,14 +201,15 @@ using ImagePtr = VoidPtr; /***********************************************************************************/ /// @brief Helper class to contain a process's image and blob. /***********************************************************************************/ -struct PROCESS_IMAGE final { - explicit PROCESS_IMAGE() = default; +struct ProcessImage final { + explicit ProcessImage() = default; private: friend USER_PROCESS; friend KERNEL_TASK; friend class UserProcessScheduler; + friend class KernelTaskHelper; ImagePtr fCode{}; ImagePtr fBlob{}; diff --git a/dev/kernel/KernelKit/HardwareThreadScheduler.h b/dev/kernel/KernelKit/HardwareThreadScheduler.h index 168a0cc1..76327a93 100644 --- a/dev/kernel/KernelKit/HardwareThreadScheduler.h +++ b/dev/kernel/KernelKit/HardwareThreadScheduler.h @@ -100,7 +100,7 @@ class HardwareThreadScheduler final : public ISchedulable { public: Ref operator[](SizeT idx); bool operator!() noexcept; - operator bool() noexcept; + operator bool() noexcept; Bool IsUser() override { return Yes; } diff --git a/dev/kernel/KernelKit/KernelTaskScheduler.h b/dev/kernel/KernelKit/KernelTaskScheduler.h index c0879769..78aea53c 100644 --- a/dev/kernel/KernelKit/KernelTaskScheduler.h +++ b/dev/kernel/KernelKit/KernelTaskScheduler.h @@ -28,7 +28,7 @@ class KERNEL_TASK final { HAL::StackFramePtr StackFrame{nullptr}; UInt8* StackReserve{nullptr}; SizeT StackSize{kSchedMaxStackSz}; - PROCESS_IMAGE Image{}; + ProcessImage Image{}; /// @brief a KID is a Kernel Identification Descriptor, it is used to find a task running within /// the kernel. KID Kid{0}; diff --git a/dev/kernel/KernelKit/LoaderInterface.h b/dev/kernel/KernelKit/LoaderInterface.h index ed7d8364..1f9b1e56 100644 --- a/dev/kernel/KernelKit/LoaderInterface.h +++ b/dev/kernel/KernelKit/LoaderInterface.h @@ -23,9 +23,9 @@ class LoaderInterface { public: virtual _Output ErrorOr 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 FindStart() = 0; virtual _Output ErrorOr FindSymbol(_Input const Char* name, _Input Int32 kind) = 0; }; diff --git a/dev/kernel/KernelKit/PCI/DMA.h b/dev/kernel/KernelKit/PCI/DMA.h index c4e3b61a..7e7d3f0c 100644 --- a/dev/kernel/KernelKit/PCI/DMA.h +++ b/dev/kernel/KernelKit/PCI/DMA.h @@ -47,7 +47,7 @@ class DMAWrapper final { T* Get(UIntPtr off = 0); public: - operator bool(); + operator bool(); bool operator!(); public: diff --git a/dev/kernel/KernelKit/UserProcessScheduler.h b/dev/kernel/KernelKit/UserProcessScheduler.h index 3dae178a..9fa15f17 100644 --- a/dev/kernel/KernelKit/UserProcessScheduler.h +++ b/dev/kernel/KernelKit/UserProcessScheduler.h @@ -48,7 +48,7 @@ class USER_PROCESS final { AffinityKind Affinity{AffinityKind::kStandard}; ProcessStatusKind Status{ProcessStatusKind::kKilled}; UInt8 StackReserve[kSchedMaxStackSz]; - PROCESS_IMAGE Image{}; + ProcessImage Image{}; SizeT StackSize{kSchedMaxStackSz}; IDylibObject* DylibDelegate{nullptr}; SizeT MemoryCursor{0UL}; @@ -192,7 +192,7 @@ class UserProcessScheduler final : public ISchedulable { NE_MOVE_DELETE(UserProcessScheduler) public: - operator bool(); + operator bool(); bool operator!(); public: diff --git a/dev/kernel/NeKit/Macros.h b/dev/kernel/NeKit/Macros.h index e80e2e47..b46ffaa8 100644 --- a/dev/kernel/NeKit/Macros.h +++ b/dev/kernel/NeKit/Macros.h @@ -16,7 +16,7 @@ #endif #ifndef kib_cast -#define kib_cast(X) (Kernel::UInt64)((X) * 1024) +#define kib_cast(X) (Kernel::UInt64)((X) *1024) #endif #ifndef MIB diff --git a/dev/kernel/NeKit/OwnPtr.h b/dev/kernel/NeKit/OwnPtr.h index f5ff4b54..674f9ff3 100644 --- a/dev/kernel/NeKit/OwnPtr.h +++ b/dev/kernel/NeKit/OwnPtr.h @@ -50,7 +50,7 @@ class OwnPtr final { Ref AsRef() { return Ref(fCls); } - operator bool() { return fCls; } + operator bool() { return fCls; } bool operator!() { return !fCls; } private: diff --git a/dev/kernel/src/AsciiUtils.cc b/dev/kernel/src/AsciiUtils.cc index 66a4aaef..24e4e220 100644 --- a/dev/kernel/src/AsciiUtils.cc +++ b/dev/kernel/src/AsciiUtils.cc @@ -73,7 +73,8 @@ Void rt_zero_memory(voidPtr pointer, Size len) { #ifdef __NE_ENFORCE_DEPRECATED_WARNINGS [[deprecated("Use rt_set_memory_safe instead")]] #endif -voidPtr rt_set_memory(voidPtr src, UInt32 value, Size len) { +voidPtr +rt_set_memory(voidPtr src, UInt32 value, Size len) { if (!src) return nullptr; auto p = reinterpret_cast(src); UInt8 v = static_cast(value & 0xFF); diff --git a/dev/kernel/src/FS/NeFS+FileSystemParser.cc b/dev/kernel/src/FS/NeFS+FileSystemParser.cc index 7b9ebcd6..14e0b974 100644 --- a/dev/kernel/src/FS/NeFS+FileSystemParser.cc +++ b/dev/kernel/src/FS/NeFS+FileSystemParser.cc @@ -154,8 +154,8 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) { /// @return the newly found fork. /***********************************************************************************/ _Output NEFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NEFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - _Input Boolean is_data) { + _Input const Char* name, + _Input Boolean is_data) { if (!catalog || !name) return nullptr; auto& drive = kMountpoint.A(); @@ -217,7 +217,7 @@ _Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char /// @param kind the catalog kind. /// @return catalog pointer. /***********************************************************************************/ -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, _Input const Int32& flags, _Input const Int32& kind) { kout << "CreateCatalog(*...*)\r"; diff --git a/dev/kernel/src/IndexableProperty.cc b/dev/kernel/src/IndexableProperty.cc index 251d6645..c11e328d 100644 --- a/dev/kernel/src/IndexableProperty.cc +++ b/dev/kernel/src/IndexableProperty.cc @@ -18,21 +18,13 @@ namespace Kernel { namespace Indexer { - Index& IndexableProperty::Leak() noexcept { - return fIndex; - } + Index& IndexableProperty::Leak() noexcept { return fIndex; } - Void IndexableProperty::AddFlag(Int16 flag) { - fFlags |= flag; - } + Void IndexableProperty::AddFlag(Int16 flag) { fFlags |= flag; } - Void IndexableProperty::RemoveFlag(Int16 flag) { - fFlags &= flag; - } + Void IndexableProperty::RemoveFlag(Int16 flag) { fFlags &= flag; } - Int16 IndexableProperty::HasFlag(Int16 flag) { - return fFlags & flag; - } + Int16 IndexableProperty::HasFlag(Int16 flag) { return fFlags & flag; } /// @brief Index a file into the indexer instance. /// @param filename filesystem path to access. diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 45957c7b..ccd6dc48 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -122,7 +122,7 @@ ErrorOr USER_PROCESS::New(SizeT sz, SizeT pad_amount) { hal_write_cr3(vm_register); #else - auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); + auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); #endif if (!this->HeapTree) { diff --git a/dev/libSystem/SystemKit/Macros.h b/dev/libSystem/SystemKit/Macros.h index 25bc77ba..2bdeff9d 100644 --- a/dev/libSystem/SystemKit/Macros.h +++ b/dev/libSystem/SystemKit/Macros.h @@ -94,7 +94,7 @@ typedef nullPtr NullPtr; #endif #ifndef kib_cast -#define kib_cast(X) (UInt64)((X) * 1024) +#define kib_cast(X) (UInt64)((X) *1024) #endif #ifndef MIB diff --git a/dev/modules/Power/PowerFactory.h b/dev/modules/Power/PowerFactory.h index ba3a8da6..b7c13280 100644 --- a/dev/modules/Power/PowerFactory.h +++ b/dev/modules/Power/PowerFactory.h @@ -27,6 +27,6 @@ class PowerFactory { public: Bool Shutdown() { return NO; }; // shutdown - Void Reboot() {}; // soft-reboot + Void Reboot(){}; // soft-reboot }; } // namespace Kernel \ No newline at end of file diff --git a/docs/tex/core_process_scheduler.tex b/docs/tex/core_process_scheduler.tex index b99232bb..ab5636f6 100644 --- a/docs/tex/core_process_scheduler.tex +++ b/docs/tex/core_process_scheduler.tex @@ -77,8 +77,8 @@ class UserProcessTeam final { {The following sample is a C++ container used to hold process data and metadata.} {This is part of the NeKernel source tree.} \begin{verbatim} -struct PROCESS_IMAGE final { - explicit PROCESS_IMAGE() = default; +struct ProcessImage final { + explicit ProcessImage() = default; private: friend USER_PROCESS; diff --git a/public/frameworks/CoreFoundation.fwrk/headers/String.h b/public/frameworks/CoreFoundation.fwrk/headers/String.h index 80b68536..82c73ddf 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/String.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/String.h @@ -17,7 +17,7 @@ class CFString final CF_OBJECT { CFString() = default; ~CFString() = default; - CFString(const CFString&) = delete; + CFString(const CFString&) = delete; CFString& operator=(const CFString&) = delete; }; } // namespace CF \ No newline at end of file diff --git a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h index 70b1b9b3..9ddf65fb 100644 --- a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h +++ b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h @@ -18,18 +18,14 @@ #define KT_TEST_SUCCESS (0) -#define KT_DECL_TEST(NAME, FN) \ - class KT_##NAME final { \ - public: \ - Kernel::Void Run(); \ - const Kernel::Char* ToString(); \ - }; \ - inline Kernel::Void KT_##NAME::Run() { \ - MUST_PASS(FN() == true); \ - } \ - inline const Kernel::Char* KT_##NAME::ToString() { \ - return #FN; \ - } +#define KT_DECL_TEST(NAME, FN) \ + class KT_##NAME final { \ + public: \ + Kernel::Void Run(); \ + const Kernel::Char* ToString(); \ + }; \ + inline Kernel::Void KT_##NAME::Run() { MUST_PASS(FN() == true); } \ + inline const Kernel::Char* KT_##NAME::ToString() { return #FN; } KT_DECL_TEST(ALWAYS_BREAK, []() -> bool { return false; }); KT_DECL_TEST(ALWAYS_GOOD, []() -> bool { return true; }); \ No newline at end of file diff --git a/public/tools/diutil/vendor/Dialogs.h b/public/tools/diutil/vendor/Dialogs.h index ce50b811..84e239f5 100644 --- a/public/tools/diutil/vendor/Dialogs.h +++ b/public/tools/diutil/vendor/Dialogs.h @@ -175,7 +175,7 @@ namespace internal { #elif __EMSCRIPTEN__ void start(int exit_code); #else - void start_process(std::vector const& command); + void start_process(std::vector const& command); #endif ~executor(); @@ -490,10 +490,10 @@ inline settings::settings(bool resync) { #if _WIN32 flags(flag::is_vista) = internal::is_vista(); #elif !__APPLE__ - flags(flag::has_zenity) = check_program("zenity"); + flags(flag::has_zenity) = check_program("zenity"); flags(flag::has_matedialog) = check_program("matedialog"); - flags(flag::has_qarma) = check_program("qarma"); - flags(flag::has_kdialog) = check_program("kdialog"); + flags(flag::has_qarma) = check_program("qarma"); + flags(flag::has_kdialog) = check_program("kdialog"); // If multiple helpers are available, try to default to the best one if (flags(flag::has_zenity) && flags(flag::has_kdialog)) { @@ -540,7 +540,7 @@ inline bool settings::check_program(std::string const& program) { (void) program; return false; #else - int exit_code = -1; + int exit_code = -1; internal::executor async; async.start_process({"/bin/sh", "-c", "which " + program}); async.result(&exit_code); @@ -604,7 +604,7 @@ inline std::string path::home() { if (size_max != -1) len = size_t(size_max); #endif std::vector buf(len); - struct passwd pwd, *result; + struct passwd pwd, *result; if (getpwuid_r(getuid(), &pwd, buf.data(), buf.size(), &result) == 0) return result->pw_dir; #endif return "/"; @@ -717,7 +717,7 @@ inline void internal::executor::start_process(std::vector const& co } close(in[1]); - m_fd = out[0]; + m_fd = out[0]; auto flags = fcntl(m_fd, F_GETFL); fcntl(m_fd, F_SETFL, flags | O_NONBLOCK); @@ -753,7 +753,7 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) // FIXME: do something (void) timeout; #else - char buf[BUFSIZ]; + char buf[BUFSIZ]; ssize_t received = read(m_fd, buf, BUFSIZ); // Flawfinder: ignore if (received > 0) { m_stdout += std::string(buf, received); @@ -764,7 +764,7 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) // (this happens when the calling application handles or ignores SIG_CHLD) and results in // waitpid() failing with ECHILD. Otherwise we assume the child is running and we sleep for // a little while. - int status; + int status; pid_t child = waitpid(m_pid, &status, WNOHANG); if (child != m_pid && (child >= 0 || errno != ECHILD)) { // FIXME: this happens almost always at first iteration @@ -782,7 +782,8 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) inline void internal::executor::stop() { // Loop until the user closes the dialog - while (!ready()); + while (!ready()) + ; } // dll implementation @@ -878,11 +879,11 @@ inline std::vector internal::dialog::desktop_helper() const { #if __APPLE__ return {"osascript"}; #else - return {flags(flag::has_zenity) ? "zenity" + return {flags(flag::has_zenity) ? "zenity" : flags(flag::has_matedialog) ? "matedialog" - : flags(flag::has_qarma) ? "qarma" - : flags(flag::has_kdialog) ? "kdialog" - : "echo"}; + : flags(flag::has_qarma) ? "qarma" + : flags(flag::has_kdialog) ? "kdialog" + : "echo"}; #endif } @@ -1124,9 +1125,9 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title // Split the pattern list to check whether "*" is in there; if it // is, we have to disable filters because there is no mechanism in // OS X for the user to override the filter. - std::regex sep("\\s+"); - std::string filter_list; - bool has_filter = true; + std::regex sep("\\s+"); + std::string filter_list; + bool has_filter = true; std::sregex_token_iterator iter(patterns.begin(), patterns.end(), sep, -1); std::sregex_token_iterator end; for (; iter != end; ++iter) { @@ -1235,7 +1236,7 @@ inline std::vector internal::file_dialog::vector_result() { return m_vector_result; #else std::vector ret; - auto result = m_async->result(); + auto result = m_async->result(); for (;;) { // Split result along newline characters auto i = result.find('\n'); @@ -1568,7 +1569,7 @@ inline message::message(std::string const& title, std::string const& text, if_cancel = button::ok; break; } - m_mappings[1] = if_cancel; + m_mappings[1] = if_cancel; m_mappings[256] = if_cancel; // XXX: I think this was never correct script += " with icon "; switch (_icon) { @@ -1655,7 +1656,7 @@ inline message::message(std::string const& title, std::string const& text, if (_choice == choice::yes_no_cancel) flag += "cancel"; command.push_back(flag); if (_choice == choice::yes_no || _choice == choice::yes_no_cancel) { - m_mappings[0] = button::yes; + m_mappings[0] = button::yes; m_mappings[256] = button::no; } } diff --git a/tools/fsck.hefs.cc b/tools/fsck.hefs.cc index 22663032..df89bf07 100644 --- a/tools/fsck.hefs.cc +++ b/tools/fsck.hefs.cc @@ -14,7 +14,8 @@ static uint16_t kNumericalBase = 10; int main(int argc, char** argv) { if (argc < 2) { - mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -in= -org=" << "\n"; + mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -in= -org=" + << "\n"; return EXIT_FAILURE; } @@ -25,7 +26,8 @@ int main(int argc, char** argv) { auto origin = mkfs::get_option(args, "-org"); if (opt_disk.empty()) { - mkfs::console_out() << "fsck: hefs: error: HeFS partition is empty! Exiting..." << "\n"; + mkfs::console_out() << "fsck: hefs: error: HeFS partition is empty! Exiting..." + << "\n"; return EXIT_FAILURE; } diff --git a/tools/mk_app.py b/tools/mk_app.py old mode 100644 new mode 100755 diff --git a/tools/mk_fwrk.py b/tools/mk_fwrk.py old mode 100644 new mode 100755 diff --git a/tools/mk_htman.py b/tools/mk_htman.py old mode 100644 new mode 100755 -- cgit v1.2.3