ISIX-RTOS - small operating system for ARM microcontrollers 1.2

port_scheduler.h

Go to the documentation of this file.
00001 #ifndef __PORT_SCHEDULER_H
00002 #define __PORT_SCHEDULER_H
00003 /*-----------------------------------------------------------------------*/
00004 #ifdef __cplusplus
00005 extern "C" {
00006 namespace isix {
00007 #endif /*__cplusplus*/
00008 
00009 /*-----------------------------------------------------------------------*/
00010 #ifdef __cplusplus
00011 static const unsigned ISIX_PORT_SCHED_MIN_STACK_DEPTH = 112;
00012 #else
00013 //Minimum stack depth
00014 #define ISIX_PORT_SCHED_MIN_STACK_DEPTH 112
00015 #endif /*__cplusplus*/
00016 /*-----------------------------------------------------------------------*/
00017 void port_yield( void );
00018 
00019 /*-----------------------------------------------------------------------*/
00020 
00021 void port_start_first_task( void );
00022 
00023 /*-----------------------------------------------------------------------*/
00024 //TODO: IRQ lock and IRQ unlock
00025 void port_set_interrupt_mask( void );
00026 
00027 void port_clear_interrupt_mask( void );
00028 /*-----------------------------------------------------------------------*/
00029 //Cleanup task for example dealocate memory
00030 #ifdef __cplusplus
00031 static inline void port_cleanup_task(void */*sp*/) {}
00032 #else
00033 #define port_cleanup_task(p) do {} while(0)
00034 #endif
00035 /*-----------------------------------------------------------------------*/
00036 //Idle task additional
00037 static inline void port_idle_cpu( void )
00038 {
00039 #ifndef ISIX_DEBUG
00040         asm volatile("wfi\t\n");
00041 #endif
00042 }
00043 
00044 /*-----------------------------------------------------------------------*/
00045 #ifdef __cplusplus
00046 }       //end namespace
00047 }       //end extern-C
00048 #endif /* __cplusplus */
00049 
00050 /*-----------------------------------------------------------------------*/
00051 #endif
00052 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines