XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
x86_64_sched.h File Reference
#include <stdint.h>
#include <aurora.h>
#include <Ipc\signal.h>
Include dependency graph for x86_64_sched.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _frame_
 
struct  _syscall_param_
 
struct  _uentry_
 
struct  _signal_queue_
 
struct  _au_thread_
 

Macros

#define THREAD_STATE_READY   1
 
#define THREAD_STATE_BLOCKED   3
 
#define THREAD_STATE_SLEEP   4
 
#define THREAD_STATE_KILLABLE   5
 
#define THREAD_LEVEL_KERNEL   (1<<0)
 
#define THREAD_LEVEL_USER   (1<<1)
 
#define THREAD_LEVEL_SUBTHREAD   (1<<2)
 
#define THREAD_LEVEL_MAIN_THREAD   (1<<3)
 

Typedefs

typedef struct _frame_ AuThreadFrame
 
typedef struct _syscall_param_ AuSyscallParam
 
typedef struct _uentry_ AuUserEntry
 
typedef struct _signal_queue_ SignalQueue
 
typedef struct _au_thread_ AuThread
 

Functions

void AuSchedulerStart ()
 AuSchedulerStart – start the scheduler.
 
void AuSchedulerInitialise ()
 
void AuSchedulerInitAp ()
 
AU_EXTERN AU_EXPORT AuThreadAuCreateKthread (void(*entry)(uint64_t), uint64_t stack, uint64_t cr3, char *name)
 
AU_EXTERN AU_EXPORT AuThreadAuGetCurrentThread ()
 
void AuKThreadCopy (AuThread *dest, AuThread *src)
 
AU_EXTERN AU_EXPORT void AuBlockThread (AuThread *thread)
 
AU_EXTERN AU_EXPORT void AuSleepThread (AuThread *thread, uint64_t ms)
 
AU_EXTERN AU_EXPORT void AuUnblockThread (AuThread *t)
 
void AuThreadMoveToTrash (AuThread *t)
 
void AuThreadCleanTrash (AuThread *t)
 
AU_EXTERN AU_EXPORT AuThreadAuThreadFindByID (uint16_t id)
 
AU_EXTERN AU_EXPORT AuThreadAuThreadFindByIDBlockList (uint16_t id)
 
AU_EXTERN AU_EXPORT void AuForceScheduler ()
 AuForceScheduler – force the scheduler to switch next thread.
 
AU_EXTERN AU_EXPORT bool AuIsSchedulerInitialised ()
 
AU_EXTERN AU_EXPORT uint64_t AuGetSystemTimerTick ()
 AuGetSystemTimerTick – return the current system timer tick.
 

Macro Definition Documentation

◆ THREAD_LEVEL_KERNEL

#define THREAD_LEVEL_KERNEL   (1<<0)

Thread levels ========================================================= THREAD_LEVEL_KERNEL – This bit is set when the thread given is kernel mode THREAD_LEVEL_USER – This bit is set when the thread given is user mode

◆ THREAD_LEVEL_MAIN_THREAD

#define THREAD_LEVEL_MAIN_THREAD   (1<<3)

◆ THREAD_LEVEL_SUBTHREAD

#define THREAD_LEVEL_SUBTHREAD   (1<<2)

◆ THREAD_LEVEL_USER

#define THREAD_LEVEL_USER   (1<<1)

◆ THREAD_STATE_BLOCKED

#define THREAD_STATE_BLOCKED   3

◆ THREAD_STATE_KILLABLE

#define THREAD_STATE_KILLABLE   5

◆ THREAD_STATE_READY

#define THREAD_STATE_READY   1

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ THREAD_STATE_SLEEP

#define THREAD_STATE_SLEEP   4

Typedef Documentation

◆ AuSyscallParam

◆ AuThread

typedef struct _au_thread_ AuThread

◆ AuThreadFrame

typedef struct _frame_ AuThreadFrame

◆ AuUserEntry

typedef struct _uentry_ AuUserEntry

◆ SignalQueue

typedef struct _signal_queue_ SignalQueue

Function Documentation

◆ AuBlockThread()

AU_EXTERN AU_EXPORT void AuBlockThread ( AuThread thread)

◆ AuCreateKthread()

AU_EXTERN AU_EXPORT AuThread * AuCreateKthread ( void(*)(uint64_t entry,
uint64_t  stack,
uint64_t  cr3,
char *  name 
)

! Creates a kernel mode thread

Parameters
entry– Entry point address
stack– Stack address
cr3– the top most page map level address
name– name of the thread
priority– (currently unused) thread's priority

◆ AuForceScheduler()

AU_EXTERN AU_EXPORT void AuForceScheduler ( )

AuForceScheduler – force the scheduler to switch next thread.

◆ AuGetCurrentThread()

AU_EXTERN AU_EXPORT AuThread * AuGetCurrentThread ( )

◆ AuGetSystemTimerTick()

AU_EXTERN AU_EXPORT uint64_t AuGetSystemTimerTick ( )

AuGetSystemTimerTick – return the current system timer tick.

◆ AuIsSchedulerInitialised()

AU_EXTERN AU_EXPORT bool AuIsSchedulerInitialised ( )

◆ AuKThreadCopy()

void AuKThreadCopy ( AuThread dest,
AuThread src 
)
extern

◆ AuSchedulerInitAp()

void AuSchedulerInitAp ( )
extern

◆ AuSchedulerInitialise()

void AuSchedulerInitialise ( )
extern

◆ AuSchedulerStart()

void AuSchedulerStart ( )
extern

AuSchedulerStart – start the scheduler.

◆ AuSleepThread()

AU_EXTERN AU_EXPORT void AuSleepThread ( AuThread thread,
uint64_t  ms 
)

◆ AuThreadCleanTrash()

void AuThreadCleanTrash ( AuThread t)
extern

◆ AuThreadFindByID()

AU_EXTERN AU_EXPORT AuThread * AuThreadFindByID ( uint16_t  id)

◆ AuThreadFindByIDBlockList()

AU_EXTERN AU_EXPORT AuThread * AuThreadFindByIDBlockList ( uint16_t  id)

◆ AuThreadMoveToTrash()

void AuThreadMoveToTrash ( AuThread t)
extern

◆ AuUnblockThread()

AU_EXTERN AU_EXPORT void AuUnblockThread ( AuThread t)