IBNOS
|
Classes | |
struct | handleTable |
Macros | |
#define | MIN_HANDLES 0x100 |
#define | MAX_HANDLES 0x10000 |
Functions | |
void | handleTableInit (struct handleTable *table) |
Initializes the handle table structure which is part of each process. More... | |
void | handleForkTable (struct handleTable *destination, struct handleTable *source) |
Forks a handle table. More... | |
void | handleTableFree (struct handleTable *table) |
Releases the memory of the handle table and all associated objects. More... | |
uint32_t | handleAllocate (struct handleTable *table, struct object *object) |
Allocates a handle (index) for a specific kernel object. More... | |
bool | handleSet (struct handleTable *table, uint32_t handle, struct object *object) |
Associates a handle (index) with a kernel object. More... | |
struct object * | handleGet (struct handleTable *table, uint32_t handle) |
Returns the kernel object associated to a handle. More... | |
bool | handleRelease (struct handleTable *table, uint32_t handle) |
Releases the object associated with a handle. More... | |
uint32_t | handleCount (struct handleTable *table) |
Returns the number of handles in a handletable. More... | |
Variables | |
struct handleTable | __attribute__ |
uint32_t handleAllocate | ( | struct handleTable * | table, |
struct object * | object | ||
) |
Allocates a handle (index) for a specific kernel object.
Allocates the lowest possible handle for a specific kernel object. This function also increases the refcount, such that the object will stay there until the last reference was deleted.
table | Pointer to the handle table |
object | Pointer to some kernel object |
uint32_t handleCount | ( | struct handleTable * | table | ) |
void handleForkTable | ( | struct handleTable * | destination, |
struct handleTable * | source | ||
) |
Forks a handle table.
Initializes the destination handle table and duplicates references to all the kernel objects in the source handle table. This function is used to implement the fork syscall.
destination | Pointer to the destination handle table (which will be initialized) |
source | Pointer to the source handle table |
struct object* handleGet | ( | struct handleTable * | table, |
uint32_t | handle | ||
) |
bool handleRelease | ( | struct handleTable * | table, |
uint32_t | handle | ||
) |
bool handleSet | ( | struct handleTable * | table, |
uint32_t | handle, | ||
struct object * | object | ||
) |
Associates a handle (index) with a kernel object.
Releases the previous object which was associated with the handle (if any), afterwards assigns the new kernel object to it.
table | Pointer to the handle table |
handle | Handle which will be replaced |
object | Pointer to some kernel object |
void handleTableFree | ( | struct handleTable * | table | ) |
void handleTableInit | ( | struct handleTable * | table | ) |
Initializes the handle table structure which is part of each process.
Initializes all members of the handle table structure, which is used to keep track of all kernel objects available for the user mode. The newly allocated table is empty.
table | Pointer to the handle table |
struct handleTable __attribute__ |