fix: new spinlock implementation, ramdisk max files, wallpaper scan locations
This commit is contained in:
@@ -8,12 +8,17 @@
|
||||
|
||||
namespace kcp {
|
||||
void Spinlock::Acquire() {
|
||||
uint64_t flags;
|
||||
asm volatile("pushfq; pop %0; cli" : "=r"(flags) :: "memory");
|
||||
while (atomic_flag.test_and_set(std::memory_order_acquire)) {
|
||||
asm volatile("pause");
|
||||
}
|
||||
savedFlags = flags;
|
||||
}
|
||||
|
||||
void Spinlock::Release() {
|
||||
uint64_t flags = savedFlags;
|
||||
atomic_flag.clear(std::memory_order_release);
|
||||
asm volatile("push %0; popfq" :: "r"(flags) : "memory");
|
||||
}
|
||||
};
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace kcp {
|
||||
class Spinlock {
|
||||
std::atomic_flag atomic_flag{ATOMIC_FLAG_INIT};
|
||||
uint64_t savedFlags = 0;
|
||||
public:
|
||||
void Acquire();
|
||||
void Release();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace Fs::Ramdisk {
|
||||
|
||||
static constexpr int MaxFiles = 256;
|
||||
static constexpr int MaxFiles = 512;
|
||||
static constexpr int MaxNameLen = 100;
|
||||
|
||||
struct FileEntry {
|
||||
|
||||
Reference in New Issue
Block a user