From 408be791647c015c99963cc1b6d710f58d729dec Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 9 Aug 2025 08:56:53 +0100 Subject: refactor! rename `tooling` to `tools` feat: BenchKit improvements and libMsg authorship refactors. --- dev/libMsg/MsgKit/Server.h | 4 +++- dev/misc/BenchKit/Chrono.h | 5 +++++ dev/misc/BenchKit/X64Chrono.h | 16 +++++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'dev') diff --git a/dev/libMsg/MsgKit/Server.h b/dev/libMsg/MsgKit/Server.h index aee0dbdd..4fa73ccc 100644 --- a/dev/libMsg/MsgKit/Server.h +++ b/dev/libMsg/MsgKit/Server.h @@ -12,6 +12,9 @@ #include #endif +/// @author Amlal El Mahrouss +/// @brief libMsg LISP system. + struct LIBMSG_EXPR; /// @brief an expression chain of LibMSG. @@ -34,5 +37,4 @@ typedef Void (*libmsg_func_t)(LIBMSG_EXPR* self, VoidPtr arg, SizeT arg_size); IMPORT_C Void libmsg_init_library(libmsg_func_t* funcs, SizeT cnt); IMPORT_C UInt32 libmsg_close_library(Void); - IMPORT_C UInt32 libmsg_eval_expr(struct LIBMSG_EXPR* head); diff --git a/dev/misc/BenchKit/Chrono.h b/dev/misc/BenchKit/Chrono.h index 394f16fd..c6801de5 100644 --- a/dev/misc/BenchKit/Chrono.h +++ b/dev/misc/BenchKit/Chrono.h @@ -10,6 +10,11 @@ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. #include #include +/// @author Amlal El Mahrouss +/// @brief BenchKit Chrono contract. + +#define BENCHKIT_INTERFACE : public ::Kernel::ChronoInterface + namespace Kernel { class ChronoInterface; diff --git a/dev/misc/BenchKit/X64Chrono.h b/dev/misc/BenchKit/X64Chrono.h index 706ce883..358c74d4 100644 --- a/dev/misc/BenchKit/X64Chrono.h +++ b/dev/misc/BenchKit/X64Chrono.h @@ -14,11 +14,13 @@ namespace Kernel { class X64Chrono; struct X64ChronoTraits; +/// @brief BenchKit chrono logic for x64. struct X64ChronoTraits { private: STATIC UInt64 TickImpl_(void) { UInt64 a = 0, d = 0; - __asm__ volatile("rdtsc" : "=a"(a), "=d"(d)); + + asm volatile("rdtsc" : "=a"(a), "=d"(d)); return (d << 32) | a; } @@ -26,7 +28,7 @@ struct X64ChronoTraits { }; /// @brief X86_64 hardware chrono implementation using the `rdtsc` instruction. -class X64Chrono : public ChronoInterface { +class X64Chrono BENCHKIT_INTERFACE { public: X64Chrono() = default; ~X64Chrono() override = default; @@ -34,11 +36,11 @@ class X64Chrono : public ChronoInterface { NE_COPY_DEFAULT(X64Chrono); public: - void Start() override { fStart = X64ChronoTraits::TickImpl_(); } + Void Start() override { fStart = X64ChronoTraits::TickImpl_(); } - void Stop() override { fStop = X64ChronoTraits::TickImpl_(); } + Void Stop() override { fStop = X64ChronoTraits::TickImpl_(); } - void Reset() override { + Void Reset() override { fStart = 0; fStop = 0; } @@ -46,8 +48,8 @@ class X64Chrono : public ChronoInterface { UInt64 GetElapsedTime() const override { return fStop - fStart; } private: - UInt64 fStart = 0; - UInt64 fStop = 0; + UInt64 fStart{}; + UInt64 fStop{}; }; } // namespace Kernel -- cgit v1.2.3