31 #include "osapi/osapi_dll.h"
33 #ifndef osapi_thread_h
39 #ifndef osapi_system_h
52 #ifndef RTI_MODULE_NAME
53 #define RTI_MODULE_NAME "undefined"
56 #define OSAPI_LOG_MSG_PN_X2_STD_PARAM RTI_MODULE_NAME,\
57 __FILE__,__FUNCTION__, __LINE__
60 #define OSAPI_LOG_ENTRY_CREATE(kind_,error_code_,p_,is_finale_)\
61 OSAPI_Log_entry_create(kind_,error_code_,p_,is_finale_);
63 #define OSAPI_LOG_ENTRY_ADD(kind_,error_code_,p_)\
64 OSAPI_Log_entry_add(kind_,error_code_,p_);
66 #define OSAPI_LOG_ENTRY_ADD_INT(name_,value_,is_final_)\
67 OSAPI_Log_entry_add_int(name_,value_,is_final_);
69 #define OSAPI_LOG_ENTRY_ADD_STRING(name_,value_,is_final_)\
70 OSAPI_Log_entry_add_string(name_,value_,is_final_);
72 #define OSAPI_LOG_ENTRY_ADD_POINTER(name_,value_,is_final_)\
73 OSAPI_Log_entry_add_pointer(name_,value_,is_final_);\
75 #define OSAPI_LOG_ENTRY_ADD_1STRING_1INT(kind_,error_code_,p_,s_name_,s_value_,i_name_,i_value_)\
76 OSAPI_Log_entry_add_1string_1int(kind_,error_code_,p_,s_name_,s_value_,i_name_,i_value_);
78 #define OSAPI_LOG_ENTRY_ADD_1POINTER(kind_,error_code_,p_,name_,value_)\
79 OSAPI_Log_entry_add_1pointer(kind_,error_code_,p_,name_,value_);
81 #define OSAPI_LOG_ENTRY_ADD_1STRING(kind_,error_code_,p_,name_,value_)\
82 OSAPI_Log_entry_add_1string(kind_,error_code_,p_,name_,value_);
84 #define OSAPI_LOG_ENTRY_ADD_2STRING(kind_,error_code_,p_,name1_,value1_,name2_,value2_)\
85 OSAPI_Log_entry_add_2string(kind_,error_code_,p_,name1_,value1_,name2_,value2_);
87 #define OSAPI_LOG_ENTRY_ADD_1INT(kind_,error_code_,p_,name1_,value1_)\
88 OSAPI_Log_entry_add_1int(kind_,error_code_,p_,name1_,value1_);
90 #define OSAPI_LOG_ENTRY_ADD_2INT(kind_,error_code_,p_,name1_,value1_,name2_,value2_)\
91 OSAPI_Log_entry_add_2int(kind_,error_code_,p_,name1_,value1_,name2_,value2_);
93 #define OSAPI_LOG_ENTRY_ADD_3INT(kind_,error_code_,p_,name1_,value1_,name2_,value2_,name3_,value3_)\
94 OSAPI_Log_entry_add_3int(kind_,error_code_,p_,name1_,value1_,name2_,value2_,name3_,value3_);
96 #define OSAPI_LOG_ENTRY_CREATE(kind_,error_code_,p_,is_finale_)
97 #define OSAPI_LOG_ENTRY_ADD_INT(name_,value_,is_final_)
98 #define OSAPI_LOG_ENTRY_ADD_STRING(name_,value_,is_final_)
99 #define OSAPI_LOG_ENTRY_ADD_POINTER(name_,value_,is_final_)
100 #define OSAPI_LOG_ENTRY_ADD_1STRING_1INT(kind_,error_code_,p_,s_name_,s_value_,i_name_,i_value_)
101 #define OSAPI_LOG_ENTRY_ADD_1POINTER(kind_,error_code_,p_,name_,value_)
102 #define OSAPI_LOG_ENTRY_ADD_1STRING(kind_,error_code_,p_,name_,value_)
103 #define OSAPI_LOG_ENTRY_ADD_2STRING(kind_,error_code_,p_,name1_,value1_,name2_,value2_)
104 #define OSAPI_LOG_ENTRY_ADD_1INT(kind_,error_code_,p_,name1_,value1_)
105 #define OSAPI_LOG_ENTRY_ADD_2INT(kind_,error_code_,p_,name1_,value1_,name2_,value2_)
106 #define OSAPI_LOG_ENTRY_ADD_3INT(kind_,error_code_,p_,name1_,value1_,name2_,value2_,name3_,value3_)
107 #define OSAPI_LOG_ENTRY_ADD(kind_,error_code_,p_)
136 #define OSAPI_LOG_BASE (0)
141 #define REDA_LOG_BASE (1 << 16)
146 #define DB_LOG_BASE (2 << 16)
151 #define RT_LOG_BASE (3 << 16)
156 #define NETIO_LOG_BASE (4 << 16)
161 #define UDP_LOG_BASE NETIO_LOG_BASE
166 #define CDR_LOG_BASE (5 << 16)
171 #define RTPS_LOG_BASE (6 << 16)
176 #define DDSC_LOG_BASE (7 << 16)
181 #define RHSM_LOG_BASE (8 << 16)
186 #define WHSM_LOG_BASE (9 << 16)
191 #define DPSE_LOG_BASE (10 << 16)
196 #define DPDE_LOG_BASE (11 << 16)
202 #define OSAPI_LOG_GET_NEXT_OBJECT_ID_EC (OSAPI_LOG_BASE + 1)
203 #define OSAPI_LOG_GET_NEXT_OBJECT_ID(level_) \
204 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_GET_NEXT_OBJECT_ID_EC ,\
205 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
213 #define OSAPI_LOG_SYSTEM_SET_PROPERTY_EC (OSAPI_LOG_BASE + 2)
214 #define OSAPI_LOG_SYSTEM_SET_PROPERTY(level_) \
215 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_SYSTEM_SET_PROPERTY_EC,\
216 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
222 #define OSAPI_LOG_SYSTEM_TIMER_START_EC (OSAPI_LOG_BASE + 4)
223 #define OSAPI_LOG_SYSTEM_TIMER_START(level_) \
224 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_SYSTEM_TIMER_START_EC,\
225 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
231 #define OSAPI_LOG_SYSTEM_TIMER_STOP_EC (OSAPI_LOG_BASE + 5)
232 #define OSAPI_LOG_SYSTEM_TIMER_STOP(level_) \
233 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_SYSTEM_TIMER_STOP_EC,\
234 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
241 #define OSAPI_LOG_THREAD_NEW_EC (OSAPI_LOG_BASE + 6)
242 #define OSAPI_LOG_THREAD_NEW(level_) \
243 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_THREAD_NEW_EC,\
244 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
250 #define OSAPI_LOG_THREAD_CREATE_EC (OSAPI_LOG_BASE + 7)
251 #define OSAPI_LOG_THREAD_CREATE(level_) \
252 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_THREAD_CREATE_EC,\
253 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
259 #define OSAPI_LOG_THREAD_SEM_EC (OSAPI_LOG_BASE + 8)
260 #define OSAPI_LOG_THREAD_SEM(level_,cs_,ss_) \
261 OSAPI_LOG_ENTRY_CREATE((level_),OSAPI_LOG_THREAD_SEM_EC,\
262 OSAPI_LOG_MSG_PN_X2_STD_PARAM,RTI_FALSE)\
263 OSAPI_LOG_ENTRY_ADD_POINTER("cs",(cs_),RTI_FALSE)\
264 OSAPI_LOG_ENTRY_ADD_POINTER("ss",(ss_),RTI_TRUE)
270 #define OSAPI_LOG_THREAD_EXEC_CREATE_EC (OSAPI_LOG_BASE + 9)
271 #define OSAPI_LOG_THREAD_EXEC_CREATE(level_) \
272 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_THREAD_EXEC_CREATE_EC,\
273 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
279 #define OSAPI_LOG_THREAD_EXEC_START_EC (OSAPI_LOG_BASE + 10)
280 #define OSAPI_LOG_THREAD_EXEC_START(level_,ss_) \
281 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_THREAD_EXEC_START_EC,\
282 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"ss",(ss_))
288 #define OSAPI_LOG_THREAD_START_EC (OSAPI_LOG_BASE + 11)
289 #define OSAPI_LOG_THREAD_START(level_,ss_) \
290 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_THREAD_START_EC,\
291 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"ss",(ss_))
297 #define OSAPI_LOG_THREAD_DESTROY_EC (OSAPI_LOG_BASE + 12)
298 #define OSAPI_LOG_THREAD_DESTROY(level_,ss_) \
299 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_THREAD_DESTROY_EC,\
300 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"ss",(ss_))
306 #define OSAPI_LOG_THREAD_DESTROY_NO_START_EC (OSAPI_LOG_BASE + 13)
307 #define OSAPI_LOG_THREAD_DESTROY_NO_START(level_,ss_) \
308 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_THREAD_DESTROY_NO_START_EC,\
309 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"ss",(ss_))
315 #define OSAPI_LOG_THREAD_DESTROY_NO_WAKEUP_EC (OSAPI_LOG_BASE + 14)
316 #define OSAPI_LOG_THREAD_DESTROY_NO_WAKEUP(level_,ss_) \
317 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_THREAD_DESTROY_NO_WAKEUP_EC,\
318 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"ss",(ss_))
324 #define OSAPI_LOG_THREAD_INIT_EC (OSAPI_LOG_BASE + 15)
325 #define OSAPI_LOG_THREAD_INIT(level_,sysrc_) \
326 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_THREAD_INIT_EC,\
327 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
334 #define OSAPI_LOG_THREAD_SCHEDPARAM_EC (OSAPI_LOG_BASE + 16)
335 #define OSAPI_LOG_THREAD_SCHEDPARAM(level_,sysrc_,prio_) \
336 OSAPI_LOG_ENTRY_ADD_2INT((level_),OSAPI_LOG_THREAD_SCHEDPARAM_EC ,\
337 OSAPI_LOG_MSG_PN_X2_STD_PARAM,\
338 "sysrc",(sysrc_),"prio",(prio_))
344 #define OSAPI_LOG_THREAD_GET_POLICY_EC (OSAPI_LOG_BASE + 17)
345 #define OSAPI_LOG_THREAD_GET_POLICY(level_,sysrc_) \
346 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_THREAD_GET_POLICY_EC,\
347 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
354 #define OSAPI_LOG_THREAD_POLICY_DIFFER_EC (OSAPI_LOG_BASE + 18)
355 #define OSAPI_LOG_THREAD_POLICY_DIFFER(level_,get_policy_,set_policy_) \
356 OSAPI_LOG_ENTRY_ADD_2INT((level_),OSAPI_LOG_THREAD_POLICY_DIFFER_EC,\
357 OSAPI_LOG_MSG_PN_X2_STD_PARAM,\
358 "get_policy",(get_policy_),"set_policy",(set_policy_))
364 #define OSAPI_LOG_THREAD_PRIORITY_MAP_EC (OSAPI_LOG_BASE + 19)
365 #define OSAPI_LOG_THREAD_PRIORITY_MAP(level_,min_,max_) \
366 OSAPI_LOG_ENTRY_ADD_2INT((level_),OSAPI_LOG_THREAD_PRIORITY_MAP_EC,\
367 OSAPI_LOG_MSG_PN_X2_STD_PARAM,\
368 "min",(min_),"max",(max_))
376 #define OSAPI_LOG_TIMER_DELETE_EC (OSAPI_LOG_BASE + 20)
377 #define OSAPI_LOG_TIMER_DELETE(level_) \
378 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_TIMER_DELETE_EC,\
379 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
381 #define OSAPI_LOG_TIMER_TICK_EC (OSAPI_LOG_BASE + 21)
387 #define OSAPI_LOG_TIMER_TICK_MUTEX_EC (OSAPI_LOG_BASE + 22)
388 #define OSAPI_LOG_TIMER_TICK_MUTEX(level_,mutex_,take_) \
389 OSAPI_LOG_ENTRY_CREATE((level_),OSAPI_LOG_TIMER_TICK_MUTEX_EC,\
390 OSAPI_LOG_MSG_PN_X2_STD_PARAM,RTI_FALSE)\
391 OSAPI_LOG_ENTRY_ADD_POINTER("mutex",(mutex_),RTI_FALSE)\
392 OSAPI_LOG_ENTRY_ADD_INT("take",(take_),RTI_TRUE)
394 #define OSAPI_LOG_TIMER_CREATE_TIMEOUT_EC (OSAPI_LOG_BASE + 23)
396 #define OSAPI_LOG_TIMER_UPDATE_TIMEOUT_EC (OSAPI_LOG_BASE + 24)
398 #define OSAPI_LOG_TIMER_DELETE_TIMEOUT_EC (OSAPI_LOG_BASE + 25)
405 #define OSAPI_LOG_TIMER_GET_USER_DATA_EPOCH_EC (OSAPI_LOG_BASE + 27)
406 #define OSAPI_LOG_TIMER_GET_USER_DATA_EPOCH(level_,h_,e_,e1_,e2_) \
407 OSAPI_LOG_ENTRY_CREATE( (level_),OSAPI_LOG_TIMER_GET_USER_DATA_EPOCH_EC,\
408 OSAPI_LOG_MSG_PN_X2_STD_PARAM,RTI_FALSE)\
409 OSAPI_LOG_ENTRY_ADD_POINTER("h",(h_),RTI_FALSE)\
410 OSAPI_LOG_ENTRY_ADD_POINTER("e",(e_),RTI_FALSE)\
411 OSAPI_LOG_ENTRY_ADD_INT("e1",(e1_),RTI_FALSE)\
412 OSAPI_LOG_ENTRY_ADD_INT("e2",(e2_),RTI_TRUE)
417 #define OSAPI_LOG_TIMER_NEW_EC (OSAPI_LOG_BASE + 28)
418 #define OSAPI_LOG_TIMER_NEW(level_) \
419 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_TIMER_NEW_EC,\
420 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
426 #define OSAPI_LOG_TIMER_NEW_ENTRY_EC (OSAPI_LOG_BASE + 29)
427 #define OSAPI_LOG_TIMER_NEW_ENTRY(level_) \
428 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_TIMER_NEW_ENTRY_EC,\
429 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
435 #define OSAPI_LOG_TIMER_NEW_WHEEL_EC (OSAPI_LOG_BASE + 30)
436 #define OSAPI_LOG_TIMER_NEW_WHEEL(level_,slots_) \
437 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_TIMER_NEW_WHEEL_EC,\
438 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"slots",(slots_))
444 #define OSAPI_LOG_TIMER_NEW_MUTEX_EC (OSAPI_LOG_BASE + 31)
445 #define OSAPI_LOG_TIMER_NEW_MUTEX(level_) \
446 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_TIMER_NEW_MUTEX_EC,\
447 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
453 #define OSAPI_LOG_TIMER_NEW_START_TIMER_EC (OSAPI_LOG_BASE + 32)
454 #define OSAPI_LOG_TIMER_NEW_START_TIMER(level_,timer_,ticr_) \
455 OSAPI_LOG_ENTRY_CREATE((level_),OSAPI_LOG_TIMER_NEW_START_TIMER_EC,\
456 OSAPI_LOG_MSG_PN_X2_STD_PARAM,RTI_FALSE)\
457 OSAPI_LOG_ENTRY_ADD_POINTER("timer",(timer_),RTI_FALSE)\
458 OSAPI_LOG_ENTRY_ADD_POINTER("ticr",(ticr_),RTI_TRUE)
464 #define OSAPI_LOG_TIMER_DELETE_STOP_TIMER_EC (OSAPI_LOG_BASE + 33)
465 #define OSAPI_LOG_TIMER_DELETE_STOP_TIMER(level_,timer_) \
466 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_TIMER_DELETE_STOP_TIMER_EC,\
467 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"timer",(timer_))
473 #define OSAPI_LOG_TIMER_DELETE_MUTEX_EC (OSAPI_LOG_BASE + 34)
474 #define OSAPI_LOG_TIMER_DELETE_MUTEX(level_,timer_) \
475 OSAPI_LOG_ENTRY_ADD_1POINTER((level_),OSAPI_LOG_TIMER_DELETE_MUTEX_EC,\
476 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"timer",(timer_))
482 #define OSAPI_LOG_TIMER_MUTEX_EC (OSAPI_LOG_BASE + 35)
483 #define OSAPI_LOG_TIMER_MUTEX(level_,mutex_,take_) \
484 OSAPI_LOG_ENTRY_CREATE((level_),OSAPI_LOG_TIMER_MUTEX_EC,OSAPI_LOG_MSG_PN_X2_STD_PARAM,RTI_FALSE)\
485 OSAPI_LOG_ENTRY_ADD_POINTER("mutex",(mutex_),RTI_FALSE)\
486 OSAPI_LOG_ENTRY_ADD_INT("take",(take_),RTI_TRUE)
494 #define OSAPI_LOG_SEMAPHORE_DELETE_EC (OSAPI_LOG_BASE + 36)
495 #define OSAPI_LOG_SEMAPHORE_DELETE(level_,sysrc_) \
496 OSAPI_LOG_ENTRY_ADD_1INT( (level_),OSAPI_LOG_SEMAPHORE_DELETE_EC,\
497 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
503 #define OSAPI_LOG_SEMAPHORE_NEW_EC (OSAPI_LOG_BASE + 37)
504 #define OSAPI_LOG_SEMAPHORE_NEW(level_) \
505 OSAPI_LOG_ENTRY_ADD( (level_),OSAPI_LOG_SEMAPHORE_NEW_EC,\
506 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
512 #define OSAPI_LOG_SEMAPHORE_NEW_INIT_EC (OSAPI_LOG_BASE + 38)
513 #define OSAPI_LOG_SEMAPHORE_NEW_INIT(level_,sysrc_) \
514 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_SEMAPHORE_NEW_INIT_EC,\
515 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
521 #define OSAPI_LOG_SEMAPHORE_GIVE_EC (OSAPI_LOG_BASE + 39)
522 #define OSAPI_LOG_SEMAPHORE_GIVE(level_,sysrc_) \
523 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_SEMAPHORE_GIVE_EC,\
524 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
530 #define OSAPI_LOG_SEMAPHORE_TAKE_EC (OSAPI_LOG_BASE + 40)
531 #define OSAPI_LOG_SEMAPHORE_TAKE(level_,sysrc_) \
532 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_SEMAPHORE_TAKE_EC,\
533 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
541 #define OSAPI_LOG_MUTEX_DELETE_EC (OSAPI_LOG_BASE + 41)
542 #define OSAPI_LOG_MUTEX_DELETE(level_,sysrc_) \
543 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_MUTEX_DELETE_EC,\
544 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
550 #define OSAPI_LOG_MUTEX_NEW_EC (OSAPI_LOG_BASE + 42)
551 #define OSAPI_LOG_MUTEX_NEW(level_) \
552 OSAPI_LOG_ENTRY_ADD((level_),OSAPI_LOG_MUTEX_NEW_EC,\
553 OSAPI_LOG_MSG_PN_X2_STD_PARAM)
559 #define OSAPI_LOG_MUTEX_TAKE_EC (OSAPI_LOG_BASE + 43)
560 #define OSAPI_LOG_MUTEX_TAKE(level_,sysrc_) \
561 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_MUTEX_TAKE_EC,\
562 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
568 #define OSAPI_LOG_MUTEX_GIVE_EC (OSAPI_LOG_BASE + 44)
569 #define OSAPI_LOG_MUTEX_GIVE(level_,sysrc_) \
570 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_MUTEX_GIVE_EC,\
571 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
577 #define OSAPI_LOG_MUTEX_INIT_EC (OSAPI_LOG_BASE + 45)
578 #define OSAPI_LOG_MUTEX_INIT(level_,sysrc_) \
579 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_MUTEX_INIT_EC,\
580 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
588 #define OSAPI_LOG_HEAP_INTERNAL_ALLOCATE_EC (OSAPI_LOG_BASE + 46)
589 #define OSAPI_LOG_HEAP_INTERNAL_ALLOCATE(level_,s_,a_) \
590 OSAPI_LOG_ENTRY_ADD_2INT((level_),OSAPI_LOG_HEAP_INTERNAL_ALLOCATE_EC,\
591 OSAPI_LOG_MSG_PN_X2_STD_PARAM,\
594 #define OSAPI_LOG_HEAP_FREE_EC (OSAPI_LOG_BASE + 47)
600 #define OSAPI_LOG_SYSTEM_GET_TIME_EC (OSAPI_LOG_BASE + 48)
601 #define OSAPI_LOG_SYSTEM_GET_TIME(level_,sysrc_) \
602 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_SYSTEM_GET_TIME_EC,\
603 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"sysrc",(sysrc_))
615 #define OSAPI_LOG_LAST_RECORDED_ERROR_EC (OSAPI_LOG_BASE + 49)
616 #define OSAPI_LOG_LAST_RECORDED_ERROR(level_) \
617 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_LAST_RECORDED_ERROR_EC,\
618 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"rc",OSAPI_Log_get_last_error_code())
629 #define OSAPI_LOG_SET_THREAD_NAME_EC (OSAPI_LOG_BASE + 50)
630 #define OSAPI_LOG_SET_THREAD_NAME(level_,rc_) \
631 OSAPI_LOG_ENTRY_ADD_1INT((level_),OSAPI_LOG_SET_THREAD_NAME_EC,\
632 OSAPI_LOG_MSG_PN_X2_STD_PARAM,"rc",(rc_))
646 OSAPI_LOGKIND_ERROR = 0,
647 OSAPI_LOGKIND_WARNING,
649 OSAPI_LOGKIND_PRECONDITION
652 typedef RTI_UINT32 OSAPI_LogEntryHeader_T;
653 typedef RTI_UINT32 OSAPI_LogEntryPayloadElement_T;
660 #define OSAPI_LOG_HEADER_GET_X(hdr_) ((hdr_)>>31)
661 #define OSAPI_LOG_HEADER_GET_E(hdr_) ((hdr_)>>30 & 0x1)
662 #define OSAPI_LOG_HEADER_GET_T(hdr_) ((hdr_)>>29 & 0x1)
663 #define OSAPI_LOG_HEADER_GET_TYPE(hdr_) (((hdr_) >>27) & 0x3)
664 #define OSAPI_LOG_HEADER_GET_MODULE(hdr_) (((hdr_) >>16) & 0x7ff)
665 #define OSAPI_LOG_HEADER_GET_EC(hdr_) ((hdr_) & 0x7fff)
666 #define OSAPI_LOG_HEADER_GET_F(hdr_) ((hdr_)>>15 & 0x1)
668 #define OSAPI_LOG_HEADER_SET_X(hdr_) ((hdr_) |= 0x80000000)
669 #define OSAPI_LOG_HEADER_CLR_X(hdr_) ((hdr_) &= ~0x80000000)
670 #define OSAPI_LOG_HEADER_SET_E(hdr_) ((hdr_) |= 0x40000000)
671 #define OSAPI_LOG_HEADER_SET_T(hdr_) ((hdr_) |= 0x20000000)
672 #define OSAPI_LOG_HEADER_CLR_T(hdr_) ((hdr_) &= ~0x20000000)
673 #define OSAPI_LOG_HEADER_SET_TYPE(hdr_,type_) ((hdr_) |= ((type_) << 27))
674 #define OSAPI_LOG_HEADER_SET_MODULE(hdr_,m_) ((hdr_) |= ((m_) << 16))
675 #define OSAPI_LOG_HEADER_SET_EC(hdr_,ec) ((hdr_) |= (ec_))
676 #define OSAPI_LOG_HEADER_SET_F(hdr_) ((hdr_) |= 0x8000)
677 #define OSAPI_LOG_HEADER_CLR_F(hdr_) ((hdr_) &= ~0x8000)
679 #define OSAPI_LOG_STATUS_MN (0x80000000)
680 #define OSAPI_LOG_STATUS_SF (0x40000000)
681 #define OSAPI_LOG_STATUS_FN (0x20000000)
682 #define OSAPI_LOG_STATUS_LN (0x10000000)
683 #define OSAPI_LOG_STATUS_F (0x08000000)
685 #define OSAPI_LOG_STATUS_ALL \
686 (OSAPI_LOG_STATUS_MN | \
687 OSAPI_LOG_STATUS_SF | \
688 OSAPI_LOG_STATUS_FN | \
691 #define OSAPI_LOG_STATUS_NO_DATA \
692 (OSAPI_LOG_STATUS_MN | \
693 OSAPI_LOG_STATUS_SF | \
694 OSAPI_LOG_STATUS_FN | \
699 OSAPI_LOGTYPE_INTEGER,
700 OSAPI_LOGTYPE_STRING,
701 OSAPI_LOGTYPE_POINTER
704 typedef struct OSAPI_LogDataEntry
706 OSAPI_LogType_T type;
714 } OSAPI_LogDataEntry_T;
716 #define OSAPI_LOGDATA_SET_F(hdr_) ((hdr_) |= 0x80000000)
717 #define OSAPI_LOGDATA_GET_F(hdr_) ((hdr_)>>31 & 0x1)
718 #define OSAPI_LOGDATA_SET_TYPE(hdr_,type_) ((hdr_) |= ((type_)<<27))
719 #define OSAPI_LOGDATA_GET_TYPE(hdr_) (((hdr_)>>27) & 0xf)
721 #if OSAPI_ENABLE_TRACE
724 OSAPI_TRACETYPE_HEADER,
725 OSAPI_TRACETYPE_INT32,
726 OSAPI_TRACETYPE_STRING,
727 OSAPI_TRACETYPE_GUID,
728 OSAPI_TRACETYPE_V4_AS_INT32,
729 OSAPI_TRACETYPE_V12_AS_INT32
765 typedef struct OSAPI_LogEntry
775 RTI_UINT32 error_code;
841 #define OSAPI_LOG_DETAIL_MODULENAME (0x80000000UL)
842 #define OSAPI_LOG_DETAIL_SOURCEFILE (0x40000000UL)
843 #define OSAPI_LOG_DETAIL_LINENUMBER (0x20000000UL)
844 #define OSAPI_LOG_DETAIL_FUNCTIONAME (0x10000000UL)
845 #define OSAPI_LOG_DETAIL_FORMAT (0x08000000UL)
846 #define OSAPI_LOG_DETAIL_DATA_ONLY (0x04000000UL)
848 #define OSAPI_LOG_DETAIL_ALL \
849 (OSAPI_LOG_DETAIL_MODULENAME | \
850 OSAPI_LOG_DETAIL_SOURCEFILE | \
851 OSAPI_LOG_DETAIL_LINENUMBER | \
852 OSAPI_LOG_DETAIL_FUNCTIONAME | \
853 OSAPI_LOG_DETAIL_FORMAT | \
854 OSAPI_LOG_DETAIL_DATA_ONLY)
856 #define OSAPI_LOG_DETAIL_NO_DATA \
857 (OSAPI_LOG_DETAIL_MODULENAME | \
858 OSAPI_LOG_DETAIL_SOURCEFILE | \
859 OSAPI_LOG_DETAIL_LINENUMBER | \
860 OSAPI_LOG_DETAIL_FUNCTIONAME )
862 #if OSAPI_ENABLE_PRECONDITION
863 #define OSAPI_LOG_BUFFER_SIZE (16384)
865 #define OSAPI_LOG_BUFFER_SIZE (128)
868 #define OSAPI_LogProperty_INIITALIZER \
870 OSAPI_LOG_BUFFER_SIZE,\
871 OSAPI_LOG_DETAIL_ALL,\
875 #if OSAPI_ENABLE_TRACE
877 (*OSAPI_TraceHandler_T)(RTI_UINT32 trace_mask,
880 const char *
const module,
881 const char *
const file,
882 const char *
const function,
884 OSAPI_TraceType_T type,
887 const void *ptr_value,
888 const char *str_value,
891 OSAPIDllVariable
extern OSAPI_TraceHandler_T OSAPI_gv_TraceFunction;
892 OSAPIDllVariable
extern void* OSAPI_gv_TraceFunctionParam;
893 OSAPIDllVariable
extern RTI_UINT32 OSAPI_gv_TraceMask;
924 (*OSAPI_LogDisplay_T)(
void *param,OSAPI_LogEntry_T *msg);
927 OSAPIDllVariable
extern void* OSAPI_gv_LogFunctionParam;
929 OSAPIDllVariable
extern OSAPI_LogDisplay_T OSAPI_gv_LogDisplayFunction;
930 OSAPIDllVariable
extern void* OSAPI_gv_LogDisplayFunctionParam;
949 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
965 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
968 #if OSAPI_ENABLE_TRACE
985 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
986 OSAPI_Log_set_trace_handler(OSAPI_TraceHandler_T handler,
void *param);
1002 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
1003 OSAPI_Log_get_trace_handler(OSAPI_TraceHandler_T *handler,
void **param);
1020 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
1036 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
1055 MUST_CHECK_RETURN OSAPIDllExport RTI_BOOL
1056 OSAPI_Log_initialize(
void);
1070 SHOULD_CHECK_RETURN OSAPIDllExport RTI_BOOL
1071 OSAPI_Log_finalize(
void);
1086 #if OSAPI_ENABLE_TRACE
1094 OSAPI_Trace_set_trace_mask(RTI_UINT32 mask);
1106 SHOULD_CHECK_RETURN OSAPIDllExport RTI_BOOL
1122 OSAPIDllExport RTI_INT32
1152 OSAPIDllExport RTI_BOOL
1162 OSAPI_Log_get_verbosity(
void);
1178 OSAPI_Log_entry_create(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1179 const char *
const module,
const char *
const file,
1180 const char *
const func, RTI_INT32 line,RTI_BOOL is_final);
1193 OSAPI_Log_entry_add_int(
const char *name,RTI_INT32 value,RTI_BOOL is_final);
1206 OSAPI_Log_entry_add_string(
const char *name,
const char *value,RTI_BOOL is_final);
1220 OSAPI_Log_entry_add_pointer(
const char *name,
const void *value,RTI_BOOL is_final);
1222 OSAPIDllExport RTI_BOOL
1223 OSAPI_Log_entry_get_data(OSAPI_LogEntry_T *log_entry,
char **data_ptr,
1224 OSAPI_LogType_T *type,
const char **name,
1225 const void **value,RTI_BOOL *is_final);
1241 OSAPI_Log_entry_add(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1242 const char *
const module,
const char *
const file,
1243 const char *
const func, RTI_INT32 line);
1260 OSAPI_Log_entry_add_1int(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1261 const char *
const module,
const char *
const file,
1262 const char *
const func, RTI_INT32 line,
const char *name,
1283 OSAPI_Log_entry_add_2int(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1284 const char *
const module,
const char *
const file,
1285 const char *
const func, RTI_INT32 line,
1286 const char *name1,RTI_INT32 value1,
1287 const char *name2,RTI_INT32 value2);
1308 OSAPI_Log_entry_add_3int(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1309 const char *
const module,
const char *
const file,
1310 const char *
const func, RTI_INT32 line,
1311 const char *name1,RTI_INT32 value1,
1312 const char *name2,RTI_INT32 value2,
1313 const char *name3,RTI_INT32 value3);
1330 OSAPI_Log_entry_add_1string(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1331 const char *
const module,
const char *
const file,
1332 const char *
const func, RTI_INT32 line,
1333 const char *name,
const char* value);
1352 OSAPI_Log_entry_add_2string(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1353 const char *
const module,
const char *
const file,
1354 const char *
const func, RTI_INT32 line,
1355 const char *name1,
const char* value1,
1356 const char *name2,
const char* value2);
1373 OSAPI_Log_entry_add_1pointer(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1374 const char *
const module,
const char *
const file,
1375 const char *
const func, RTI_INT32 line,
1376 const char *name,
const void* value);
1394 OSAPI_Log_entry_add_1string_1int(OSAPI_LogKind_T kind, RTI_INT32 error_code,
1395 const char *
const module,
const char *
const file,
1396 const char *
const func, RTI_INT32 line,
1397 const char *s_name,
const char* s_value,
1398 const char *i_name,RTI_INT32 i_value);
1412 OSAPIDllExport RTI_INT32
1413 OSAPI_Log_itoa(
char *buffer,RTI_INT32 max_length,RTI_INT32 d);