XenevaOS
Loading...
Searching...
No Matches
Macros | Functions | Variables
postbox.cpp File Reference
#include <Ipc\postbox.h>
#include <Mm\kmalloc.h>
#include <Mm\pmmngr.h>
#include <Mm\vmmngr.h>
#include <string.h>
#include <_null.h>
#include <Hal\x86_64_sched.h>
#include <Fs\vfs.h>
#include <Fs\dev\devfs.h>
#include <Hal\x86_64_hal.h>
#include <Hal\serial.h>
Include dependency graph for postbox.cpp:

Macros

#define POSTEVENT_ALIGN   8
 
#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)
 
void PostBoxCreate (bool root, uint16_t tid)
 PostBoxCreate – creates a postbox.
 
void PostBoxDestroy (PostBox *box)
 
void PostBoxDestroyByID (uint16_t id)
 PostBoxDestroyByID – destroys a post box identified by an id.
 
void PostBoxPutEvent (PostEvent *event)
 PostBoxPutEvent – put an event to a specific post box.
 
int PostBoxGetEvent (PostEvent *event, bool root, AuThread *curr_thread)
 
int PostBoxIOControl (AuVFSNode *file, int code, void *arg)
 PostBoxIOControl – I/O Control function for post box manager.
 
void AuIPCPostBoxInitialise ()
 AuIPCPostBoxInitialise – initialise the post box ipc manager.
 

Variables

PostBoxfirstBox
 
PostBoxlastBox
 
bool _PostBoxRootCreated
 

Macro Definition Documentation

◆ POSTEVENT_ALIGN

#define POSTEVENT_ALIGN   8

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.

◆ POSTEVENT_SIZE_ALIGNED

#define POSTEVENT_SIZE_ALIGNED   (((sizeof(PostEvent) + (POSTEVENT_ALIGN - 1)) / POSTEVENT_ALIGN) * POSTEVENT_ALIGN)

Function Documentation

◆ AuIPCPostBoxInitialise()

void AuIPCPostBoxInitialise ( )

AuIPCPostBoxInitialise – initialise the post box ipc manager.

◆ IsPostBoxEmpty()

bool IsPostBoxEmpty ( PostBox box)

◆ IsPostBoxFull()

bool IsPostBoxFull ( PostBox box)

◆ PostBoxAdvanceIndex()

void PostBoxAdvanceIndex ( PostBox box)

◆ PostBoxCreate()

void PostBoxCreate ( bool  root,
uint16_t  tid 
)

PostBoxCreate – creates a postbox.

Parameters
root– is this post box root ?
tid– thread id

◆ PostBoxDestroy()

void PostBoxDestroy ( PostBox box)

◆ PostBoxDestroyByID()

void PostBoxDestroyByID ( uint16_t  id)

PostBoxDestroyByID – destroys a post box identified by an id.

Parameters
id– id of the postbox

◆ PostBoxGetEvent()

int PostBoxGetEvent ( PostEvent event,
bool  root,
AuThread curr_thread 
)

◆ PostBoxIOControl()

int PostBoxIOControl ( AuVFSNode file,
int  code,
void *  arg 
)

PostBoxIOControl – I/O Control function for post box manager.

Parameters
file– Pointer to postbox file
code– Post Box command
arg– extra data

◆ PostBoxPutEvent()

void PostBoxPutEvent ( PostEvent event)

PostBoxPutEvent – put an event to a specific post box.

Parameters
event– Event to put

◆ PostBoxRetreat()

void PostBoxRetreat ( PostBox box)

Variable Documentation

◆ _PostBoxRootCreated

bool _PostBoxRootCreated

◆ firstBox

PostBox* firstBox

◆ lastBox

PostBox* lastBox