Add mesosphere (VERY VERY WIP)

This commit is contained in:
TuxSH authored and Michael Scire committed 2019-06-03 17:41:00 -07:00
1 parent 50e307b4b7
commit 745fa84e5e
56 files changed
+5033

No files matched your search

@@ -0,0 +1,34 @@
#pragma once
#include <mesosphere/interfaces/IInterruptibleWork.hpp>
#include <mesosphere/interfaces/IAlarmable.hpp>
#include <mesosphere/arch/KSpinLock.hpp>
#include <mesosphere/board/KSystemClock.hpp>
namespace mesosphere
{
class KAlarm final : public IInterruptibleWork {
public:
//KAlarm() = default;
/// Precondition: alarmable not already added
void AddAlarmable(IAlarmable &alarmable);
/// Precondition: alarmable is present
void RemoveAlarmable(const IAlarmable &alarmable);
void HandleAlarm();
KAlarm(const KAlarm &) = delete;
KAlarm(KAlarm &&) = delete;
KAlarm &operator=(const KAlarm &) = delete;
KAlarm &operator=(KAlarm &&) = delete;
private:
KSpinLock spinlock{};
AlarmableSetType alarmables{};
};
}
@@ -0,0 +1,27 @@
#pragma once
#include <mesosphere/interfaces/IWork.hpp>
#include <mesosphere/kresources/KAutoObject.hpp>
namespace mesosphere
{
class KWorkQueue final {
public:
void AddWork(IWork &work);
void Initialize();
void HandleWorkQueue();
KWorkQueue(const KWorkQueue &) = delete;
KWorkQueue(KWorkQueue &&) = delete;
KWorkQueue &operator=(const KWorkQueue &) = delete;
KWorkQueue &operator=(KWorkQueue &&) = delete;
private:
WorkSList workQueue{};
SharedPtr<KThread> handlerThread{};
};
}