summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-08-09 08:56:53 +0100
committerGitHub <noreply@github.com>2025-08-09 08:56:53 +0100
commit408be791647c015c99963cc1b6d710f58d729dec (patch)
tree35efb24716c331ee6bbe38e6fb0c8ab90079a373 /dev
parent9ac7b512ace3f8a3f5613dbf940484a9fa3c82c2 (diff)
refactor! rename `tooling` to `tools`
feat: BenchKit improvements and libMsg authorship refactors.
Diffstat (limited to 'dev')
-rw-r--r--dev/libMsg/MsgKit/Server.h4
-rw-r--r--dev/misc/BenchKit/Chrono.h5
-rw-r--r--dev/misc/BenchKit/X64Chrono.h16
3 files changed, 17 insertions, 8 deletions
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 <libSystem/SystemKit/System.h>
#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 <CompilerKit/CompilerKit.h>
#include <NeKit/Defines.h>
+/// @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