Fix sleep syscall

This commit is contained in:
Alex
2023-06-11 01:36:39 +03:00
parent f552b8f6f0
commit 85c0de688d
14 changed files with 829 additions and 673 deletions

View File

@ -1076,6 +1076,7 @@ namespace Memory
~MemMgr();
private:
NewLock(MgrLock);
Bitmap PageBitmap;
PageTable *Table;
VirtualFileSystem::Node *Directory;

View File

@ -41,14 +41,8 @@ struct CPUArchData
struct CPUData
{
/** @brief Used by syscall handler */
uint8_t *SystemCallStack; /* gs+0x0 */
/** @brief Used by syscall handler */
uintptr_t TempStack; /* gs+0x8 */
/** @brief Used by CPU */
uintptr_t Stack; /* gs+0x10 */
uintptr_t Stack;
/** @brief CPU ID. */
int ID;

View File

@ -122,6 +122,12 @@ namespace Tasking
struct TCB
{
/** @brief Used by syscall handler */
uintptr_t SyscallStack; /* gs+0x0 */
/** @brief Used by syscall handler */
uintptr_t TempStack; /* gs+0x8 */
TID ID;
char Name[256];
struct PCB *Parent;
@ -132,12 +138,12 @@ namespace Tasking
TaskStatus Status;
#if defined(a64)
CPU::x64::TrapFrame Registers;
uint64_t ShadowGSBase, GSBase, FSBase;
uintptr_t ShadowGSBase, GSBase, FSBase;
#elif defined(a32)
CPU::x32::TrapFrame Registers; // TODO
uint64_t ShadowGSBase, GSBase, FSBase;
uintptr_t ShadowGSBase, GSBase, FSBase;
#elif defined(aa64)
uint64_t Registers; // TODO
uintptr_t Registers; // TODO
#endif
uintptr_t IPHistory[128];
TaskSecurity Security;
@ -244,7 +250,8 @@ namespace Tasking
Untrusted = 0b0010,
Trusted = 0b0100,
TrustedByKernel = 0b1000,
FullTrust = Trusted | TrustedByKernel
FullTrust = Trusted | TrustedByKernel,
AllFlags = 0b1111
};
class Security
@ -379,7 +386,7 @@ namespace Tasking
*
* @param Milliseconds Amount of milliseconds to sleep
*/
void Sleep(uint64_t Milliseconds);
void Sleep(uint64_t Milliseconds, bool NoSwitch = false);
PCB *CreateProcess(PCB *Parent,
const char *Name,