TIMER: Reorganize timer control variables to use a structure for each timer
The original approach had separate parallel arrays for each relevant state variable for each calibrated timer. That worked when there were only a few state variables, the state info for a timer belongs in a structure.
This commit is contained in:
parent
da3f851d70
commit
7bcf407fcc
2 changed files with 486 additions and 406 deletions
|
@ -1174,14 +1174,11 @@ extern int32 sim_asynch_inst_latency;
|
||||||
#define AIO_QUEUE_MODE "Lock free asynchronous event queue"
|
#define AIO_QUEUE_MODE "Lock free asynchronous event queue"
|
||||||
#define AIO_INIT \
|
#define AIO_INIT \
|
||||||
do { \
|
do { \
|
||||||
int tmr; \
|
|
||||||
sim_asynch_main_threadid = pthread_self(); \
|
sim_asynch_main_threadid = pthread_self(); \
|
||||||
/* Empty list/list end uses the point value (void *)1. \
|
/* Empty list/list end uses the point value (void *)1. \
|
||||||
This allows NULL in an entry's a_next pointer to \
|
This allows NULL in an entry's a_next pointer to \
|
||||||
indicate that the entry is not currently in any list */ \
|
indicate that the entry is not currently in any list */ \
|
||||||
sim_asynch_queue = QUEUE_LIST_END; \
|
sim_asynch_queue = QUEUE_LIST_END; \
|
||||||
for (tmr=0; tmr<SIM_NTIMERS; tmr++) \
|
|
||||||
sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
#define AIO_CLEANUP \
|
#define AIO_CLEANUP \
|
||||||
do { \
|
do { \
|
||||||
|
@ -1217,7 +1214,6 @@ extern int32 sim_asynch_inst_latency;
|
||||||
#define AIO_QUEUE_MODE "Lock based asynchronous event queue"
|
#define AIO_QUEUE_MODE "Lock based asynchronous event queue"
|
||||||
#define AIO_INIT \
|
#define AIO_INIT \
|
||||||
do { \
|
do { \
|
||||||
int tmr; \
|
|
||||||
pthread_mutexattr_t attr; \
|
pthread_mutexattr_t attr; \
|
||||||
\
|
\
|
||||||
pthread_mutexattr_init (&attr); \
|
pthread_mutexattr_init (&attr); \
|
||||||
|
@ -1229,8 +1225,6 @@ extern int32 sim_asynch_inst_latency;
|
||||||
This allows NULL in an entry's a_next pointer to \
|
This allows NULL in an entry's a_next pointer to \
|
||||||
indicate that the entry is not currently in any list */ \
|
indicate that the entry is not currently in any list */ \
|
||||||
sim_asynch_queue = QUEUE_LIST_END; \
|
sim_asynch_queue = QUEUE_LIST_END; \
|
||||||
for (tmr=0; tmr<SIM_NTIMERS; tmr++) \
|
|
||||||
sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
#define AIO_CLEANUP \
|
#define AIO_CLEANUP \
|
||||||
do { \
|
do { \
|
||||||
|
|
886
sim_timer.c
886
sim_timer.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue