Add a basic scheduler with threads #18

Merged
apio merged 19 commits from threads into restart 2022-12-07 16:11:59 +00:00
2 changed files with 33 additions and 0 deletions
Showing only changes of commit 8c04788793 - Show all commits

23
luna/include/luna/Stack.h Normal file
View File

@ -0,0 +1,23 @@
#pragma once
#include <luna/Types.h>
struct Stack
{
Stack(u64 base, usize bytes);
u64 bottom()
{
return m_base;
}
u64 top();
usize bytes()
{
return m_bytes;
}
private:
u64 m_base;
usize m_bytes;
};

10
luna/src/Stack.cpp Normal file
View File

@ -0,0 +1,10 @@
#include <luna/Stack.h>
Stack::Stack(u64 base, usize bytes) : m_base(base), m_bytes(bytes)
{
}
u64 Stack::top()
{
return (m_base + m_bytes) - sizeof(void*);
}