diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-05 09:57:44 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-05 09:57:44 +0100 |
| commit | 5f8ee9584a7a5c911d46f73e24ec7a1201058c50 (patch) | |
| tree | d31ac096094430ca93e521ef233144d969ad6427 /dev/CompilerKit | |
| parent | b0c5f2a2683657182f5ce3dc3bcbf252164b0077 (diff) | |
feat! compiler_kit: API breaking changes.
feat: debugger_kit: Debugger work in progress implementation.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/CompilerKit')
| -rw-r--r-- | dev/CompilerKit/CodeGen.h | 4 | ||||
| -rw-r--r-- | dev/CompilerKit/Defines.h | 4 | ||||
| -rw-r--r-- | dev/CompilerKit/Frontend.h | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/detail/32x0.h | 22 | ||||
| -rw-r--r-- | dev/CompilerKit/detail/64x0.h | 38 | ||||
| -rw-r--r-- | dev/CompilerKit/detail/X64.h | 14 | ||||
| -rw-r--r-- | dev/CompilerKit/lc-osx-san.json | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/lc-osx.json | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/lc-posix.json | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/src/Frontend/CCompiler64x0.cc | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/src/Frontend/CCompilerARM64.cc | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/src/Frontend/CCompilerPower64.cc | 2 | ||||
| -rw-r--r-- | dev/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc | 4 |
13 files changed, 50 insertions, 50 deletions
diff --git a/dev/CompilerKit/CodeGen.h b/dev/CompilerKit/CodeGen.h index 1439c27..99c968b 100644 --- a/dev/CompilerKit/CodeGen.h +++ b/dev/CompilerKit/CodeGen.h @@ -10,8 +10,8 @@ #include <CompilerKit/Defines.h> #include <CompilerKit/Macros.h> -#define LC_ASSEMBLY_INTERFACE : public ::CompilerKit::AssemblyInterface -#define LC_ENCODER : public ::CompilerKit::EncoderInterface +#define CK_ASSEMBLY_INTERFACE : public ::CompilerKit::AssemblyInterface +#define CK_ENCODER : public ::CompilerKit::EncoderInterface namespace CompilerKit { class AssemblyFactory; diff --git a/dev/CompilerKit/Defines.h b/dev/CompilerKit/Defines.h index e3203ba..e9d2560 100644 --- a/dev/CompilerKit/Defines.h +++ b/dev/CompilerKit/Defines.h @@ -97,8 +97,8 @@ KLASS& operator=(KLASS&&) = default; \ KLASS(KLASS&&) = default; -#define LC_IMPORT_C extern "C" -#define LC_IMPORT extern +#define CK_IMPORT_C extern "C" +#define CK_IMPORT extern namespace CompilerKit { inline constexpr int kBaseYear = 1900; diff --git a/dev/CompilerKit/Frontend.h b/dev/CompilerKit/Frontend.h index 168aa63..baf00d9 100644 --- a/dev/CompilerKit/Frontend.h +++ b/dev/CompilerKit/Frontend.h @@ -8,7 +8,7 @@ #include <CompilerKit/CodeGen.h> -#define LC_COMPILER_FRONTEND : public ::CompilerKit::CompilerFrontendInterface +#define CK_COMPILER_FRONTEND : public ::CompilerKit::CompilerFrontendInterface namespace CompilerKit { inline static auto kInvalidFrontend = "?"; diff --git a/dev/CompilerKit/detail/32x0.h b/dev/CompilerKit/detail/32x0.h index 124d9f4..f2d30e4 100644 --- a/dev/CompilerKit/detail/32x0.h +++ b/dev/CompilerKit/detail/32x0.h @@ -11,7 +11,7 @@ // @brief Open32x0 support. // @file detail/32x0.h -#define LC_ASM_OPCODE(__NAME, __OPCODE, __FUNCT3, __FUNCT7) \ +#define CK_ASM_OPCODE(__NAME, __OPCODE, __FUNCT3, __FUNCT7) \ {.fName = __NAME, .fOpcode = __OPCODE, .fFunct3 = __FUNCT3, .fFunct7 = __FUNCT7}, #define kAsmImmediate 0x01 @@ -37,18 +37,18 @@ struct CpuCode32x0 { #define kAsmByteStr ".byte" /* 8-bit */ inline std::vector<CpuCode32x0> kOpcodes32x0 = { - LC_ASM_OPCODE("nop", 0b0100011, 0b000, kAsmNoArgs) // nothing to do. (1C) - LC_ASM_OPCODE("jmp", 0b1110011, 0b001, kAsmJump) // jump to branch (2C) - LC_ASM_OPCODE("mov", 0b0100011, 0b101, kAsmImmediate) // move registers (3C) - LC_ASM_OPCODE("psh", 0b0111011, 0b000, kAsmImmediate) // push to sp (2C) - LC_ASM_OPCODE("pop", 0b0111011, 0b001, kAsmImmediate) // pop from sp. (1C) - LC_ASM_OPCODE("lea", 0b0111011, 0b010, + CK_ASM_OPCODE("nop", 0b0100011, 0b000, kAsmNoArgs) // nothing to do. (1C) + CK_ASM_OPCODE("jmp", 0b1110011, 0b001, kAsmJump) // jump to branch (2C) + CK_ASM_OPCODE("mov", 0b0100011, 0b101, kAsmImmediate) // move registers (3C) + CK_ASM_OPCODE("psh", 0b0111011, 0b000, kAsmImmediate) // push to sp (2C) + CK_ASM_OPCODE("pop", 0b0111011, 0b001, kAsmImmediate) // pop from sp. (1C) + CK_ASM_OPCODE("lea", 0b0111011, 0b010, kAsmImmediate) // setup stack and call, store address to CR (1C). - LC_ASM_OPCODE("ret", 0b0111011, 0b110, + CK_ASM_OPCODE("ret", 0b0111011, 0b110, kAsmImmediate) // return from procedure (2C). - LC_ASM_OPCODE("uc", 0b0111111, 0b000, kAsmSyscall) // user call (1C) - LC_ASM_OPCODE("kc", 0b0111111, 0b001, kAsmSyscall) // kernel call (1C) - LC_ASM_OPCODE("int", 0b0111111, 0b010, kAsmSyscall) // raise interrupt (1C) + CK_ASM_OPCODE("uc", 0b0111111, 0b000, kAsmSyscall) // user call (1C) + CK_ASM_OPCODE("kc", 0b0111111, 0b001, kAsmSyscall) // kernel call (1C) + CK_ASM_OPCODE("int", 0b0111111, 0b010, kAsmSyscall) // raise interrupt (1C) }; // \brief 64x0 register prefix diff --git a/dev/CompilerKit/detail/64x0.h b/dev/CompilerKit/detail/64x0.h index af01c07..9c12ca5 100644 --- a/dev/CompilerKit/detail/64x0.h +++ b/dev/CompilerKit/detail/64x0.h @@ -12,7 +12,7 @@ // @brief Open64x0 support. // @file detail/64x0.h -#define LC_ASM_OPCODE(__NAME, __OPCODE, __FUNCT3, __FUNCT7) \ +#define CK_ASM_OPCODE(__NAME, __OPCODE, __FUNCT3, __FUNCT7) \ {.fName = __NAME, .fOpcode = __OPCODE, .fFunct3 = __FUNCT3, .fFunct7 = __FUNCT7}, #define kAsmImmediate 0x01 @@ -32,28 +32,28 @@ struct CpuOpcode64x0 { }; inline std::vector<CpuOpcode64x0> kOpcodes64x0 = { - LC_ASM_OPCODE("nop", 0b0000000, 0b0000000, kAsmNoArgs) // no-operation. - LC_ASM_OPCODE("np", 0b0000000, 0b0000000, kAsmNoArgs) // no-operation. - LC_ASM_OPCODE("jlr", 0b1110011, 0b0000111, + CK_ASM_OPCODE("nop", 0b0000000, 0b0000000, kAsmNoArgs) // no-operation. + CK_ASM_OPCODE("np", 0b0000000, 0b0000000, kAsmNoArgs) // no-operation. + CK_ASM_OPCODE("jlr", 0b1110011, 0b0000111, kAsmJump) // jump to linked return register - LC_ASM_OPCODE("jrl", 0b1110011, 0b0001111, + CK_ASM_OPCODE("jrl", 0b1110011, 0b0001111, kAsmJump) // jump from return register. - LC_ASM_OPCODE("mv", 0b0100011, 0b101, kAsmRegToReg) LC_ASM_OPCODE( - "bg", 0b1100111, 0b111, kAsmRegToReg) LC_ASM_OPCODE("bl", 0b1100111, 0b011, kAsmRegToReg) - LC_ASM_OPCODE("beq", 0b1100111, 0b000, kAsmRegToReg) - LC_ASM_OPCODE("bne", 0b1100111, 0b001, kAsmRegToReg) - LC_ASM_OPCODE("bge", 0b1100111, 0b101, kAsmRegToReg) - LC_ASM_OPCODE("ble", 0b1100111, 0b100, kAsmRegToReg) - LC_ASM_OPCODE("stw", 0b0001111, 0b100, kAsmImmediate) - LC_ASM_OPCODE("ldw", 0b0001111, 0b100, kAsmImmediate) - LC_ASM_OPCODE("lda", 0b0001111, 0b101, kAsmImmediate) - LC_ASM_OPCODE("sta", 0b0001111, 0b001, kAsmImmediate) + CK_ASM_OPCODE("mv", 0b0100011, 0b101, kAsmRegToReg) CK_ASM_OPCODE( + "bg", 0b1100111, 0b111, kAsmRegToReg) CK_ASM_OPCODE("bl", 0b1100111, 0b011, kAsmRegToReg) + CK_ASM_OPCODE("beq", 0b1100111, 0b000, kAsmRegToReg) + CK_ASM_OPCODE("bne", 0b1100111, 0b001, kAsmRegToReg) + CK_ASM_OPCODE("bge", 0b1100111, 0b101, kAsmRegToReg) + CK_ASM_OPCODE("ble", 0b1100111, 0b100, kAsmRegToReg) + CK_ASM_OPCODE("stw", 0b0001111, 0b100, kAsmImmediate) + CK_ASM_OPCODE("ldw", 0b0001111, 0b100, kAsmImmediate) + CK_ASM_OPCODE("lda", 0b0001111, 0b101, kAsmImmediate) + CK_ASM_OPCODE("sta", 0b0001111, 0b001, kAsmImmediate) // add/sub without carry flag - LC_ASM_OPCODE("add", 0b0101011, 0b100, kAsmImmediate) - LC_ASM_OPCODE("sub", 0b0101011, 0b101, kAsmImmediate) + CK_ASM_OPCODE("add", 0b0101011, 0b100, kAsmImmediate) + CK_ASM_OPCODE("sub", 0b0101011, 0b101, kAsmImmediate) // add/sub with carry flag - LC_ASM_OPCODE("addc", 0b0101011, 0b110, kAsmImmediate) LC_ASM_OPCODE( - "subc", 0b0101011, 0b111, kAsmImmediate) LC_ASM_OPCODE("sc", 0b1110011, 0b00, kAsmSyscall)}; + CK_ASM_OPCODE("addc", 0b0101011, 0b110, kAsmImmediate) CK_ASM_OPCODE( + "subc", 0b0101011, 0b111, kAsmImmediate) CK_ASM_OPCODE("sc", 0b1110011, 0b00, kAsmSyscall)}; // \brief 64x0 register prefix // example: r32, r0 diff --git a/dev/CompilerKit/detail/X64.h b/dev/CompilerKit/detail/X64.h index 3f7420a..ed995be 100644 --- a/dev/CompilerKit/detail/X64.h +++ b/dev/CompilerKit/detail/X64.h @@ -11,7 +11,7 @@ // @brief AMD64 support. // @file detail/X64.h -#define LC_ASM_OPCODE(__NAME, __OPCODE) {.fName = __NAME, .fOpcode = __OPCODE}, +#define CK_ASM_OPCODE(__NAME, __OPCODE) {.fName = __NAME, .fOpcode = __OPCODE}, typedef char i64_character_t; typedef uint8_t i64_byte_t; @@ -39,11 +39,11 @@ struct CpuOpcodeAMD64 { #define kJumpLimitStandardLimit 0xEB inline std::vector<CpuOpcodeAMD64> kOpcodesAMD64 = { - LC_ASM_OPCODE("int", 0xCD) LC_ASM_OPCODE("into", 0xCE) LC_ASM_OPCODE("intd", 0xF1) - LC_ASM_OPCODE("int3", 0xC3) LC_ASM_OPCODE("iret", 0xCF) LC_ASM_OPCODE("retf", 0xCB) - LC_ASM_OPCODE("retn", 0xC3) LC_ASM_OPCODE("ret", 0xC3) LC_ASM_OPCODE("sti", 0xfb) - LC_ASM_OPCODE("cli", 0xfa) LC_ASM_OPCODE("hlt", 0xf4) LC_ASM_OPCODE("nop", 0x90) - LC_ASM_OPCODE("mov", 0x48) LC_ASM_OPCODE("call", 0xFF) - LC_ASM_OPCODE("syscall", 0x0F) LC_ASM_OPCODE("xor", 0x48)}; + CK_ASM_OPCODE("int", 0xCD) CK_ASM_OPCODE("into", 0xCE) CK_ASM_OPCODE("intd", 0xF1) + CK_ASM_OPCODE("int3", 0xC3) CK_ASM_OPCODE("iret", 0xCF) CK_ASM_OPCODE("retf", 0xCB) + CK_ASM_OPCODE("retn", 0xC3) CK_ASM_OPCODE("ret", 0xC3) CK_ASM_OPCODE("sti", 0xfb) + CK_ASM_OPCODE("cli", 0xfa) CK_ASM_OPCODE("hlt", 0xf4) CK_ASM_OPCODE("nop", 0x90) + CK_ASM_OPCODE("mov", 0x48) CK_ASM_OPCODE("call", 0xFF) + CK_ASM_OPCODE("syscall", 0x0F) CK_ASM_OPCODE("xor", 0x48)}; #define kAsmRegisterLimit 16 diff --git a/dev/CompilerKit/lc-osx-san.json b/dev/CompilerKit/lc-osx-san.json index 5ec4209..f190db2 100644 --- a/dev/CompilerKit/lc-osx-san.json +++ b/dev/CompilerKit/lc-osx-san.json @@ -23,7 +23,7 @@ ], "cpp_macros": [ "__NECTI__=202505", - "LC_USE_STRUCTS=1", + "CK_USE_STRUCTS=1", "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" ] }
\ No newline at end of file diff --git a/dev/CompilerKit/lc-osx.json b/dev/CompilerKit/lc-osx.json index e434ee8..4880763 100644 --- a/dev/CompilerKit/lc-osx.json +++ b/dev/CompilerKit/lc-osx.json @@ -18,7 +18,7 @@ ], "cpp_macros": [ "__NECTI__=202505", - "LC_USE_STRUCTS=1", + "CK_USE_STRUCTS=1", "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" ] }
\ No newline at end of file diff --git a/dev/CompilerKit/lc-posix.json b/dev/CompilerKit/lc-posix.json index e8668b9..e80ce65 100644 --- a/dev/CompilerKit/lc-posix.json +++ b/dev/CompilerKit/lc-posix.json @@ -18,7 +18,7 @@ ], "cpp_macros": [ "__NECTI__=202505", - "LC_USE_STRUCTS=1", + "CK_USE_STRUCTS=1", "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" ] }
\ No newline at end of file diff --git a/dev/CompilerKit/src/Frontend/CCompiler64x0.cc b/dev/CompilerKit/src/Frontend/CCompiler64x0.cc index c7ac387..6ee7e32 100644 --- a/dev/CompilerKit/src/Frontend/CCompiler64x0.cc +++ b/dev/CompilerKit/src/Frontend/CCompiler64x0.cc @@ -1044,7 +1044,7 @@ skip_braces_check: ///////////////////////////////////////////////////////////////////////////////////////// -class AssemblyCCInterface final LC_ASSEMBLY_INTERFACE { +class AssemblyCCInterface final CK_ASSEMBLY_INTERFACE { public: explicit AssemblyCCInterface() = default; ~AssemblyCCInterface() override = default; diff --git a/dev/CompilerKit/src/Frontend/CCompilerARM64.cc b/dev/CompilerKit/src/Frontend/CCompilerARM64.cc index dd230c5..1c1582f 100644 --- a/dev/CompilerKit/src/Frontend/CCompilerARM64.cc +++ b/dev/CompilerKit/src/Frontend/CCompilerARM64.cc @@ -1043,7 +1043,7 @@ skip_braces_check: ///////////////////////////////////////////////////////////////////////////////////////// -class AssemblyCCInterface final LC_ASSEMBLY_INTERFACE { +class AssemblyCCInterface final CK_ASSEMBLY_INTERFACE { public: explicit AssemblyCCInterface() = default; ~AssemblyCCInterface() override = default; diff --git a/dev/CompilerKit/src/Frontend/CCompilerPower64.cc b/dev/CompilerKit/src/Frontend/CCompilerPower64.cc index 0ffbef0..40598c9 100644 --- a/dev/CompilerKit/src/Frontend/CCompilerPower64.cc +++ b/dev/CompilerKit/src/Frontend/CCompilerPower64.cc @@ -1062,7 +1062,7 @@ skip_braces_check: ///////////////////////////////////////////////////////////////////////////////////////// -class AssemblyMountpointCLang final LC_ASSEMBLY_INTERFACE { +class AssemblyMountpointCLang final CK_ASSEMBLY_INTERFACE { public: explicit AssemblyMountpointCLang() = default; ~AssemblyMountpointCLang() override = default; diff --git a/dev/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc b/dev/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc index 5a0fc02..98a8018 100644 --- a/dev/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc +++ b/dev/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc @@ -117,7 +117,7 @@ static Boolean kInBraces = false; static size_t kBracesCount = 0UL; /* @brief C++ compiler backend for the NeKernel C++ driver */ -class CompilerFrontendCPlusPlusAMD64 final LC_COMPILER_FRONTEND { +class CompilerFrontendCPlusPlusAMD64 final CK_COMPILER_FRONTEND { public: explicit CompilerFrontendCPlusPlusAMD64() = default; ~CompilerFrontendCPlusPlusAMD64() override = default; @@ -718,7 +718,7 @@ CompilerKit::SyntaxLeafList::SyntaxLeaf CompilerFrontendCPlusPlusAMD64::Compile( ///////////////////////////////////////////////////////////////////////////////////////// -class AssemblyCPlusPlusInterfaceAMD64 final LC_ASSEMBLY_INTERFACE { +class AssemblyCPlusPlusInterfaceAMD64 final CK_ASSEMBLY_INTERFACE { public: explicit AssemblyCPlusPlusInterfaceAMD64() = default; ~AssemblyCPlusPlusInterfaceAMD64() override = default; |
