Skip to content

Commit

Permalink
updated static objects create definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajmund Szymanski committed Nov 19, 2018
1 parent 6d32bf6 commit bfa5f66
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 63 deletions.
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/oseventqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: oseventqueue.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -109,10 +109,10 @@ struct __evq
*
******************************************************************************/

#define OS_EVQ( evq, limit ) \
unsigned evq##__buf[limit]; \
evq_t evq##__evq = _EVQ_INIT( limit, evq##__buf ); \
evq_id evq = & evq##__evq
#define OS_EVQ( evq, limit ) \
struct { evq_t evq; unsigned buf[limit]; } evq##__wrk = \
{ _EVQ_INIT( limit, evq##__wrk.buf ), { 0 } }; \
evq_id evq = & evq##__wrk.evq

/******************************************************************************
*
Expand All @@ -126,10 +126,10 @@ struct __evq
*
******************************************************************************/

#define static_EVQ( evq, limit ) \
static unsigned evq##__buf[limit]; \
static evq_t evq##__evq = _EVQ_INIT( limit, evq##__buf ); \
static evq_id evq = & evq##__evq
#define static_EVQ( evq, limit ) \
static struct { evq_t evq; unsigned buf[limit]; } evq##__wrk = \
{ _EVQ_INIT( limit, evq##__wrk.buf ), { 0 } }; \
static evq_id evq = & evq##__wrk.evq

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/osjobqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osjobqueue.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -110,10 +110,10 @@ struct __job
*
******************************************************************************/

#define OS_JOB( job, limit ) \
fun_t *job##__buf[limit]; \
job_t job##__job = _JOB_INIT( limit, job##__buf ); \
job_id job = & job##__job
#define OS_JOB( job, limit ) \
struct { job_t job; fun_t *buf[limit]; } job##__wrk = \
{ _JOB_INIT( limit, job##__wrk.buf ), { 0 } }; \
job_id job = & job##__wrk.job

/******************************************************************************
*
Expand All @@ -127,10 +127,10 @@ struct __job
*
******************************************************************************/

#define static_JOB( job, limit ) \
static fun_t *job##__buf[limit]; \
static job_t job##__job = _JOB_INIT( limit, job##__buf ); \
static job_id job = & job##__job
#define static_JOB( job, limit ) \
static struct { job_t job; fun_t *buf[limit]; } job##__wrk = \
{ _JOB_INIT( limit, job##__wrk.buf ), { 0 } }; \
static job_id job = & job##__wrk.job

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/osmailboxqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osmailboxqueue.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -113,10 +113,10 @@ struct __box
*
******************************************************************************/

#define OS_BOX( box, limit, size ) \
char box##__buf[limit*size]; \
box_t box##__box = _BOX_INIT( limit, size, box##__buf ); \
box_id box = & box##__box
#define OS_BOX( box, limit, size ) \
struct { box_t box; char buf[limit * size]; } box##__wrk = \
{ _BOX_INIT( limit, size, box##__wrk.buf ), { 0 } }; \
box_id box = & box##__wrk.box

/******************************************************************************
*
Expand All @@ -131,10 +131,10 @@ struct __box
*
******************************************************************************/

#define static_BOX( box, limit, size ) \
static char box##__buf[limit*size]; \
static box_t box##__box = _BOX_INIT( limit, size, box##__buf ); \
static box_id box = & box##__box
#define static_BOX( box, limit, size ) \
static struct { box_t box; char buf[limit * size]; } box##__wrk = \
{ _BOX_INIT( limit, size, box##__wrk.buf ), { 0 } }; \
static box_id box = & box##__wrk.box

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/osmemorypool.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osmemorypool.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -115,10 +115,10 @@ struct __mem
*
******************************************************************************/

#define OS_MEM( mem, limit, size ) \
que_t mem##__buf[limit * (1 + MEM_SIZE(size))]; \
mem_t mem##__mem = _MEM_INIT( limit, MEM_SIZE(size), mem##__buf ); \
mem_id mem = & mem##__mem
#define OS_MEM( mem, limit, size ) \
struct { mem_t mem; que_t buf[limit * (1 + MEM_SIZE(size))]; } mem##__wrk = \
{ _MEM_INIT( limit, MEM_SIZE(size), mem##__wrk.buf ), { { 0 } } }; \
mem_id mem = & mem##__wrk.mem

/******************************************************************************
*
Expand All @@ -133,10 +133,10 @@ struct __mem
*
******************************************************************************/

#define static_MEM( mem, limit, size ) \
static que_t mem##__buf[limit * (1 + MEM_SIZE(size))]; \
static mem_t mem##__mem = _MEM_INIT( limit, MEM_SIZE(size), mem##__buf ); \
static mem_id mem = & mem##__mem
#define static_MEM( mem, limit, size ) \
static struct { mem_t mem; que_t buf[limit * (1 + MEM_SIZE(size))]; } mem##__wrk = \
{ _MEM_INIT( limit, MEM_SIZE(size), mem##__wrk.buf ), { { 0 } } }; \
static mem_id mem = & mem##__wrk.mem

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/osmessagebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osmessagebuffer.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -122,10 +122,10 @@ struct __msg
*
******************************************************************************/

#define OS_MSG( msg, limit, ... ) \
char msg##__buf[_VA_MSG(limit, __VA_ARGS__)]; \
msg_t msg##__msg = _MSG_INIT( _VA_MSG(limit, __VA_ARGS__), msg##__buf ); \
msg_id msg = & msg##__msg
#define OS_MSG( msg, limit, ... ) \
struct { msg_t msg; char buf[_VA_MSG(limit, __VA_ARGS__)]; } msg##__wrk = \
{ _MSG_INIT( _VA_MSG(limit, __VA_ARGS__), msg##__wrk.buf ), { 0 } }; \
msg_id msg = & msg##__wrk.msg

/******************************************************************************
*
Expand All @@ -140,10 +140,10 @@ struct __msg
*
******************************************************************************/

#define static_MSG( msg, limit, ... ) \
static char msg##__buf[_VA_MSG(limit, __VA_ARGS__)]; \
static msg_t msg##__msg = _MSG_INIT( _VA_MSG(limit, __VA_ARGS__), msg##__buf ); \
static msg_id msg = & msg##__msg
#define static_MSG( msg, limit, ... ) \
static struct { msg_t msg; char buf[_VA_MSG(limit, __VA_ARGS__)]; } msg##__wrk = \
{ _MSG_INIT( _VA_MSG(limit, __VA_ARGS__), msg##__wrk.buf ), { 0 } }; \
static msg_id msg = & msg##__wrk.msg

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/osstreambuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osstreambuffer.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -122,10 +122,10 @@ struct __stm
*
******************************************************************************/

#define OS_STM( stm, limit, ... ) \
char stm##__buf[_VA_STM(limit, __VA_ARGS__)]; \
stm_t stm##__stm = _STM_INIT( _VA_STM(limit, __VA_ARGS__), stm##__buf ); \
stm_id stm = & stm##__stm
#define OS_STM( stm, limit, ... ) \
struct { stm_t stm; char buf[_VA_STM(limit, __VA_ARGS__)]; } stm##__wrk = \
{ _STM_INIT( _VA_STM(limit, __VA_ARGS__), stm##__wrk.buf ), { 0 } }; \
stm_id stm = & stm##__wrk.stm

/******************************************************************************
*
Expand All @@ -140,10 +140,10 @@ struct __stm
*
******************************************************************************/

#define static_STM( stm, limit, ... ) \
static char stm##__buf[_VA_STM(limit, __VA_ARGS__)]; \
static stm_t stm##__stm = _STM_INIT( _VA_STM(limit, __VA_ARGS__), stm##__buf ); \
static stm_id stm = & stm##__stm
#define static_STM( stm, limit, ... ) \
static struct { stm_t stm; char buf[_VA_STM(limit, __VA_ARGS__)]; } stm##__wrk = \
{ _STM_INIT( _VA_STM(limit, __VA_ARGS__), stm##__wrk.buf ), { 0 } }; \
static stm_id stm = & stm##__wrk.stm

/******************************************************************************
*
Expand Down
18 changes: 9 additions & 9 deletions StateOS/kernel/inc/ostask.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: ostask.h
@author Rajmund Szymanski
@date 17.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -275,10 +275,10 @@ struct __tsk
*
******************************************************************************/

#define OS_WRK( tsk, prio, state, size ) \
stk_t tsk##__stk[STK_SIZE( size )]; \
tsk_t tsk##__tsk = _TSK_INIT( prio, state, tsk##__stk, size ); \
tsk_id tsk = & tsk##__tsk
#define OS_WRK( tsk, prio, state, size ) \
struct { tsk_t tsk; stk_t buf[STK_SIZE( size )]; } tsk##__wrk = \
{ _TSK_INIT( prio, state, tsk##__wrk.buf, size ), { 0 } }; \
tsk_id tsk = & tsk##__wrk.tsk

/******************************************************************************
*
Expand Down Expand Up @@ -390,10 +390,10 @@ struct __tsk
*
******************************************************************************/

#define static_WRK( tsk, prio, state, size ) \
static stk_t tsk##__stk[STK_SIZE( size )]; \
static tsk_t tsk##__tsk = _TSK_INIT( prio, state, tsk##__stk, size ); \
static tsk_id tsk = & tsk##__tsk
#define static_WRK( tsk, prio, state, size ) \
static struct { tsk_t tsk; stk_t buf[STK_SIZE( size )]; } tsk##__wrk = \
{ _TSK_INIT( prio, state, tsk##__wrk.buf, size ), { 0 } }; \
static tsk_id tsk = & tsk##__wrk.tsk

/******************************************************************************
*
Expand Down

0 comments on commit bfa5f66

Please sign in to comment.