XenevaOS
Loading...
Searching...
No Matches
postbox.h
Go to the documentation of this file.
1
32#ifndef __POSTBOX_H__
33#define __POSTBOX_H__
34
35#include <stdint.h>
36#if defined(__GNUC__) || defined(__clang__)
37#ifndef __cplusplus
38#include <stdbool.h>
39#endif
40#endif
41#ifdef ARCH_X64
42#include <Hal/x86_64_sched.h>
43#elif ARCH_ARM64
44#include <Hal/AA64/sched.h>
45#endif
46#include <Fs/vfs.h>
47
48
49#define POSTBOX_CREATE 401
50#define POSTBOX_DESTROY 402
51#define POSTBOX_PUT_EVENT 403
52#define POSTBOX_GET_EVENT 404
53#define POSTBOX_CREATE_ROOT 405
54#define POSTBOX_GET_EVENT_ROOT 406
55
56#define POSTBOX_NO_EVENT -1
57#define POSTBOX_ROOT_ID 1
58
59//#pragma pack(push,1)
60/*
61 * PostEvent -- event message structure
62 */
81//#pragma pack(pop)
82
83#ifdef ARCH_X64
84#pragma pack(push,1)
85#endif
96#ifdef ARCH_X64
97#pragma pack(pop)
98#endif
99
104extern void AuIPCPostBoxInitialise();
105
110extern void PostBoxPutEvent(PostEvent* event);
111
112#ifdef ARCH_X64
113/*
114 * PostBoxGetEvent -- get an event from post box and copy it to a
115 * memory area
116 * @param event -- pointer to a memory area
117 * @param root -- is this post box is root
118 * @param curr_thread -- Pointer to current thread
119 */
120extern int PostBoxGetEvent(PostEvent* event, bool root, AuThread* curr_thread);
121#elif ARCH_ARM64
129extern int PostBoxGetEvent(PostEvent* event, bool root, AA64Thread* curr_thread);
130#endif
131
133
139extern void PostBoxCreate(bool root, uint16_t tid);
140
146extern void PostBoxDestroyByID(uint16_t id);
147
155extern int PostBoxIOControl(AuVFSNode* file, int code, void* arg);
156
157
158#endif
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
int PostBoxGetEvent(PostEvent *event, bool root, AuThread *curr_thread)
Definition postbox.cpp:186
void PostBoxCreate(bool root, uint16_t tid)
PostBoxCreate – creates a postbox.
Definition postbox.cpp:80
void PostBoxDestroyByID(uint16_t id)
PostBoxDestroyByID – destroys a post box identified by an id.
Definition postbox.cpp:138
int PostBoxIOControl(AuVFSNode *file, int code, void *arg)
PostBoxIOControl – I/O Control function for post box manager.
Definition postbox.cpp:220
void AuIPCPostBoxInitialise()
AuIPCPostBoxInitialise – initialise the post box ipc manager.
Definition postbox.cpp:265
void PostBoxPutEvent(PostEvent *event)
PostBoxPutEvent – put an event to a specific post box.
Definition postbox.cpp:156
struct _postbox_ PostBox
AuVFSNode * AuPostBOXGetNode()
Definition postbox.c:294
struct _post_event_ PostEvent
Definition vfs.h:98
Definition x86_64_sched.h:118
Definition postbox.h:63
uint32_t dword
Definition postbox.h:67
uint32_t dword4
Definition postbox.h:70
uint32_t dword3
Definition postbox.h:69
char * charValue
Definition postbox.h:77
uint32_t dword2
Definition postbox.h:68
uint32_t * pValue1
Definition postbox.h:76
uint8_t type
Definition postbox.h:64
uint32_t dword6
Definition postbox.h:72
uint16_t from_id
Definition postbox.h:66
uint32_t dword5
Definition postbox.h:71
uint16_t to_id
Definition postbox.h:65
char charValue3[100]
Definition postbox.h:79
uint32_t dword7
Definition postbox.h:73
unsigned char * charValue2
Definition postbox.h:78
uint32_t dword8
Definition postbox.h:74
uint32_t * pValue
Definition postbox.h:75
Definition postbox.h:86
struct _postbox_ * prev
Definition postbox.h:94
uint64_t * address
Definition postbox.h:87
uint16_t size
Definition postbox.h:92
uint16_t ownerID
Definition postbox.h:88
int headIdx
Definition postbox.h:89
struct _postbox_ * next
Definition postbox.h:93
bool full
Definition postbox.h:91
int tailIdx
Definition postbox.h:90
TTY * root
Definition tty.cpp:47