added IPC syscalls
This commit is contained in:
@@ -16,12 +16,24 @@
|
||||
#include "../arch/context.h"
|
||||
#include "../object/queue.h"
|
||||
#include "../types.h"
|
||||
#include "../sync/semaphore.h"
|
||||
|
||||
#include "../memory/pagetable.h"
|
||||
|
||||
/// Stack size for each thread
|
||||
constexpr uint32_t STACK_SIZE = 3072;
|
||||
|
||||
|
||||
struct IpcStruct {
|
||||
uintptr_t ptr;
|
||||
size_t size;
|
||||
int pid;
|
||||
bool is_answer;
|
||||
IpcStruct* queue_link = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*! \brief The Thread is an object used by the scheduler.
|
||||
* \ingroup thread
|
||||
*/
|
||||
@@ -79,6 +91,12 @@ class Thread {
|
||||
pagetable_t* appcode_table;
|
||||
pagetable_t* appstack_table;
|
||||
|
||||
Semaphore ipc_sem;
|
||||
Queue<IpcStruct> ipc_queue;
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Unique thread id */
|
||||
const int id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user