Skip to content

Commit

Permalink
kernel can operate with 16, 32 or 64-bit timer counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajmund Szymanski committed Jan 5, 2018
1 parent 4cb8029 commit 9cda71c
Show file tree
Hide file tree
Showing 40 changed files with 458 additions and 363 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Features
--------

- kernel works in preemptive or cooperative mode
- kernel can operate with 16, 32 or 64-bit timer counter
- kernel can operate in tick-less mode
- signals (clear, protect)
- events
Expand Down
2 changes: 2 additions & 0 deletions StateOS/README
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ There's a dedicated function for immediate change the task state.
---------
Features:
- kernel works in preemptive or cooperative mode
- kernel can operate with 16, 32 or 64-bit timer counter
- kernel can operate in tick-less mode
- signals (clear, protect)
- events
Expand Down Expand Up @@ -45,6 +46,7 @@ Features:
- updated tick-less mode
- updated waitUntil functions
- removed OS_TICKLESS definition, tick-less mode depends on OS_FREQUENCY value
- os can work with 16, 32 or 64-bit timer counter
---------
5.4
- added startup files for cosmic compiler
Expand Down
14 changes: 7 additions & 7 deletions StateOS/kernel/inc/os_bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: os_bar.h
@author Rajmund Szymanski
@date 10.12.2017
@date 01.01.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -237,7 +237,7 @@ void bar_delete( bar_t *bar );
*
******************************************************************************/

unsigned bar_waitUntil( bar_t *bar, uint32_t time );
unsigned bar_waitUntil( bar_t *bar, cnt_t time );

/******************************************************************************
*
Expand All @@ -260,7 +260,7 @@ unsigned bar_waitUntil( bar_t *bar, uint32_t time );
*
******************************************************************************/

unsigned bar_waitFor( bar_t *bar, uint32_t delay );
unsigned bar_waitFor( bar_t *bar, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -307,10 +307,10 @@ struct Barrier : public __bar
Barrier( const unsigned _limit ): __bar _BAR_INIT(_limit) {}
~Barrier( void ) { assert(queue == nullptr); }

void kill ( void ) { bar_kill (this); }
unsigned waitUntil( uint32_t _time ) { return bar_waitUntil(this, _time); }
unsigned waitFor ( uint32_t _delay ) { return bar_waitFor (this, _delay); }
unsigned wait ( void ) { return bar_wait (this); }
void kill ( void ) { bar_kill (this); }
unsigned waitUntil( cnt_t _time ) { return bar_waitUntil(this, _time); }
unsigned waitFor ( cnt_t _delay ) { return bar_waitFor (this, _delay); }
unsigned wait ( void ) { return bar_wait (this); }
};

#endif
Expand Down
32 changes: 16 additions & 16 deletions StateOS/kernel/inc/os_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: os_box.h
@author Rajmund Szymanski
@date 10.12.2017
@date 01.01.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -274,7 +274,7 @@ void box_delete( box_t *box );
*
******************************************************************************/

unsigned box_waitUntil( box_t *box, void *data, uint32_t time );
unsigned box_waitUntil( box_t *box, void *data, cnt_t time );

/******************************************************************************
*
Expand All @@ -299,7 +299,7 @@ unsigned box_waitUntil( box_t *box, void *data, uint32_t time );
*
******************************************************************************/

unsigned box_waitFor( box_t *box, void *data, uint32_t delay );
unsigned box_waitFor( box_t *box, void *data, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -370,7 +370,7 @@ unsigned box_takeISR( box_t *box, void *data ) { return box_waitFor(box, data, I
*
******************************************************************************/

unsigned box_sendUntil( box_t *box, const void *data, uint32_t time );
unsigned box_sendUntil( box_t *box, const void *data, cnt_t time );

/******************************************************************************
*
Expand All @@ -395,7 +395,7 @@ unsigned box_sendUntil( box_t *box, const void *data, uint32_t time );
*
******************************************************************************/

unsigned box_sendFor( box_t *box, const void *data, uint32_t delay );
unsigned box_sendFor( box_t *box, const void *data, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -474,17 +474,17 @@ struct baseMailBoxQueue : public __box
baseMailBoxQueue( const unsigned _limit, const unsigned _size, char * const _data ): __box _BOX_INIT(_limit, _size, _data) {}
~baseMailBoxQueue( void ) { assert(queue == nullptr); }

void kill ( void ) { box_kill (this); }
unsigned waitUntil( void *_data, uint32_t _time ) { return box_waitUntil(this, _data, _time); }
unsigned waitFor ( void *_data, uint32_t _delay ) { return box_waitFor (this, _data, _delay); }
unsigned wait ( void *_data ) { return box_wait (this, _data); }
unsigned take ( void *_data ) { return box_take (this, _data); }
unsigned takeISR ( void *_data ) { return box_takeISR (this, _data); }
unsigned sendUntil( const void *_data, uint32_t _time ) { return box_sendUntil(this, _data, _time); }
unsigned sendFor ( const void *_data, uint32_t _delay ) { return box_sendFor (this, _data, _delay); }
unsigned send ( const void *_data ) { return box_send (this, _data); }
unsigned give ( const void *_data ) { return box_give (this, _data); }
unsigned giveISR ( const void *_data ) { return box_giveISR (this, _data); }
void kill ( void ) { box_kill (this); }
unsigned waitUntil( void *_data, cnt_t _time ) { return box_waitUntil(this, _data, _time); }
unsigned waitFor ( void *_data, cnt_t _delay ) { return box_waitFor (this, _data, _delay); }
unsigned wait ( void *_data ) { return box_wait (this, _data); }
unsigned take ( void *_data ) { return box_take (this, _data); }
unsigned takeISR ( void *_data ) { return box_takeISR (this, _data); }
unsigned sendUntil( const void *_data, cnt_t _time ) { return box_sendUntil(this, _data, _time); }
unsigned sendFor ( const void *_data, cnt_t _delay ) { return box_sendFor (this, _data, _delay); }
unsigned send ( const void *_data ) { return box_send (this, _data); }
unsigned give ( const void *_data ) { return box_give (this, _data); }
unsigned giveISR ( const void *_data ) { return box_giveISR (this, _data); }
};

/******************************************************************************
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/os_cnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: os_cnd.h
@author Rajmund Szymanski
@date 10.12.2017
@date 01.01.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -236,7 +236,7 @@ void cnd_delete( cnd_t *cnd );
*
******************************************************************************/

unsigned cnd_waitUntil( cnd_t *cnd, mtx_t *mtx, uint32_t time );
unsigned cnd_waitUntil( cnd_t *cnd, mtx_t *mtx, cnt_t time );

/******************************************************************************
*
Expand All @@ -261,7 +261,7 @@ unsigned cnd_waitUntil( cnd_t *cnd, mtx_t *mtx, uint32_t time );
*
******************************************************************************/

unsigned cnd_waitFor( cnd_t *cnd, mtx_t *mtx, uint32_t delay );
unsigned cnd_waitFor( cnd_t *cnd, mtx_t *mtx, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -334,12 +334,12 @@ struct ConditionVariable : public __cnd
ConditionVariable( void ): __cnd _CND_INIT() {}
~ConditionVariable( void ) { assert(queue == nullptr); }

void kill ( void ) { cnd_kill (this); }
unsigned waitUntil( mtx_t *_mtx, uint32_t _time ) { return cnd_waitUntil(this, _mtx, _time); }
unsigned waitFor ( mtx_t *_mtx, uint32_t _delay ) { return cnd_waitFor (this, _mtx, _delay); }
unsigned wait ( mtx_t *_mtx ) { return cnd_wait (this, _mtx); }
void give ( bool _all = cndAll ) { cnd_give (this, _all); }
void giveISR ( bool _all = cndAll ) { cnd_giveISR (this, _all); }
void kill ( void ) { cnd_kill (this); }
unsigned waitUntil( mtx_t *_mtx, cnt_t _time ) { return cnd_waitUntil(this, _mtx, _time); }
unsigned waitFor ( mtx_t *_mtx, cnt_t _delay ) { return cnd_waitFor (this, _mtx, _delay); }
unsigned wait ( mtx_t *_mtx ) { return cnd_wait (this, _mtx); }
void give ( bool _all = cndAll ) { cnd_give (this, _all); }
void giveISR ( bool _all = cndAll ) { cnd_giveISR (this, _all); }
};

#endif
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/os_evt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: os_evt.h
@author Rajmund Szymanski
@date 10.12.2017
@date 01.01.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -227,7 +227,7 @@ void evt_delete( evt_t *evt );
*
******************************************************************************/

unsigned evt_waitUntil( evt_t *evt, uint32_t time );
unsigned evt_waitUntil( evt_t *evt, cnt_t time );

/******************************************************************************
*
Expand All @@ -250,7 +250,7 @@ unsigned evt_waitUntil( evt_t *evt, uint32_t time );
*
******************************************************************************/

unsigned evt_waitFor( evt_t *evt, uint32_t delay );
unsigned evt_waitFor( evt_t *evt, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -320,8 +320,8 @@ struct Event : public __evt
~Event( void ) { assert(queue == nullptr); }

void kill ( void ) { evt_kill (this); }
unsigned waitUntil( uint32_t _time ) { return evt_waitUntil(this, _time); }
unsigned waitFor ( uint32_t _delay ) { return evt_waitFor (this, _delay); }
unsigned waitUntil( cnt_t _time ) { return evt_waitUntil(this, _time); }
unsigned waitFor ( cnt_t _delay ) { return evt_waitFor (this, _delay); }
unsigned wait ( void ) { return evt_wait (this); }
void give ( unsigned _event ) { evt_give (this, _event); }
void giveISR ( unsigned _event ) { evt_giveISR (this, _event); }
Expand Down
26 changes: 13 additions & 13 deletions StateOS/kernel/inc/os_flg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: os_flg.h
@author Rajmund Szymanski
@date 10.12.2017
@date 01.01.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -248,7 +248,7 @@ void flg_delete( flg_t *flg );
*
******************************************************************************/

unsigned flg_waitUntil( flg_t *flg, unsigned flags, unsigned mode, uint32_t time );
unsigned flg_waitUntil( flg_t *flg, unsigned flags, unsigned mode, cnt_t time );

/******************************************************************************
*
Expand Down Expand Up @@ -278,7 +278,7 @@ unsigned flg_waitUntil( flg_t *flg, unsigned flags, unsigned mode, uint32_t time
*
******************************************************************************/

unsigned flg_waitFor( flg_t *flg, unsigned flags, unsigned mode, uint32_t delay );
unsigned flg_waitFor( flg_t *flg, unsigned flags, unsigned mode, cnt_t delay );

/******************************************************************************
*
Expand Down Expand Up @@ -407,16 +407,16 @@ struct Flag : public __flg
Flag( void ): __flg _FLG_INIT() {}
~Flag( void ) { assert(queue == nullptr); }

void kill ( void ) { flg_kill (this); }
unsigned waitUntil( unsigned _flags, unsigned _mode, uint32_t _time ) { return flg_waitUntil(this, _flags, _mode, _time); }
unsigned waitFor ( unsigned _flags, unsigned _mode, uint32_t _delay ) { return flg_waitFor (this, _flags, _mode, _delay); }
unsigned wait ( unsigned _flags, unsigned _mode = flgAll ) { return flg_wait (this, _flags, _mode); }
unsigned take ( unsigned _flags, unsigned _mode = flgAll ) { return flg_take (this, _flags, _mode); }
unsigned takeISR ( unsigned _flags, unsigned _mode = flgAll ) { return flg_takeISR (this, _flags, _mode); }
unsigned give ( unsigned _flags ) { return flg_give (this, _flags); }
unsigned giveISR ( unsigned _flags ) { return flg_giveISR (this, _flags); }
unsigned clear ( unsigned _flags ) { return flg_clear (this, _flags); }
unsigned clearISR ( unsigned _flags ) { return flg_clearISR (this, _flags); }
void kill ( void ) { flg_kill (this); }
unsigned waitUntil( unsigned _flags, unsigned _mode, cnt_t _time ) { return flg_waitUntil(this, _flags, _mode, _time); }
unsigned waitFor ( unsigned _flags, unsigned _mode, cnt_t _delay ) { return flg_waitFor (this, _flags, _mode, _delay); }
unsigned wait ( unsigned _flags, unsigned _mode = flgAll ) { return flg_wait (this, _flags, _mode); }
unsigned take ( unsigned _flags, unsigned _mode = flgAll ) { return flg_take (this, _flags, _mode); }
unsigned takeISR ( unsigned _flags, unsigned _mode = flgAll ) { return flg_takeISR (this, _flags, _mode); }
unsigned give ( unsigned _flags ) { return flg_give (this, _flags); }
unsigned giveISR ( unsigned _flags ) { return flg_giveISR (this, _flags); }
unsigned clear ( unsigned _flags ) { return flg_clear (this, _flags); }
unsigned clearISR ( unsigned _flags ) { return flg_clearISR (this, _flags); }
};

#endif
Expand Down
Loading

0 comments on commit 9cda71c

Please sign in to comment.