diff options
| author | Amlal <amlal@nekernel.org> | 2025-05-01 08:50:44 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-05-01 08:50:44 +0200 |
| commit | fb12b9730d78052f5cafbd84fbc9a830a22cec17 (patch) | |
| tree | df67a0724de4c76ce594222747220c233c3bc7f5 | |
| parent | 35ac989886dcab70ff4ba6bc6a1359d1290560ad (diff) | |
dev, LibCompiler: format codebase.0.0.1
Signed-off-by: Amlal <amlal@nekernel.org>
| -rw-r--r-- | dev/LibCompiler/PEF.h | 8 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Assembler32x0.cc | 1 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Assembler64x0.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerAMD64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerARM64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerPowerPC.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompiler64x0.cc | 4 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompilerARM64.cc | 4 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompilerPower64.cc | 4 | ||||
| -rw-r--r-- | dev/LibCompiler/src/DynamicLinkerPEF.cc | 18 |
10 files changed, 23 insertions, 24 deletions
diff --git a/dev/LibCompiler/PEF.h b/dev/LibCompiler/PEF.h index 6e8d288..fe6cfe1 100644 --- a/dev/LibCompiler/PEF.h +++ b/dev/LibCompiler/PEF.h @@ -77,10 +77,10 @@ typedef struct PEFContainer final { UInt32 Kind; UInt32 Abi; UInt32 Cpu; - UInt32 SubCpu; /* Cpu specific information */ - UIntPtr Start; /* Origin of code */ - SizeType HdrSz; /* Size of header */ - SizeType Count; /* container header count */ + UInt32 SubCpu; /* Cpu specific information */ + UIntPtr Start; /* Origin of code */ + SizeType HdrSz; /* Size of header */ + SizeType Count; /* container header count */ UInt32 Checksum; /* Whole binary checksum */ } PACKED PEFContainer, *PEFContainerPtr; diff --git a/dev/LibCompiler/src/Assembler32x0.cc b/dev/LibCompiler/src/Assembler32x0.cc index a5a435c..ac24946 100644 --- a/dev/LibCompiler/src/Assembler32x0.cc +++ b/dev/LibCompiler/src/Assembler32x0.cc @@ -45,6 +45,5 @@ ///////////////////////////////////////////////////////////////////////////////////////// LIBCOMPILER_MODULE(NEAssemblerMain32000) { - return 0; } diff --git a/dev/LibCompiler/src/Assembler64x0.cc b/dev/LibCompiler/src/Assembler64x0.cc index 4707be2..e1fa1b5 100644 --- a/dev/LibCompiler/src/Assembler64x0.cc +++ b/dev/LibCompiler/src/Assembler64x0.cc @@ -68,7 +68,7 @@ static bool asm_read_attributes(std::string line); LIBCOMPILER_MODULE(AssemblerMain64x0) { ::signal(SIGSEGV, Detail::segfault_handler); - + for (size_t i = 1; i < argc; ++i) { if (argv[i][0] == '-') { if (strcmp(argv[i], "--ver") == 0 || strcmp(argv[i], "--v") == 0) { diff --git a/dev/LibCompiler/src/AssemblerAMD64.cc b/dev/LibCompiler/src/AssemblerAMD64.cc index 72e8015..5e9a7cd 100644 --- a/dev/LibCompiler/src/AssemblerAMD64.cc +++ b/dev/LibCompiler/src/AssemblerAMD64.cc @@ -89,7 +89,7 @@ LIBCOMPILER_MODULE(AssemblerMainAMD64) { //////////////// CPU OPCODES BEGIN //////////////// ::signal(SIGSEGV, Detail::segfault_handler); - + std::string opcodes_jump[kJumpLimit] = {"ja", "jae", "jb", "jbe", "jc", "je", "jg", "jge", "jl", "jle", "jna", "jnae", "jnb", "jnbe", "jnc", "jne", "jng", "jnge", "jnl", "jnle", "jno", "jnp", "jns", "jnz", diff --git a/dev/LibCompiler/src/AssemblerARM64.cc b/dev/LibCompiler/src/AssemblerARM64.cc index ab2c89e..8686edb 100644 --- a/dev/LibCompiler/src/AssemblerARM64.cc +++ b/dev/LibCompiler/src/AssemblerARM64.cc @@ -75,7 +75,7 @@ static bool asm_read_attributes(std::string line); LIBCOMPILER_MODULE(AssemblerMainARM64) { ::signal(SIGSEGV, Detail::segfault_handler); - + for (size_t i = 1; i < argc; ++i) { if (argv[i][0] == '-') { if (strcmp(argv[i], "--ver") == 0 || strcmp(argv[i], "--v") == 0) { diff --git a/dev/LibCompiler/src/AssemblerPowerPC.cc b/dev/LibCompiler/src/AssemblerPowerPC.cc index bd44e6e..f2c3be3 100644 --- a/dev/LibCompiler/src/AssemblerPowerPC.cc +++ b/dev/LibCompiler/src/AssemblerPowerPC.cc @@ -75,7 +75,7 @@ static bool asm_read_attributes(std::string line); LIBCOMPILER_MODULE(AssemblerMainPower64) { ::signal(SIGSEGV, Detail::segfault_handler); - + for (size_t i = 1; i < argc; ++i) { if (argv[i][0] == '-') { if (strcmp(argv[i], "--ver") == 0 || strcmp(argv[i], "--v") == 0) { diff --git a/dev/LibCompiler/src/CCompiler64x0.cc b/dev/LibCompiler/src/CCompiler64x0.cc index c43abfe..c100e96 100644 --- a/dev/LibCompiler/src/CCompiler64x0.cc +++ b/dev/LibCompiler/src/CCompiler64x0.cc @@ -11,9 +11,9 @@ /// TODO: none #include <LibCompiler/Backend/64x0.h> +#include <LibCompiler/Detail/ClUtils.h> #include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> -#include <LibCompiler/Detail/ClUtils.h> #include <cstdio> #include <fstream> #include <iostream> @@ -87,7 +87,7 @@ struct CompilerState final { } // namespace Detail static Detail::CompilerState kState; -static std::string kIfFunction = ""; +static std::string kIfFunction = ""; namespace Detail { /// @brief prints an error into stdout. diff --git a/dev/LibCompiler/src/CCompilerARM64.cc b/dev/LibCompiler/src/CCompilerARM64.cc index 26867f1..a992349 100644 --- a/dev/LibCompiler/src/CCompilerARM64.cc +++ b/dev/LibCompiler/src/CCompilerARM64.cc @@ -11,9 +11,9 @@ /// TODO: none #include <LibCompiler/Backend/Aarch64.h> +#include <LibCompiler/Detail/ClUtils.h> #include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> -#include <LibCompiler/Detail/ClUtils.h> #include <cstdio> #include <fstream> #include <iostream> @@ -87,7 +87,7 @@ struct CompilerState final { } // namespace Detail static Detail::CompilerState kState; -static std::string kIfFunction = ""; +static std::string kIfFunction = ""; namespace Detail { /// @brief prints an error into stdout. diff --git a/dev/LibCompiler/src/CCompilerPower64.cc b/dev/LibCompiler/src/CCompilerPower64.cc index f10aa79..c65f575 100644 --- a/dev/LibCompiler/src/CCompilerPower64.cc +++ b/dev/LibCompiler/src/CCompilerPower64.cc @@ -8,9 +8,9 @@ */ #include <LibCompiler/Backend/PowerPC.h> +#include <LibCompiler/Detail/ClUtils.h> #include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> -#include <LibCompiler/Detail/ClUtils.h> #include <cstdio> #include <fstream> #include <iostream> @@ -78,7 +78,7 @@ struct CompilerState final { } // namespace Detail static Detail::CompilerState kState; -static std::string kIfFunction = ""; +static std::string kIfFunction = ""; namespace Detail { /// @brief prints an error into stdout. diff --git a/dev/LibCompiler/src/DynamicLinkerPEF.cc b/dev/LibCompiler/src/DynamicLinkerPEF.cc index 0def365..1b2418f 100644 --- a/dev/LibCompiler/src/DynamicLinkerPEF.cc +++ b/dev/LibCompiler/src/DynamicLinkerPEF.cc @@ -233,8 +233,8 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF) { pef_container.Version = kPefVersion; // specify the start address, can be 0x10000 - pef_container.Start = kLinkerDefaultOrigin; - pef_container.HdrSz = sizeof(LibCompiler::PEFContainer); + pef_container.Start = kLinkerDefaultOrigin; + pef_container.HdrSz = sizeof(LibCompiler::PEFContainer); pef_container.Checksum = 0UL; std::ofstream output_fc(kOutput, std::ofstream::binary); @@ -331,12 +331,12 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF) { } ld_mark_header: - command_header.Offset = offset_of_obj; - command_header.Kind = ae_records[ae_record_index].fKind; - command_header.Size = ae_records[ae_record_index].fSize; - command_header.Cpu = ae_header.fArch; - command_header.VMAddress = org; /// TODO: - command_header.SubCpu = ae_header.fSubArch; + command_header.Offset = offset_of_obj; + command_header.Kind = ae_records[ae_record_index].fKind; + command_header.Size = ae_records[ae_record_index].fSize; + command_header.Cpu = ae_header.fArch; + command_header.VMAddress = org; /// TODO: + command_header.SubCpu = ae_header.fSubArch; org += command_header.Size; @@ -560,7 +560,7 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF) { MemoryCopy(end_exec_hdr.Name, "Container:Exec:END", strlen("Container:Exec:END")); - end_exec_hdr.Size = strlen(end_exec_hdr.Name); + end_exec_hdr.Size = strlen(end_exec_hdr.Name); command_headers.push_back(end_exec_hdr); |
