55 #include "OSAL_Memory.h"
56 #include "OSAL_Timers.h"
65 #if ( UINT_MAX == 65535 )
66 #define osal_offsetof(type, member) ((uint16) &(((type *) 0)->member))
68 #define osal_offsetof(type, member) ((uint32) &(((type *) 0)->member))
71 #define OSAL_MSG_NEXT(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->next
73 #define OSAL_MSG_Q_INIT(q_ptr) *(q_ptr) = NULL
75 #define OSAL_MSG_Q_EMPTY(q_ptr) (*(q_ptr) == NULL)
77 #define OSAL_MSG_Q_HEAD(q_ptr) (*(q_ptr))
79 #define OSAL_MSG_LEN(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->len
81 #define OSAL_MSG_ID(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->dest_id
94 typedef ICall_MsgHdr osal_msg_hdr_t;
99 #ifdef OSAL_PORT2TIRTOS
116 typedef void * osal_msg_q_t;
120 typedef void (*osal_highres_timer_cback_t)(
void *arg);
124 typedef void (*osal_icallMsg_hook_t)(
void * param);
134 extern ICall_Semaphore osal_semaphore;
137 extern uint_least32_t osal_tickperiod;
138 extern void (*osal_eventloop_hook)(void);
151 extern uint8 * osal_msg_allocate(uint16 len );
156 extern uint8 osal_msg_deallocate( uint8 *msg_ptr );
161 extern uint8 osal_msg_send( uint8 destination_task, uint8 *msg_ptr );
166 extern uint8 osal_msg_push_front( uint8 destination_task, uint8 *msg_ptr );
171 extern uint8 *osal_msg_receive( uint8 task_id );
181 extern uint8 osal_msg_count(uint8 task_id, uint8 event);
186 extern void osal_msg_enqueue( osal_msg_q_t *q_ptr,
void *msg_ptr );
191 extern uint8 osal_msg_enqueue_max( osal_msg_q_t *q_ptr,
void *msg_ptr, uint8 max );
196 extern void *osal_msg_dequeue( osal_msg_q_t *q_ptr );
201 extern void osal_msg_push( osal_msg_q_t *q_ptr,
void *msg_ptr );
206 extern void osal_msg_extract( osal_msg_q_t *q_ptr,
void *msg_ptr,
void *prev_ptr );
218 extern uint8 osal_set_event( uint8 task_id, uint16 event_flag );
224 extern uint8 osal_clear_event( uint8 task_id, uint16 event_flag );
232 extern uint8 osal_isr_register( uint8 interrupt_id,
void (*isr_ptr)( uint8* ) );
237 extern uint8 osal_int_enable( uint8 interrupt_id );
242 extern uint8 osal_int_disable( uint8 interrupt_id );
251 extern void osal_enroll_dispatchid(uint8 taskid,
258 extern void osal_enroll_senderid(uint8 taskid,
ICall_EntityID dispatchid);
270 void osal_timer_init(uint_least32_t tickPeriod, uint_least32_t osalMaxMsecs);
278 extern uint8 osal_init_system(
void );
284 extern __declspec(dllexport) void osal_start_system(
void );
286 extern void osal_start_system(
void );
292 extern void osal_run_system(
void );
297 extern uint8 osal_self(
void );
305 extern int osal_strlen(
char *pString );
310 extern void *osal_memcpy(
void*,
const void GENERIC *,
unsigned int );
315 extern void *osal_memdup(
const void GENERIC *src,
unsigned int len );
320 extern void *osal_revmemcpy(
void*,
const void GENERIC *,
unsigned int );
325 extern uint8 osal_memcmp(
const void GENERIC *src1,
const void GENERIC *src2,
unsigned int len );
330 extern void *osal_memset(
void *dest, uint8 value,
int len );
335 extern uint16 osal_build_uint16( uint8 *swapped );
340 extern uint32 osal_build_uint32( uint8 *swapped, uint8 len );
345 #if !defined ( ZBIT ) && !defined ( ZBIT2 ) && !defined (UBIT)
346 extern uint8 *_ltoa( uint32 l, uint8 * buf, uint8 radix );
352 extern uint16 osal_rand(
void );
357 extern uint8* osal_buffer_uint32( uint8 *buf, uint32 val );
362 extern uint8* osal_buffer_uint24( uint8 *buf, uint24 val );
367 extern uint8 osal_isbufset( uint8 *buf, uint8 val, uint8 len );
373 extern void osal_set_icall_hook( osal_icallMsg_hook_t param );
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:443
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:431
Common service function arguments.
Definition: icall.h:476
OSAL Event Header.
Definition: osal.h:110
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:453