Kernel


Data Structures

struct  task_entry_t
 Startup task table. More...

Defines

#define HANDLE   void
#define NULL   0

Typedefs

typedef signed char int8
typedef unsigned char uint8
typedef signed short int16
typedef unsigned short uint16
typedef signed long int32
typedef unsigned long uint32

Enumerations

enum  STATUS {
  SYS_OK, SYS_ERROR, SYS_IDLE, SYS_MBX,
  SYS_SEM, SYS_RESUMED, SYS_TOUT, SYS_MBX_TOUT,
  SYS_SEM_TOUT, SYS_NONE
}
 System calls return and task entry codes. More...

Functions

void uSMARTX_Init (task_entry_t *ptbl)
 uSMARTX kernel initialisation function
STATUS uSMARTX_Scheduler (void)
 Task scheduler.
void uSMARTX_Tick (void)
 uSMARTX system tick
size_t INT_Disable (void)
 Globaly disable interrupts.
void INT_Enable (void)
 Globaly enable interrupts.
void INT_Restore (size_t flags)
 Restore status of interrupts.


Enumeration Type Documentation

enum STATUS
 

System calls return and task entry codes.

Enumerator:
SYS_OK  System call or scheduler returned successefuly
SYS_ERROR  System call or scheduler returned with error (resource not avaible)
SYS_IDLE  Scheduler returned in idle state, meaning there was no ready task to run
SYS_MBX  Mailbox was posted or freed
SYS_SEM  Semaphore was posted
SYS_RESUMED  Task was explicitely resumed
SYS_TOUT  Task sleep timeout expired
SYS_MBX_TOUT  Task timeout expired when pending on a mailbox
SYS_SEM_TOUT  Task timeout expired when pending on a semaphore
SYS_NONE  Task didn't recived any system events
Examples:
buffer.c, and timers.c.


Function Documentation

size_t INT_Disable void   ) 
 

Globaly disable interrupts.

This function globaly disables interrupts and returns the state of global interrupts flags before disabling interrupts. This value can later be used by calling INT_Restore() function to restore the state of interrupts disable flags.

Return values:
size_t status of global interrupt disable flags befor disabling interrupts
Attention:
Please refer to specific architecture implementation to see which interrupts are being disabled.

void INT_Enable void   ) 
 

Globaly enable interrupts.

This function globaly enables interrupts.

Attention:
Please refer to specific architecture implementation to see which interrupts are being enabled.
Examples:
buffer.c, and timers.c.

void INT_Restore size_t  flags  ) 
 

Restore status of interrupts.

This function restore the status of interrupts to the given state. Usually this function is used in conjunction with INT_Disable() function.

Parameters:
flags value to which restore the status of global interrupts flags
Attention:
Please refer to specific architecture implementation to see which interrupts are being enabled/disabled.

void uSMARTX_Init task_entry_t ptbl  ) 
 

uSMARTX kernel initialisation function

The uSmartX kernel must initialise its internal structures and tasks. Priori to start the system and call the scheduler for the first time this function must be called.

Parameters:
ptbl pointer to tasks table
Attention:
The initialisation function must be called before running the scheduler.
Examples:
buffer.c, and timers.c.

STATUS uSMARTX_Scheduler void   ) 
 

Task scheduler.

Return values:
Task return value. It is up to the user to decide how to act on return values.
Examples:
buffer.c, and timers.c.

void uSMARTX_Tick void   ) 
 

uSMARTX system tick

This function takes care of the kernel system tick evaluation. Put this function where you will be incrementing your system tick. Normally this is placed in a timer ISR rutine.

Attention:
This function must not be interrupted.
Examples:
buffer.c, and timers.c.


Generated on Sun Oct 16 22:23:55 2005 for uSmartX by  doxygen 1.4.3