Skip to content

Kernel Data Structures

Sukant Pal edited this page Jan 6, 2018 · 2 revisions

Microkernel-based Structures

The microkernel provides basic C-style data structures so that the microkernel can remain as small as possible and have fast operations. The microkernel provides the following data structures -

LinkedList

Header File - Interface/Util/LinkedList.h

Source File - Util/LinkedList.cpp

Elements

LinkedListNode - This struct is used as the element in the linked-list. For structures that participate only in linked-lists it should be placed at the beginning of the structure.

Functions

The linked-list is not synchronized so it must be external locked. The following functions operate on the struct LinkedList -

AddElement - This function will add the element to the starting of the linked-list.

RemoveElement - Remove a element from the linked-list, assuming it was added before removing.

InsertElementAfter, InsertElementBefore - Add a element into the list before or after a existing element. This is very good for objects which use partially sorted lists.

'PushHead', 'PullTail' - Used for FIFO operations on lists.

CircularList

Files

Header File - Interface/Util/CircularList.hpp

Source File - Util/CircularList.cpp

Elements

'CircularListNode' - This `struct' is used for elements in the circular list.

Functions

ClnInsert, ClnRemove - are the functions which insert & remove elements from the circular list. The circular list is better for low memory code, where iteration can start from any node.