From fcbb298077b1f974a576c9422ba5defcb9a4792a Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 23 Apr 2023 07:02:24 +0300 Subject: [PATCH] Fix compiler warnings --- Core/Crash/CrashHandler.cpp | 8 + Core/Driver/DriverBinding/BindInterrupt.cpp | 1 + Core/Driver/DriverBinding/BindPCI.cpp | 2 + Core/Driver/DriverBinding/Input/Audio.cpp | 2 + Core/Driver/DriverBinding/Input/Display.cpp | 2 + .../Driver/DriverBinding/Input/Filesystem.cpp | 2 + Core/Driver/DriverBinding/Input/Generic.cpp | 2 + Core/Driver/DriverBinding/Input/Network.cpp | 2 + Core/Driver/DriverBinding/Input/Storage.cpp | 2 + Core/Driver/DriverBinding/PCI/Display.cpp | 1 + Core/Driver/DriverBinding/PCI/Filesystem.cpp | 1 + Core/Driver/DriverBinding/PCI/Generic.cpp | 1 + Core/Driver/DriverBinding/PCI/Input.cpp | 1 + Core/Driver/DriverBinding/Process/Audio.cpp | 2 + Core/Driver/DriverBinding/Process/Display.cpp | 2 + .../DriverBinding/Process/Filesystem.cpp | 2 + Core/Driver/DriverBinding/Process/Generic.cpp | 2 + Core/Driver/DriverBinding/Process/Input.cpp | 2 + Core/Driver/DriverBinding/Process/Network.cpp | 2 + Core/Driver/DriverBinding/Process/Storage.cpp | 2 + .../Memory/HeapAllocators/Xalloc/XallocV1.cpp | 1 + Core/UndefinedBehaviorSanitization.c | 40 ++++ Core/Video/Display.cpp | 2 + Execute/Elf/BaseLoad.cpp | 6 +- Execute/Elf/Dyn.cpp | 3 + Execute/Elf/Parse.cpp | 1 + Execute/Elf/Rel.cpp | 1 + Execute/Elf/SharedObjects.cpp | 5 + Execute/Parse.cpp | 2 + GUI/GUITools.cpp | 11 +- GUI/WidgetEvents.cpp | 2 + GUI/WindowEvents.cpp | 4 + Kernel.cpp | 6 +- Network/AddressResolutionProtocol.cpp | 1 + Network/DynamicHostConfigurationProtocol.cpp | 2 + Network/InternetControlMessageProtocol.cpp | 14 +- Network/NetworkController.cpp | 18 +- Network/NetworkTimeProtocol.cpp | 2 + Network/UserDatagramProtocol.cpp | 2 + Recovery/RecoveryMain.cpp | 5 + SystemCalls/Native.cpp | 10 + Tasking/Scheduler.cpp | 5 +- Tasking/Task.cpp | 2 + include/intrin.hpp | 174 +----------------- include/net/eth.hpp | 9 +- include/net/ipv4.hpp | 4 + include/net/nc.hpp | 38 +++- include/net/net.hpp | 8 +- include/net/udp.hpp | 3 + include/task.hpp | 2 +- 50 files changed, 232 insertions(+), 192 deletions(-) diff --git a/Core/Crash/CrashHandler.cpp b/Core/Crash/CrashHandler.cpp index e065591..6eabd5b 100644 --- a/Core/Crash/CrashHandler.cpp +++ b/Core/Crash/CrashHandler.cpp @@ -827,11 +827,15 @@ namespace CrashHandler if (Frame->cs != GDT_USER_CODE && Frame->cs != GDT_USER_DATA) { if (PageFaultAddress) + { debug("Exception in kernel mode (ip: %#lx cr2: %#lx (%s))", Frame->rip, PageFaultAddress, KernelSymbolTable ? KernelSymbolTable->GetSymbolFromAddress(Frame->rip) : "No symbol"); + } else + { debug("Exception in kernel mode (ip: %#lx (%s))", Frame->rip, KernelSymbolTable ? KernelSymbolTable->GetSymbolFromAddress(Frame->rip) : "No symbol"); + } CPUData *data = GetCurrentCPU(); if (data) @@ -854,11 +858,15 @@ namespace CrashHandler else { if (PageFaultAddress) + { debug("Exception in user mode (ip: %#lx cr2: %#lx (%s))", Frame->rip, PageFaultAddress, KernelSymbolTable ? KernelSymbolTable->GetSymbolFromAddress(Frame->rip) : "No symbol"); + } else + { debug("Exception in user mode (ip: %#lx (%s))", Frame->rip, KernelSymbolTable ? KernelSymbolTable->GetSymbolFromAddress(Frame->rip) : "No symbol"); + } CPUData *data = GetCurrentCPU(); if (!data) { diff --git a/Core/Driver/DriverBinding/BindInterrupt.cpp b/Core/Driver/DriverBinding/BindInterrupt.cpp index 0af2ab5..7bab388 100644 --- a/Core/Driver/DriverBinding/BindInterrupt.cpp +++ b/Core/Driver/DriverBinding/BindInterrupt.cpp @@ -33,6 +33,7 @@ namespace Driver { DriverCode Driver::DriverLoadBindInterrupt(void *DrvExtHdr, uintptr_t DriverAddress, size_t Size, bool IsElf) { + UNUSED(DrvExtHdr); UNUSED(IsElf); Memory::MemMgr *mem = new Memory::MemMgr(nullptr, TaskManager->GetCurrentProcess()->memDirectory); Fex *fex = (Fex *)mem->RequestPages(TO_PAGES(Size + 1)); diff --git a/Core/Driver/DriverBinding/BindPCI.cpp b/Core/Driver/DriverBinding/BindPCI.cpp index 28990ac..c432885 100644 --- a/Core/Driver/DriverBinding/BindPCI.cpp +++ b/Core/Driver/DriverBinding/BindPCI.cpp @@ -48,11 +48,13 @@ namespace Driver BAR[4] = ((PCI::PCIHeader0 *)PCIDevice)->BAR4; BAR[5] = ((PCI::PCIHeader0 *)PCIDevice)->BAR5; +#ifdef DEBUG uintptr_t BAR_Type = BAR[0] & 1; uintptr_t BAR_IOBase = BAR[1] & (~3); uintptr_t BAR_MemoryBase = BAR[0] & (~15); debug("Type: %d; IOBase: %#lx; MemoryBase: %#lx", BAR_Type, BAR_IOBase, BAR_MemoryBase); +#endif /* BARs Size */ for (short i = 0; i < 6; i++) diff --git a/Core/Driver/DriverBinding/Input/Audio.cpp b/Core/Driver/DriverBinding/Input/Audio.cpp index 6429ef7..659680a 100644 --- a/Core/Driver/DriverBinding/Input/Audio.cpp +++ b/Core/Driver/DriverBinding/Input/Audio.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputAudio(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Input/Display.cpp b/Core/Driver/DriverBinding/Input/Display.cpp index 4871144..7b4d697 100644 --- a/Core/Driver/DriverBinding/Input/Display.cpp +++ b/Core/Driver/DriverBinding/Input/Display.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputDisplay(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Input/Filesystem.cpp b/Core/Driver/DriverBinding/Input/Filesystem.cpp index e3f4a57..140f038 100644 --- a/Core/Driver/DriverBinding/Input/Filesystem.cpp +++ b/Core/Driver/DriverBinding/Input/Filesystem.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputFileSystem(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Input/Generic.cpp b/Core/Driver/DriverBinding/Input/Generic.cpp index 2143210..5a17fea 100644 --- a/Core/Driver/DriverBinding/Input/Generic.cpp +++ b/Core/Driver/DriverBinding/Input/Generic.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputGeneric(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Input/Network.cpp b/Core/Driver/DriverBinding/Input/Network.cpp index 8fdb103..4ddbe24 100644 --- a/Core/Driver/DriverBinding/Input/Network.cpp +++ b/Core/Driver/DriverBinding/Input/Network.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputNetwork(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Input/Storage.cpp b/Core/Driver/DriverBinding/Input/Storage.cpp index 30a6082..d051fd1 100644 --- a/Core/Driver/DriverBinding/Input/Storage.cpp +++ b/Core/Driver/DriverBinding/Input/Storage.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindInputStorage(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/PCI/Display.cpp b/Core/Driver/DriverBinding/PCI/Display.cpp index 5218d5b..46fa64c 100644 --- a/Core/Driver/DriverBinding/PCI/Display.cpp +++ b/Core/Driver/DriverBinding/PCI/Display.cpp @@ -33,6 +33,7 @@ namespace Driver { DriverCode Driver::BindPCIDisplay(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice) { + UNUSED(PCIDevice); FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS); if (fexExtended->Driver.OverrideOnConflict) diff --git a/Core/Driver/DriverBinding/PCI/Filesystem.cpp b/Core/Driver/DriverBinding/PCI/Filesystem.cpp index 170115e..decd475 100644 --- a/Core/Driver/DriverBinding/PCI/Filesystem.cpp +++ b/Core/Driver/DriverBinding/PCI/Filesystem.cpp @@ -33,6 +33,7 @@ namespace Driver { DriverCode Driver::BindPCIFileSystem(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice) { + UNUSED(PCIDevice); FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS); if (fexExtended->Driver.OverrideOnConflict) diff --git a/Core/Driver/DriverBinding/PCI/Generic.cpp b/Core/Driver/DriverBinding/PCI/Generic.cpp index 136a695..4dba156 100644 --- a/Core/Driver/DriverBinding/PCI/Generic.cpp +++ b/Core/Driver/DriverBinding/PCI/Generic.cpp @@ -33,6 +33,7 @@ namespace Driver { DriverCode Driver::BindPCIGeneric(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice) { + UNUSED(PCIDevice); FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS); if (fexExtended->Driver.OverrideOnConflict) diff --git a/Core/Driver/DriverBinding/PCI/Input.cpp b/Core/Driver/DriverBinding/PCI/Input.cpp index 4cfbd3d..01e4b95 100644 --- a/Core/Driver/DriverBinding/PCI/Input.cpp +++ b/Core/Driver/DriverBinding/PCI/Input.cpp @@ -33,6 +33,7 @@ namespace Driver { DriverCode Driver::BindPCIInput(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice) { + UNUSED(PCIDevice); FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS); if (fexExtended->Driver.OverrideOnConflict) diff --git a/Core/Driver/DriverBinding/Process/Audio.cpp b/Core/Driver/DriverBinding/Process/Audio.cpp index a3f2cea..c821bb0 100644 --- a/Core/Driver/DriverBinding/Process/Audio.cpp +++ b/Core/Driver/DriverBinding/Process/Audio.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessAudio(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Display.cpp b/Core/Driver/DriverBinding/Process/Display.cpp index e1cab10..12d221f 100644 --- a/Core/Driver/DriverBinding/Process/Display.cpp +++ b/Core/Driver/DriverBinding/Process/Display.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessDisplay(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Filesystem.cpp b/Core/Driver/DriverBinding/Process/Filesystem.cpp index 9b22682..079182d 100644 --- a/Core/Driver/DriverBinding/Process/Filesystem.cpp +++ b/Core/Driver/DriverBinding/Process/Filesystem.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessFileSystem(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Generic.cpp b/Core/Driver/DriverBinding/Process/Generic.cpp index 475f645..22a46c3 100644 --- a/Core/Driver/DriverBinding/Process/Generic.cpp +++ b/Core/Driver/DriverBinding/Process/Generic.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessGeneric(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Input.cpp b/Core/Driver/DriverBinding/Process/Input.cpp index bba2e5a..c7285f8 100644 --- a/Core/Driver/DriverBinding/Process/Input.cpp +++ b/Core/Driver/DriverBinding/Process/Input.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessInput(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Network.cpp b/Core/Driver/DriverBinding/Process/Network.cpp index ba2aa97..a67d224 100644 --- a/Core/Driver/DriverBinding/Process/Network.cpp +++ b/Core/Driver/DriverBinding/Process/Network.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessNetwork(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Driver/DriverBinding/Process/Storage.cpp b/Core/Driver/DriverBinding/Process/Storage.cpp index 65d5d4b..139c258 100644 --- a/Core/Driver/DriverBinding/Process/Storage.cpp +++ b/Core/Driver/DriverBinding/Process/Storage.cpp @@ -33,6 +33,8 @@ namespace Driver { DriverCode Driver::BindProcessStorage(Memory::MemMgr *mem, void *fex) { + UNUSED(mem); + UNUSED(fex); return DriverCode::NOT_IMPLEMENTED; } } diff --git a/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp b/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp index 4666b34..12f3837 100644 --- a/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp +++ b/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp @@ -89,6 +89,7 @@ namespace Xalloc { void *ptr = Xalloc_REQUEST_PAGES(XStoP(sizeof(Block))); return ptr; + (void)(Size); } /** diff --git a/Core/UndefinedBehaviorSanitization.c b/Core/UndefinedBehaviorSanitization.c index b5529f2..8d19125 100644 --- a/Core/UndefinedBehaviorSanitization.c +++ b/Core/UndefinedBehaviorSanitization.c @@ -445,115 +445,153 @@ void __ubsan_handle_type_mismatch_v1(struct type_mismatch_v1_data *type_mismatch if (pointer == 0) { if (UBSANMsg(location->file, location->line, location->column)) + { ubsan("Null pointer access."); + } } else if (type_mismatch->alignment != 0 && is_aligned(pointer, type_mismatch->alignment)) { if (UBSANMsg(location->file, location->line, location->column)) + { ubsan("Unaligned memory access %#llx.", pointer); + } } else { if (UBSANMsg(location->file, location->line, location->column)) + { ubsan("%s address %#llx with insufficient space for object of type %s", Type_Check_Kinds[type_mismatch->type_check_kind], (void *)pointer, type_mismatch->type->name); + } } } void __ubsan_handle_add_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Addition overflow."); + } } void __ubsan_handle_sub_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Subtraction overflow."); + } } void __ubsan_handle_mul_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Multiplication overflow."); + } } void __ubsan_handle_divrem_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Division overflow."); + } } void __ubsan_handle_negate_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Negation overflow."); + } } void __ubsan_handle_pointer_overflow(struct overflow_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Pointer overflow."); + } } void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Shift out of bounds."); + } } void __ubsan_handle_load_invalid_value(struct invalid_value_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Invalid load value."); + } } void __ubsan_handle_out_of_bounds(struct array_out_of_bounds_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Array out of bounds."); + } } void __ubsan_handle_vla_bound_not_positive(struct negative_vla_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Variable-length argument is negative."); + } } void __ubsan_handle_nonnull_return(struct nonnull_return_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Non-null return is null."); + } } void __ubsan_handle_nonnull_return_v1(struct nonnull_return_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Non-null return is null."); + } } void __ubsan_handle_nonnull_arg(struct nonnull_arg_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Non-null argument is null."); + } } void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Unreachable code reached."); + } } void __ubsan_handle_invalid_builtin(struct invalid_builtin_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Invalid builtin."); + } } void __ubsan_handle_missing_return(struct unreachable_data *data) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Missing return."); + } } void __ubsan_vptr_type_cache(uintptr_t *cache, uintptr_t ptr) @@ -565,6 +603,8 @@ void __ubsan_vptr_type_cache(uintptr_t *cache, uintptr_t ptr) void __ubsan_handle_dynamic_type_cache_miss(struct dynamic_type_cache_miss_data *data, uintptr_t ptr) { if (UBSANMsg(data->location.file, data->location.line, data->location.column)) + { ubsan("Dynamic type cache miss."); + } UNUSED(ptr); } \ No newline at end of file diff --git a/Core/Video/Display.cpp b/Core/Video/Display.cpp index 7ac1e05..c346292 100644 --- a/Core/Video/Display.cpp +++ b/Core/Video/Display.cpp @@ -418,9 +418,11 @@ namespace Video if (LoadDefaultFont) { this->CurrentFont = new Font(&_binary_Files_tamsyn_font_1_11_Tamsyn7x14r_psf_start, &_binary_Files_tamsyn_font_1_11_Tamsyn7x14r_psf_end, FontType::PCScreenFont2); +#ifdef DEBUG FontInfo Info = this->CurrentFont->GetInfo(); debug("Font loaded: %dx%d %s", Info.Width, Info.Height, Info.Type == FontType::PCScreenFont1 ? "PSF1" : "PSF2"); +#endif } this->CreateBuffer(Info.Width, Info.Height, 0); } diff --git a/Execute/Elf/BaseLoad.cpp b/Execute/Elf/BaseLoad.cpp index 8e7e7bb..ccdf640 100644 --- a/Execute/Elf/BaseLoad.cpp +++ b/Execute/Elf/BaseLoad.cpp @@ -59,10 +59,15 @@ namespace Execute debug("Searching for IPC with token %s", UniqueToken); Handle = Process->IPC->SearchByToken(UniqueToken); if (Handle == nullptr) + { debug("Failed"); + } + TaskManager->Sleep(200); if (Handle == nullptr) + { debug("Retrying..."); + } } debug("IPC found, sending data..."); InterpreterIPCData *TmpBuffer = new InterpreterIPCData; @@ -95,7 +100,6 @@ namespace Execute } #endif - int NotFoundRetry = 0; RetryIPCWrite: InterProcessCommunication::IPCErrorCode ret = Process->IPC->Write(Handle->ID, TmpBuffer, sizeof(InterpreterIPCData)); debug("Write returned %d", ret); diff --git a/Execute/Elf/Dyn.cpp b/Execute/Elf/Dyn.cpp index c5739d5..a7c35a1 100644 --- a/Execute/Elf/Dyn.cpp +++ b/Execute/Elf/Dyn.cpp @@ -35,6 +35,9 @@ namespace Execute VirtualFileSystem::File &ExFile, Tasking::PCB *Process) { + UNUSED(BaseImage); + UNUSED(ExFile); + UNUSED(Process); fixme("Not implemented"); return {}; } diff --git a/Execute/Elf/Parse.cpp b/Execute/Elf/Parse.cpp index d9ffa49..8973299 100644 --- a/Execute/Elf/Parse.cpp +++ b/Execute/Elf/Parse.cpp @@ -166,6 +166,7 @@ namespace Execute void *MemoryImage = nullptr; Elf64_Ehdr *ELFHeader = (Elf64_Ehdr *)ElfFile; bool IsPIC = ELFHeader->e_type == ET_DYN; + UNUSED(IsPIC); debug("Elf %s PIC", IsPIC ? "is" : "is not"); /* TODO: Not sure what I am supposed to do with this. diff --git a/Execute/Elf/Rel.cpp b/Execute/Elf/Rel.cpp index e14ce2f..c341f7a 100644 --- a/Execute/Elf/Rel.cpp +++ b/Execute/Elf/Rel.cpp @@ -30,6 +30,7 @@ namespace Execute VirtualFileSystem::File &ExFile, Tasking::PCB *Process) { + UNUSED(ExFile); debug("Relocatable"); /* TODO: I have to fully implement this, but for now I will leave it as it is now. */ warn("Relocatable ELF is not fully supported yet"); diff --git a/Execute/Elf/SharedObjects.cpp b/Execute/Elf/SharedObjects.cpp index 3545f06..f6c096b 100644 --- a/Execute/Elf/SharedObjects.cpp +++ b/Execute/Elf/SharedObjects.cpp @@ -62,7 +62,9 @@ namespace Execute fixme("Removed library %s because of timeout", Lib.Identifier); } else + { debug("Timeout for %s is %ld", Lib.Identifier, Lib.Timeout); + } } debug("Waiting 10 seconds..."); } @@ -214,7 +216,9 @@ namespace Execute } } else + { debug("GOT section not found"); + } } } @@ -230,6 +234,7 @@ namespace Execute void SearchLibrary(char *Identifier) { + UNUSED(Identifier); SmartLock(ExecuteServiceLock); } diff --git a/Execute/Parse.cpp b/Execute/Parse.cpp index c37f7c7..00a126d 100644 --- a/Execute/Parse.cpp +++ b/Execute/Parse.cpp @@ -44,7 +44,9 @@ namespace Execute return BinaryType::BinTypeFex; } else if (FexHdr->Type == FexFormatType::FexFormatType_Driver) + { debug("Fex Driver is not supposed to be executed."); + } } /* Check ELF magic. */ else if (ELFHeader->e_ident[EI_MAG0] == ELFMAG0 && diff --git a/GUI/GUITools.cpp b/GUI/GUITools.cpp index b81c149..d62d632 100644 --- a/GUI/GUITools.cpp +++ b/GUI/GUITools.cpp @@ -145,12 +145,17 @@ namespace GraphicalUserInterface void PutBorderWithShadow(ScreenBitmap *Bitmap, Rect rect, uint32_t Color) { + UNUSED(Bitmap); + UNUSED(rect); + UNUSED(Color); } #define SHADOW_SIZE 12 void DrawShadow(ScreenBitmap *Bitmap, Rect rect) { + UNUSED(Bitmap); + UNUSED(rect); } #pragma GCC diagnostic push @@ -161,7 +166,7 @@ namespace GraphicalUserInterface { case Video::FontType::PCScreenFont1: { - uint32_t *PixelPtr = (uint32_t *)Bitmap->Data; + // uint32_t *PixelPtr = (uint32_t *)Bitmap->Data; char *FontPtr = (char *)font->GetInfo().PSF1Font->GlyphBuffer + (c * font->GetInfo().PSF1Font->Header->charsize); for (int64_t Y = *CharCursorY; Y < *CharCursorY + 16; Y++) { @@ -205,5 +210,9 @@ namespace GraphicalUserInterface void DrawString(ScreenBitmap *Bitmap, Rect rect, const char *Text, uint32_t Color) { + UNUSED(Bitmap); + UNUSED(rect); + UNUSED(Text); + UNUSED(Color); } } diff --git a/GUI/WidgetEvents.cpp b/GUI/WidgetEvents.cpp index bb849f6..27a7961 100644 --- a/GUI/WidgetEvents.cpp +++ b/GUI/WidgetEvents.cpp @@ -30,10 +30,12 @@ namespace GraphicalUserInterface { void WidgetCollection::OnPaintBackground(Event *e) { + UNUSED(e); } void WidgetCollection::OnPaintForeground(Event *e) { + UNUSED(e); foreach (auto Panel in this->Panels) { PutRect(this->Buffer, Panel->rect, Panel->Color); diff --git a/GUI/WindowEvents.cpp b/GUI/WindowEvents.cpp index 08507d0..764b24d 100644 --- a/GUI/WindowEvents.cpp +++ b/GUI/WindowEvents.cpp @@ -48,21 +48,25 @@ namespace GraphicalUserInterface void Window::OnMinimize(Event *e) { + UNUSED(e); fixme("Window::OnMinimize() not implemented"); } void Window::OnMaximize(Event *e) { + UNUSED(e); fixme("Window::OnMaximize() not implemented"); } void Window::OnClose(Event *e) { + UNUSED(e); fixme("Window::OnClose() not implemented"); } void Window::OnPaintBackground(Event *e) { + UNUSED(e); Rect PaintPosition = this->Position; PaintPosition.Left = 0; PaintPosition.Top = 0; diff --git a/Kernel.cpp b/Kernel.cpp index db2a7b7..83f97a6 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -157,10 +157,10 @@ LockClass mExtTrkLock; * https://en.wikipedia.org/wiki/Control_register * https://web.archive.org/web/20160312223150/http://ncsi.com/nsatc11/presentations/wednesday/emerging_technologies/fischer.pdf * https://en.wikipedia.org/wiki/Supervisor_Mode_Access_Prevention - * + * * - Atomic operations: * https://en.cppreference.com/w/cpp/atomic/atomic - * + * */ #ifdef a64 @@ -185,7 +185,6 @@ NewLock(KernelLock); #include -using namespace SSE2; using VirtualFileSystem::File; using VirtualFileSystem::FileStatus; using VirtualFileSystem::Node; @@ -501,6 +500,7 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info) EXTERNC __no_stack_protector void BeforeShutdown(bool Reboot) { + UNUSED(Reboot); /* TODO: Announce shutdown */ trace("\n\n\n#################### SYSTEM SHUTTING DOWN ####################\n\n"); diff --git a/Network/AddressResolutionProtocol.cpp b/Network/AddressResolutionProtocol.cpp index 6c64a35..539b74e 100644 --- a/Network/AddressResolutionProtocol.cpp +++ b/Network/AddressResolutionProtocol.cpp @@ -190,6 +190,7 @@ namespace NetworkARP bool ARP::OnEthernetPacketReceived(uint8_t *Data, uint64_t Length) { + UNUSED(Length); netdbg("Received packet"); ARPHeader *Header = (ARPHeader *)Data; diff --git a/Network/DynamicHostConfigurationProtocol.cpp b/Network/DynamicHostConfigurationProtocol.cpp index 72df083..334efc4 100644 --- a/Network/DynamicHostConfigurationProtocol.cpp +++ b/Network/DynamicHostConfigurationProtocol.cpp @@ -155,6 +155,8 @@ namespace NetworkDHCP void DHCP::OnUDPPacketReceived(NetworkUDP::Socket *Socket, uint8_t *Data, uint64_t Length) { + UNUSED(Socket); + UNUSED(Length); DHCPHeader *Packet = (DHCPHeader *)Data; uint8_t *MessageType = (uint8_t *)GetOption(Packet, DHCP_OPTION_MESSAGE_TYPE); diff --git a/Network/InternetControlMessageProtocol.cpp b/Network/InternetControlMessageProtocol.cpp index bb945b3..6ed70c5 100644 --- a/Network/InternetControlMessageProtocol.cpp +++ b/Network/InternetControlMessageProtocol.cpp @@ -62,6 +62,16 @@ namespace NetworkICMPv6 ICMPv6::ICMPv6(NetworkInterfaceManager::DeviceInterface *Interface) { this->Interface = Interface; } ICMPv6::~ICMPv6() {} - void ICMPv6::Send(uint8_t *Data, uint64_t Length) { fixme("Unimplemented"); } - void ICMPv6::Receive(uint8_t *Data) { fixme("Unimplemented"); } + void ICMPv6::Send(uint8_t *Data, uint64_t Length) + { + UNUSED(Data); + UNUSED(Length); + fixme("Unimplemented"); + } + + void ICMPv6::Receive(uint8_t *Data) + { + UNUSED(Data); + fixme("Unimplemented"); + } } diff --git a/Network/NetworkController.cpp b/Network/NetworkController.cpp index d23b947..1b5dcb7 100644 --- a/Network/NetworkController.cpp +++ b/Network/NetworkController.cpp @@ -144,8 +144,8 @@ namespace NetworkInterfaceManager - 0.ro.pool.ntp.org ( {86, 127, 71, 168} ) - time-a-g.nist.gov ( {129, 6, 15, 28} ) */ - InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}}, - .v6 = {.Address = {}}}; + // InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}}, + // .v6 = {.Address = {}}}; // NetworkUDP::Socket *NTP_Socket = udp->Connect(ip, 123); // NetworkNTP::NTP *ntp = new NetworkNTP::NTP(NTP_Socket); // udp->Bind(NTP_Socket, ntp); @@ -170,12 +170,20 @@ namespace NetworkInterfaceManager ReadFSFunction(NetRead) { + UNUSED(node); + UNUSED(Offset); + UNUSED(Size); + UNUSED(Buffer); fixme("Not implemented."); return Size; } WriteFSFunction(NetWrite) { + UNUSED(node); + UNUSED(Offset); + UNUSED(Size); + UNUSED(Buffer); fixme("Not implemented."); return Size; } @@ -224,7 +232,11 @@ namespace NetworkInterfaceManager re->OnInterfaceReceived(Interface, Data, Length); } - Events::Events(DeviceInterface *Interface) { RegisteredEvents.push_back(this); } + Events::Events(DeviceInterface *Interface) + { + UNUSED(Interface); + RegisteredEvents.push_back(this); + } Events::~Events() { diff --git a/Network/NetworkTimeProtocol.cpp b/Network/NetworkTimeProtocol.cpp index 6e249ae..36ad699 100644 --- a/Network/NetworkTimeProtocol.cpp +++ b/Network/NetworkTimeProtocol.cpp @@ -24,6 +24,8 @@ namespace NetworkNTP { void NTP::OnUDPPacketReceived(NetworkUDP::Socket *Socket, uint8_t *Data, uint64_t Length) { + UNUSED(Socket); + UNUSED(Length); this->NTPPacket = *(NTPHeader *)Data; this->TimeReceived = true; netdbg("Received UDP packet for NTP."); diff --git a/Network/UserDatagramProtocol.cpp b/Network/UserDatagramProtocol.cpp index 08b4082..8288423 100644 --- a/Network/UserDatagramProtocol.cpp +++ b/Network/UserDatagramProtocol.cpp @@ -65,12 +65,14 @@ namespace NetworkUDP Socket *UDP::Listen(uint16_t Port) { + UNUSED(Port); fixme("Not implemented."); return nullptr; } void UDP::Disconnect(Socket *Socket) { + UNUSED(Socket); fixme("Not implemented."); } diff --git a/Recovery/RecoveryMain.cpp b/Recovery/RecoveryMain.cpp index 75e88e3..4cb5e0c 100644 --- a/Recovery/RecoveryMain.cpp +++ b/Recovery/RecoveryMain.cpp @@ -87,6 +87,7 @@ namespace Recovery callback.AudioCallback.Send.Length = pcm.node->Length; debug("Playing audio..."); int status = DriverManager->IOCB(AudioDrv.DriverUID, &callback); + UNUSED(status); debug("Audio played! %d", status); KernelAllocator.FreePages((void *)PCMRaw, TO_PAGES(pcm.node->Length + 1)); vfs->Close(pcm); @@ -119,6 +120,7 @@ namespace Recovery callback.AudioCallback.Adjust._SampleRate = true; callback.AudioCallback.Adjust.SampleRate = SR; int status = DriverManager->IOCB(AudioDrv.DriverUID, &callback); + UNUSED(status); debug("Sample rate changed! %d", status); } @@ -156,6 +158,7 @@ namespace Recovery callback.AudioCallback.Adjust._Volume = true; callback.AudioCallback.Adjust.Volume = percentage; int status = DriverManager->IOCB(AudioDrv.DriverUID, &callback); + UNUSED(status); debug("Volume changed! %d", status); } @@ -200,11 +203,13 @@ namespace Recovery wdgDbgWin->CreateLabel({5, 40, 0, 0}, "Memory Usage"); GraphicalUserInterface::Handle MemLblHnd = wdgDbgWin->CreateLabel({5, 55, 0, 0}, "0MB / 0GB (0MB reserved) 0% (0000000000000000 bytes allocated)"); +#ifdef DEBUG wdgDbgWin->CreateLabel({5, 95, 0, 0}, "GUI Info"); wdgDbgWin->CreateLabel({5, 110, 0, 0}, " Fetch Inputs / Paint Desktop / Paint Widgets"); GraphicalUserInterface::Handle GUI1LblHnd = wdgDbgWin->CreateLabel({5, 125, 0, 0}, "0000000000000000 / 0000000000000000 / 0000000000000000"); wdgDbgWin->CreateLabel({5, 140, 0, 0}, " Paint Windows / Paint Cursor / Memset & Update"); GraphicalUserInterface::Handle GUI2LblHnd = wdgDbgWin->CreateLabel({5, 155, 0, 0}, "0000000000000000 / 0000000000000000 / 0000000000000000"); +#endif wdgDbgWin->CreateLabel({5, 195, 0, 0}, "Audio"); wdgDbgWin->CreateButton({5, 210, 85, 15}, "Play Audio", (uintptr_t)PlayAudioWrapper); diff --git a/SystemCalls/Native.cpp b/SystemCalls/Native.cpp index e2cafd1..b302651 100644 --- a/SystemCalls/Native.cpp +++ b/SystemCalls/Native.cpp @@ -186,7 +186,9 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t Execute::SharedLibraries lib = Execute::GetLibrary(Identifier); if (!lib.Address) + { debug("Failed to get library address %#lx", (uintptr_t)lib.Address); + } debug("Returning library address %#lx (%s)", (uintptr_t)lib.Address, Identifier); return (uintptr_t)lib.Address; @@ -200,7 +202,9 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t Execute::SharedLibraries lib = Execute::GetLibrary(Identifier); if (!lib.MemoryImage) + { debug("Failed to get library memory image %#lx", (uintptr_t)lib.MemoryImage); + } debug("Returning memory image %#lx (%s)", (uintptr_t)lib.MemoryImage, Identifier); return (uintptr_t)lib.MemoryImage; @@ -252,6 +256,8 @@ static uint64_t sys_file_open(SyscallsFrame *Frame, const char *Path, uint64_t F *KernelPrivate = KPObj; debug("Opened file %s (%d)", KPObj.Name, KPObj.Status); return (uint64_t)KernelPrivate; + UNUSED(Frame); + UNUSED(Flags); } static int sys_file_close(SyscallsFrame *Frame, void *KernelPrivate) @@ -266,18 +272,21 @@ static int sys_file_close(SyscallsFrame *Frame, void *KernelPrivate) return SYSCALL_OK; } return SYSCALL_INVALID_ARGUMENT; + UNUSED(Frame); } static uint64_t sys_file_read(SyscallsFrame *Frame, void *KernelPrivate, uint64_t Offset, uint8_t *Buffer, uint64_t Size) { debug("(KernelPrivate: %#lx, Offset: %#lx, Buffer: %#lx, Size: %#lx)", KernelPrivate, Offset, Buffer, Size); return vfs->Read(*(VirtualFileSystem::File *)KernelPrivate, Offset, Buffer, Size); + UNUSED(Frame); } static uint64_t sys_file_write(SyscallsFrame *Frame, void *KernelPrivate, uint64_t Offset, uint8_t *Buffer, uint64_t Size) { debug("(KernelPrivate: %#lx, Offset: %#lx, Buffer: %#lx, Size: %#lx)", KernelPrivate, Offset, Buffer, Size); return vfs->Write(*(VirtualFileSystem::File *)KernelPrivate, Offset, Buffer, Size); + UNUSED(Frame); } static int sys_file_seek(SyscallsFrame *Frame) @@ -294,6 +303,7 @@ static int sys_file_status(SyscallsFrame *Frame) static int sys_sleep(SyscallsFrame *Frame, uint64_t Milliseconds) { + UNUSED(Frame); if (!CheckTrust(TrustedByKernel | Trusted | Untrusted)) return SYSCALL_ACCESS_DENIED; TaskManager->Sleep(Milliseconds); diff --git a/Tasking/Scheduler.cpp b/Tasking/Scheduler.cpp index f1d8b57..3059f2d 100644 --- a/Tasking/Scheduler.cpp +++ b/Tasking/Scheduler.cpp @@ -360,9 +360,8 @@ namespace Tasking } } - SafeFunction NIF void Task::WakeUpThreads(void *CPUDataPointer) + SafeFunction NIF void Task::WakeUpThreads() { - CPUData *CurrentCPU = (CPUData *)CPUDataPointer; foreach (auto process in ProcessList) { if (InvalidPCB(process)) @@ -532,7 +531,7 @@ namespace Tasking this->UpdateProcessStatus(); schedbg("Passed UpdateProcessStatus"); - this->WakeUpThreads(CurrentCPU); + this->WakeUpThreads(); schedbg("Passed WakeUpThreads"); if (this->GetNextAvailableThread(CurrentCPU)) diff --git a/Tasking/Task.cpp b/Tasking/Task.cpp index 783ba8a..35d5284 100644 --- a/Tasking/Task.cpp +++ b/Tasking/Task.cpp @@ -767,7 +767,9 @@ namespace Tasking Process->ELFSymbolTable = new SymbolResolver::Symbols((uintptr_t)Image); } else + { debug("No image provided for process \"%s\"(%d)", Process->Name, Process->ID); + } if (Parent) Parent->Children.push_back(Process); diff --git a/include/intrin.hpp b/include/intrin.hpp index 953a73d..fc47ea7 100644 --- a/include/intrin.hpp +++ b/include/intrin.hpp @@ -15,36 +15,12 @@ along with Fennix Kernel. If not, see . */ -#ifndef __FENNIX_KERNEL_SIMD_H__ -#define __FENNIX_KERNEL_SIMD_H__ +#ifndef __FENNIX_KERNEL_INTRIN_H__ +#define __FENNIX_KERNEL_INTRIN_H__ #include #include -#if defined(a86) -#define MMX_FN_ATTR __always_inline __target("mmx") -#define SSE_FN_ATTR __always_inline __target("sse") -#define SSE2_FN_ATTR __always_inline __target("sse2") -#define SSE3_FN_ATTR __always_inline __target("sse3") -#define SSSE3_FN_ATTR __always_inline __target("ssse3") -#define SSE4_1_FN_ATTR __always_inline __target("sse4.1") -#define SSE4_2_FN_ATTR __always_inline __target("sse4.2") -#define AVX_FN_ATTR __always_inline __target("avx") -#define AVX2_FN_ATTR __always_inline __target("avx2") -#elif defined(aa64) -#define MMX_FN_ATTR __always_inline -#define SSE_FN_ATTR __always_inline -#define SSE2_FN_ATTR __always_inline -#define SSE3_FN_ATTR __always_inline -#define SSSE3_FN_ATTR __always_inline -#define SSE4_1_FN_ATTR __always_inline -#define SSE4_2_FN_ATTR __always_inline -#define AVX_FN_ATTR __always_inline -#define AVX2_FN_ATTR __always_inline -#endif - -#define ST_IN static inline - namespace FXSR { void _fxsave(void *mem_addr) @@ -101,148 +77,4 @@ namespace SMAP } } -namespace MMX -{ -#if defined(a86) - typedef long long __m64 __attribute__((__vector_size__(8), __aligned__(8))); - - typedef long long __v1di __attribute__((__vector_size__(8))); - typedef int __v2si __attribute__((__vector_size__(8))); - typedef short __v4hi __attribute__((__vector_size__(8))); - typedef char __v8qi __attribute__((__vector_size__(8))); - - ST_IN MMX_FN_ATTR void _mm_empty(void) - { - __builtin_ia32_emms(); - } -#endif // a64 || a32 -} - -namespace SSE -{ -#if defined(a86) - typedef int __v4si __attribute__((__vector_size__(16))); - typedef unsigned int __v4su __attribute__((__vector_size__(16))); - typedef float __v4sf __attribute__((__vector_size__(16))); - - typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16))); - typedef float __m128_u __attribute__((__vector_size__(16), __aligned__(1))); - - ST_IN SSE_FN_ATTR __m128 _mm_add_ss(__m128 a, __m128 b) - { - // return __builtin_ia32_addss(a, b); - a[0] += b[0]; - return a; - } - - ST_IN SSE_FN_ATTR __m128 _mm_add_ps(__m128 a, __m128 b) - { - return (__m128)((__v4sf)a + (__v4sf)b); - } -#endif // a64 || a32 -} - -namespace SSE2 -{ -#if defined(a86) - typedef double __v2df __attribute__((__vector_size__(16))); - - typedef long long __v2di __attribute__((__vector_size__(16))); - typedef short __v8hi __attribute__((__vector_size__(16))); - typedef char __v16qi __attribute__((__vector_size__(16))); - typedef signed char __v16qs __attribute__((__vector_size__(16))); - - typedef unsigned long long __v2du __attribute__((__vector_size__(16))); - typedef unsigned short __v8hu __attribute__((__vector_size__(16))); - typedef unsigned char __v16qu __attribute__((__vector_size__(16))); - - typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16))); - typedef double __m128d_u __attribute__((__vector_size__(16), __aligned__(1))); - typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16))); - typedef long long __m128i_u __attribute__((__vector_size__(16), __aligned__(1))); - - ST_IN SSE2_FN_ATTR __m128i _mm_mul_epu32(__m128i a, __m128i b) - { - __m128i result; - __asm__("pmuludq %1, %2 \n\t" - "movdqu %2, %0 \n\t" - : "=x"(result) - : "x"(a), "x"(b)); - return result; - } - - ST_IN SSE2_FN_ATTR __m128i _mm_set_epi32(int e3, int e2, int e1, int e0) - { - __m128i result; - __asm__("movd %[e0], %[result]\n\t" - "pinsrd $1, %[e1], %[result]\n\t" - "pinsrd $2, %[e2], %[result]\n\t" - "pinsrd $3, %[e3], %[result]\n\t" - : [result] "=x"(result) - : [e0] "r"(e0), [e1] "r"(e1), [e2] "r"(e2), [e3] "r"(e3)); - return result; - } - - ST_IN SSE2_FN_ATTR __m128i _mm_set1_epi32(int a) - { - __m128i result; - __asm__("movd %1, %%xmm0\n\t" - "pshufd $0, %%xmm0, %0\n\t" - : "=x"(result) - : "r"(a) - : "%xmm0"); - return result; - } - - ST_IN SSE2_FN_ATTR void _mm_storeu_si128(__m128i *mem_addr, __m128i a) - { - asm volatile("movdqu %1, %0" - : "=m"(*mem_addr) - : "x"(a)); - } -#endif // a64 || a32 -} - -namespace SSE3 -{ -#if defined(a86) -#endif // a64 || a32 -} - -namespace SSSE3 -{ -#if defined(a86) -#endif // a64 || a32 -} - -namespace SSE4_1 -{ -#if defined(a86) - typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16))); - - ST_IN SSE4_1_FN_ATTR __m128i _mm_cvtepu8_epi32(__m128i a); - ST_IN SSE4_1_FN_ATTR __m128i _mm_mullo_epi32(__m128i a, __m128i b); - ST_IN SSE4_1_FN_ATTR __m128i _mm_srli_epi32(__m128i a, int imm8); - ST_IN SSE4_1_FN_ATTR int _mm_cvtsi128_si32(__m128i a); -#endif // a64 || a32 -} - -namespace SSE4_2 -{ -#if defined(a86) -#endif // a64 || a32 -} - -namespace AVX -{ -#if defined(a86) -#endif // a64 || a32 -} - -namespace AVX2 -{ -#if defined(a86) -#endif // a64 || a32 -} - -#endif // !__FENNIX_KERNEL_SIMD_H__ +#endif // !__FENNIX_KERNEL_INTRIN_H__ diff --git a/include/net/eth.hpp b/include/net/eth.hpp index 4719695..73083d1 100644 --- a/include/net/eth.hpp +++ b/include/net/eth.hpp @@ -55,9 +55,16 @@ namespace NetworkEthernet public: FrameType GetFrameType() { return FType; } - virtual void OnEthernetPacketSent(EthernetPacket *Packet) { netdbg("Event not handled. [%p]", Packet); } + virtual void OnEthernetPacketSent(EthernetPacket *Packet) + { + UNUSED(Packet); + netdbg("Event not handled. [%p]", Packet); + } + virtual bool OnEthernetPacketReceived(uint8_t *Data, uint64_t Length) { + UNUSED(Data); + UNUSED(Length); netdbg("Event not handled. [%p, %d]", Data, Length); return false; } diff --git a/include/net/ipv4.hpp b/include/net/ipv4.hpp index 3bdacb0..71f55c2 100644 --- a/include/net/ipv4.hpp +++ b/include/net/ipv4.hpp @@ -124,6 +124,10 @@ namespace NetworkIPv4 virtual bool OnIPv4PacketReceived(InternetProtocol SourceIP, InternetProtocol DestinationIP, uint8_t *Data, uint64_t Length) { + UNUSED(SourceIP); + UNUSED(DestinationIP); + UNUSED(Data); + UNUSED(Length); warn("Not implemented."); return false; } diff --git a/include/net/nc.hpp b/include/net/nc.hpp index aa3d51c..21e0d35 100644 --- a/include/net/nc.hpp +++ b/include/net/nc.hpp @@ -52,11 +52,39 @@ namespace NetworkInterfaceManager ~Events(); public: - virtual void OnInterfaceAdded(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); } - virtual void OnInterfaceRemoved(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); } - virtual void OnInterfaceChanged(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); } - virtual void OnInterfaceReceived(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) { netdbg("Event for %s not handled.", Interface->Name); } - virtual void OnInterfaceSent(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) { netdbg("Event for %s not handled.", Interface->Name); } + virtual void OnInterfaceAdded(DeviceInterface *Interface) + { + UNUSED(Interface); + netdbg("Event for %s not handled.", Interface->Name); + } + + virtual void OnInterfaceRemoved(DeviceInterface *Interface) + { + UNUSED(Interface); + netdbg("Event for %s not handled.", Interface->Name); + } + + virtual void OnInterfaceChanged(DeviceInterface *Interface) + { + UNUSED(Interface); + netdbg("Event for %s not handled.", Interface->Name); + } + + virtual void OnInterfaceReceived(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) + { + UNUSED(Interface); + UNUSED(Data); + UNUSED(Length); + netdbg("Event for %s not handled.", Interface->Name); + } + + virtual void OnInterfaceSent(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) + { + UNUSED(Interface); + UNUSED(Data); + UNUSED(Length); + netdbg("Event for %s not handled.", Interface->Name); + } }; class NetworkInterface diff --git a/include/net/net.hpp b/include/net/net.hpp index 4dc5906..d3dcb72 100644 --- a/include/net/net.hpp +++ b/include/net/net.hpp @@ -30,7 +30,13 @@ void DbgDumpData(const char *Description, void *Address, unsigned long Length); #else #define netdbg(m, ...) static inline void DbgNetwork() { return; } -static inline void DbgDumpData(const char *Description, void *Address, unsigned long Length) { return; } +static inline void DbgDumpData(const char *Description, void *Address, unsigned long Length) +{ + UNUSED(Description); + UNUSED(Address); + UNUSED(Length); + return; +} #endif enum Endianness diff --git a/include/net/udp.hpp b/include/net/udp.hpp index 7e95243..ab3d6a3 100644 --- a/include/net/udp.hpp +++ b/include/net/udp.hpp @@ -50,6 +50,9 @@ namespace NetworkUDP public: virtual void OnUDPPacketReceived(Socket *Socket, uint8_t *Data, uint64_t Length) { + UNUSED(Socket); + UNUSED(Data); + UNUSED(Length); warn("Not implemented."); } }; diff --git a/include/task.hpp b/include/task.hpp index 39a6500..0c9573d 100644 --- a/include/task.hpp +++ b/include/task.hpp @@ -261,7 +261,7 @@ namespace Tasking bool GetNextAvailableProcess(void *CPUDataPointer); bool SchedulerSearchProcessThread(void *CPUDataPointer); void UpdateProcessStatus(); - void WakeUpThreads(void *CPUDataPointer); + void WakeUpThreads(); #if defined(a64) void Schedule(CPU::x64::TrapFrame *Frame);