diff --git a/BaseHdr/Hal/x86_64_gdt.h b/BaseHdr/Hal/x86_64_gdt.h index cfef9506..da1b5030 100644 --- a/BaseHdr/Hal/x86_64_gdt.h +++ b/BaseHdr/Hal/x86_64_gdt.h @@ -31,7 +31,11 @@ #define __X86_64_GDT_H__ #include +#if defined(__GNUC__) || defined(__clang__) +#ifndef __cplusplus #include +#endif +#endif #define GDT_ENTRY_NULL 0 #define GDT_ENTRY_KERNEL_CODE 1 diff --git a/BaseHdr/timer.h b/BaseHdr/timer.h index 32aab266..cd2676e5 100644 --- a/BaseHdr/timer.h +++ b/BaseHdr/timer.h @@ -33,7 +33,11 @@ #define __TIMER_H__ #include +#ifdef ARCH_X64 +#include +#elif ARCH_ARM64 #include +#endif #if defined(__GNUC__) || defined(__clang__) #ifndef __cplusplus #include diff --git a/Boot/xnldr.cpp b/Boot/xnldr.cpp index e41d74c7..9f6dcbd1 100644 --- a/Boot/xnldr.cpp +++ b/Boot/xnldr.cpp @@ -260,7 +260,7 @@ EFI_STATUS efi_main_handler(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTabl *------------------------------------------------------------------- */ void* xdsp_address = NULL; -#ifdef __MSC_VER +#ifdef _MSC_VER static EFI_GUID acpi_guid = EFI_ACPI_20_TABLE_GUID; #else static EFI_GUID acpi_guid = ACPI_20_TABLE_GUID; diff --git a/BootAA64/Makefile b/BootAA64/Makefile index 4b3306a4..3572f281 100644 --- a/BootAA64/Makefile +++ b/BootAA64/Makefile @@ -1,4 +1,5 @@ # Target EFI binary +.DEFAULT_GOAL := all TARGET_EFI = BOOTAA64.efi TARGET_SO = BOOTAA64.so @@ -84,7 +85,7 @@ $(EFI_OUTPUT): $(OBJS) else # Original GCC compilation $(SO_OUTPUT): $(CRT0) $(OBJS) - $(LD) -nostdlib --warn-common --no-undefined --build-id=sha1 -z noexecstack -z max-page-size=4096 \ + $(LD) -nostdlib --warn-common --no-undefined --build-id=sha1 -z muldefs -z noexecstack -z max-page-size=4096 \ -shared -Bsymbolic $(LIBDIRS) -T$(LDSCRIPT) $(CRT0) $(OBJS) -o $@ $(LIBS) $(EFI_OUTPUT): $(SO_OUTPUT) diff --git a/BootAA64/xnldr.h b/BootAA64/xnldr.h index 8b89b863..20359ec2 100644 --- a/BootAA64/xnldr.h +++ b/BootAA64/xnldr.h @@ -34,7 +34,11 @@ #include #include +#if defined(__GNUC__) || defined(__clang__) +#ifndef __cplusplus #include +#endif +#endif #ifndef SIZE_MAX #if defined(ARCH_ARM64) || defined(ARCH_X64) || defined(_M_AMD64) || defined(_M_ARM64) || defined(__x86_64__) || defined(__aarch64__) #define SIZE_MAX 0xFFFFFFFFFFFFFFFFULL diff --git a/Kernel/Hal/serial.cpp b/Kernel/Hal/serial.cpp index a95cdf29..ee65d827 100644 --- a/Kernel/Hal/serial.cpp +++ b/Kernel/Hal/serial.cpp @@ -80,7 +80,7 @@ void DebugSerial(char* string) { */ AU_EXTERN AU_EXPORT void SeTextOut(char* format, ...) { - _va_list_ args; + va_list args; va_start(args, format); while (*format) diff --git a/Kernel/_CRT.cpp b/Kernel/_CRT.cpp index 8d9a9cfd..48017c24 100644 --- a/Kernel/_CRT.cpp +++ b/Kernel/_CRT.cpp @@ -30,7 +30,11 @@ #include +#if defined(__GNUC__) || defined(__clang__) +#ifndef __cplusplus #include +#endif +#endif extern "C" int _fltused = 1; diff --git a/Kernel/process.cpp b/Kernel/process.cpp index 1bfcf9bf..4e0803ec 100644 --- a/Kernel/process.cpp +++ b/Kernel/process.cpp @@ -407,7 +407,7 @@ int AuProcessWaitForTermination(AuProcess *proc, int pid) { else { AuProcess* proc = AuProcessFindByPID(0,pid); if (!proc) - return; + return -1; AuThread* thr = AuGetCurrentThread(); AuBlockThread(thr); list_add(proc->waitlist, thr); diff --git a/KernelAA64/Makefile b/KernelAA64/Makefile index d4392907..5c9898ac 100644 --- a/KernelAA64/Makefile +++ b/KernelAA64/Makefile @@ -1,4 +1,5 @@ # XenevaOS KernelAA64 Makefile +.DEFAULT_GOAL := all TARGET = KernelAA64.elf OBJDIR = obj diff --git a/KernelAA64/init.c b/KernelAA64/init.c index ddd8d644..3b4a89e0 100644 --- a/KernelAA64/init.c +++ b/KernelAA64/init.c @@ -69,7 +69,6 @@ #include #include #include -#include extern int _fltused = 1; static bool _littleboot_used; diff --git a/KernelAA64/process.c b/KernelAA64/process.c index ff4bdf3d..4ab44da2 100644 --- a/KernelAA64/process.c +++ b/KernelAA64/process.c @@ -402,7 +402,7 @@ void AuProcessFreeKeResource(AA64Thread* thr) { * @param proc -- process to exit * @param schedulable -- schedule to next thread */ -void AuProcessExit(AuProcess* proc, BOOL schedulable) { +void AuProcessExit(AuProcess* proc, bool schedulable) { if (proc == root_proc) { UARTDebugOut("[aurora]: cannot exit root process \r\n"); return; @@ -515,7 +515,7 @@ int AuProcessWaitForTermination(AuProcess* proc, int pid) { else { AuProcess* proc = AuProcessFindByPID(0, pid); if (!proc) - return; + return -1; AA64Thread* thr = AuGetCurrentThread(); AuBlockThread(thr); list_add(proc->waitlist, thr); diff --git a/Process/DeodhaiXR/alpha.cpp b/Process/DeodhaiXR/alpha.cpp index a609ede6..7053d9fe 100644 --- a/Process/DeodhaiXR/alpha.cpp +++ b/Process/DeodhaiXR/alpha.cpp @@ -32,8 +32,10 @@ #include "deodxr.h" #include "alpha.h" #if defined(ARCH_ARM64) +#ifdef ARCH_ARM64 #include #endif +#endif #include #include "window.h" #include diff --git a/Process/DeodhaiXR/main.cpp b/Process/DeodhaiXR/main.cpp index 82c83492..03e9d5ea 100644 --- a/Process/DeodhaiXR/main.cpp +++ b/Process/DeodhaiXR/main.cpp @@ -51,7 +51,9 @@ #include "animation.h" #include "alpha.h" #include "nanojpg.h" +#ifdef ARCH_ARM64 #include +#endif #include "compose.h" #include diff --git a/Process/XELnch/rrect.cpp b/Process/XELnch/rrect.cpp index d86d7eab..d8608f30 100644 --- a/Process/XELnch/rrect.cpp +++ b/Process/XELnch/rrect.cpp @@ -1,4 +1,6 @@ -#include +#ifdef ARCH_ARM64 +#include +#endif #include #include