Add mesosphere (VERY VERY WIP)

This commit is contained in:
TuxSH
2018-10-31 21:47:31 +01:00
committed by Michael Scire
parent 50e307b4b7
commit 745fa84e5e
56 changed files with 5033 additions and 0 deletions

View File

@@ -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{};
};
}

View File

@@ -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{};
};
}