|
XenevaOS
|
#include <Ipc/postbox.h>#include <Hal/AA64/sched.h>#include <Mm\kmalloc.h>#include <Mm\pmmngr.h>#include <Mm\vmmngr.h>#include <string.h>#include <_null.h>#include <Fs\vfs.h>#include <Fs\dev\devfs.h>#include <Hal/AA64/aa64lowlevel.h>#include <Drivers/uart.h>#include <aucon.h>
Macros | |
| #define | POSTEVENT_ALIGN 8 |
| NOTE: PostBoxIPCManager is aurora's main communication manager between user space processes and kernel, in future drivers will also able to communicate with user processes and kernel through PostBoxIPCManager. | |
| #define | POSTEVENT_SIZE_ALIGNED (((sizeof(PostEvent) + (POSTEVENT_ALIGN - 1)) / POSTEVENT_ALIGN) * POSTEVENT_ALIGN) |
Functions | |
| void | PostBoxAdvanceIndex (PostBox *box) |
| void | PostBoxRetreat (PostBox *box) |
| bool | IsPostBoxEmpty (PostBox *box) |
| bool | IsPostBoxFull (PostBox *box) |
| uint64_t | read_sp () |
| void | PostBoxCreate (bool root, uint16_t tid) |
| PostBoxCreate – creates a postbox. | |
| void | PostBoxDestroy (PostBox *box) |
| PostBoxDestroy – destroy given postbox. | |
| void | PostBoxDestroyByID (uint16_t id) |
| PostBoxDestroyByID – destroys a post box identified by an id. | |
| void | enscheddebug () |
| void | PostBoxPutEvent (PostEvent *event) |
| PostBoxPutEvent – put an event to a specific post box. | |
| int | PostBoxGetEvent (PostEvent *event, bool root, AA64Thread *curr_thread) |
| PostBoxGetEvent – get an event from post box and copy it to a memory area. | |
| int | PostBoxIOControl (AuVFSNode *file, int code, void *arg) |
| PostBoxIOControl – I/O Control function for post box manager. | |
| AuVFSNode * | AuPostBOXGetNode () |
| void | AuIPCPostBoxInitialise () |
| AuIPCPostBoxInitialise – initialise the post box ipc manager. | |
Variables | |
| PostBox * | firstBox = NULL |
| PostBox * | lastBox = NULL |
| bool | _PostBoxRootCreated |
| AuVFSNode * | pbox |
BSD 2-Clause License
Copyright (c) 2022-2025, 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:
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.
| #define POSTEVENT_ALIGN 8 |
NOTE: PostBoxIPCManager is aurora's main communication manager between user space processes and kernel, in future drivers will also able to communicate with user processes and kernel through PostBoxIPCManager.
| #define POSTEVENT_SIZE_ALIGNED (((sizeof(PostEvent) + (POSTEVENT_ALIGN - 1)) / POSTEVENT_ALIGN) * POSTEVENT_ALIGN) |
| void AuIPCPostBoxInitialise | ( | ) |
AuIPCPostBoxInitialise – initialise the post box ipc manager.
create the postbox file
I dont know, but the sixth item in the device fs list is the postbox file node, but miraculously 6th item disappers from the list when opened from user space that's why we are creating a dummy node in the dev list
| AuVFSNode * AuPostBOXGetNode | ( | ) |
|
extern |
| void PostBoxAdvanceIndex | ( | PostBox * | box | ) |
PostBoxCreate – creates a postbox.
| root | – is this post box root ? |
| tid | – thread id |
| void PostBoxDestroy | ( | PostBox * | box | ) |
PostBoxDestroy – destroy given postbox.
| box | – Pointer to postbox need to destroy |
| void PostBoxDestroyByID | ( | uint16_t | id | ) |
PostBoxDestroyByID – destroys a post box identified by an id.
| id | – id of the postbox |
PostBoxGetEvent – get an event from post box and copy it to a memory area.
| event | – pointer to a memory area |
| root | – is this post box is root |
| curr_thread | – Pointer to current thread |
| int PostBoxIOControl | ( | AuVFSNode * | file, |
| int | code, | ||
| void * | arg | ||
| ) |
PostBoxIOControl – I/O Control function for post box manager.
| file | – Pointer to postbox file |
| code | – Post Box command |
| arg | – extra data |
| void PostBoxPutEvent | ( | PostEvent * | event | ) |
PostBoxPutEvent – put an event to a specific post box.
| event | – Event to put |
| void PostBoxRetreat | ( | PostBox * | box | ) |
|
extern |
| bool _PostBoxRootCreated |
| AuVFSNode* pbox |