feat: add SMB networking support

This commit is contained in:
daniel committed 2026-11-22 08:43:18 +01:00
1 parent 6665750528
commit 2af2e90606
55 files changed
+7456 -158

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
#pragma once
#include <sched.h>
namespace Arch { inline void Pause() { sched_yield(); } }
+2
View File
@@ -0,0 +1,2 @@
#pragma once
namespace Arch { struct SyscallFrame; }
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <atomic>
#include <sched.h>
namespace kcp {
class Mutex {
std::atomic_flag flag = ATOMIC_FLAG_INIT;
public:
void Acquire() { while (flag.test_and_set(std::memory_order_acquire)) sched_yield(); }
bool TryAcquire() { return !flag.test_and_set(std::memory_order_acquire); }
void Release() { flag.clear(std::memory_order_release); }
};
using Spinlock = Mutex;
}
+2
View File
@@ -0,0 +1,2 @@
#pragma once
#include <cstring>
+2
View File
@@ -0,0 +1,2 @@
#pragma once
#include <cstring>
+19
View File
@@ -0,0 +1,19 @@
#pragma once
// Host stand-in for the kernel scheduler: every pthread is a "process".
#include <atomic>
#include <cstdint>
namespace Sched {
struct Process {
int pid = -1;
int sessionId = 0;
std::atomic<bool> killPending{false};
};
int GetCurrentPid();
int GetCurrentTid();
Process* GetCurrentProcessPtr();
Process* GetCurrentThreadPtr();
bool HasCapability(uint64_t capability);
uint64_t ObserveObjectWake(void* object);
bool BlockOnObjectSince(void* object, uint64_t timeoutMs, uint64_t observedWake);
void WakeObjectWaiters(void* object);
}
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include <cstdint>
namespace Kt {
enum KernelLogLevel { INFO, OK, WARNING, ERROR };
struct KernelLogStream {
KernelLogStream(KernelLogLevel, const char*) {}
template <typename T> KernelLogStream& operator<<(const T&) { return *this; }
};
}
+3
View File
@@ -0,0 +1,3 @@
#pragma once
#include <cstdint>
namespace Timekeeping { uint64_t GetMilliseconds(); }