⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tx_api.h

📁 ThreadX for BLACKFIN BF561的源码。基于BLACKFIN的处理器。
💻 H
📖 第 1 页 / 共 3 页
字号:
} TX_MUTEX;

typedef TX_MUTEX *      TX_MUTEX_PTR;


/* Define the system API mappings based on the error checking 
   selected by the user.  Note: this section is only applicable to 
   application source code, hence the conditional that turns off this
   stuff when the include file is processed by the ThreadX source. */

#ifndef  TX_SOURCE_CODE


/* Determine if error checking is desired.  If so, map API functions 
   to the appropriate error checking front-ends.  Otherwise, map API
   functions to the core functions that actually perform the work. 
   Note: error checking is enabled by default.  */

#ifdef TX_DISABLE_ERROR_CHECKING

/* Services without error checking.  */

#define tx_kernel_enter             _tx_initialize_kernel_enter

#define tx_byte_allocate            _tx_byte_allocate
#define tx_byte_pool_create         _tx_byte_pool_create
#define tx_byte_pool_delete         _tx_byte_pool_delete
#define tx_byte_pool_info_get       _tx_byte_pool_info_get
#define tx_byte_pool_prioritize     _tx_byte_pool_prioritize
#define tx_byte_release             _tx_byte_release

#define tx_block_allocate           _tx_block_allocate
#define tx_block_pool_create        _tx_block_pool_create
#define tx_block_pool_delete        _tx_block_pool_delete
#define tx_block_pool_info_get      _tx_block_pool_info_get
#define tx_block_pool_prioritize    _tx_block_pool_prioritize
#define tx_block_release            _tx_block_release

#define tx_event_flags_create       _tx_event_flags_create
#define tx_event_flags_delete       _tx_event_flags_delete
#define tx_event_flags_get          _tx_event_flags_get
#define tx_event_flags_info_get     _tx_event_flags_info_get
#define tx_event_flags_set          _tx_event_flags_set

#define tx_interrupt_control        _tx_thread_interrupt_control

#define tx_queue_create             _tx_queue_create
#define tx_queue_delete             _tx_queue_delete
#define tx_queue_flush              _tx_queue_flush
#define tx_queue_info_get           _tx_queue_info_get
#define tx_queue_receive            _tx_queue_receive
#define tx_queue_send               _tx_queue_send
#define tx_queue_front_send         _tx_queue_front_send
#define tx_queue_prioritize         _tx_queue_prioritize

#define tx_semaphore_create         _tx_semaphore_create
#define tx_semaphore_delete         _tx_semaphore_delete
#define tx_semaphore_get            _tx_semaphore_get
#define tx_semaphore_info_get       _tx_semaphore_info_get
#define tx_semaphore_prioritize     _tx_semaphore_prioritize
#define tx_semaphore_put            _tx_semaphore_put

#define tx_mutex_create             _tx_mutex_create
#define tx_mutex_delete             _tx_mutex_delete
#define tx_mutex_get                _tx_mutex_get
#define tx_mutex_info_get           _tx_mutex_info_get
#define tx_mutex_prioritize         _tx_mutex_prioritize
#define tx_mutex_put                _tx_mutex_put

#define tx_thread_create            _tx_thread_create
#define tx_thread_delete            _tx_thread_delete
#define tx_thread_identify          _tx_thread_identify
#define tx_thread_info_get          _tx_thread_info_get
#define tx_thread_preemption_change _tx_thread_preemption_change
#define tx_thread_priority_change   _tx_thread_priority_change
#define tx_thread_relinquish        _tx_thread_relinquish
#define tx_thread_resume            _tx_thread_resume_api
#define tx_thread_sleep             _tx_thread_sleep
#define tx_thread_suspend           _tx_thread_suspend_api
#define tx_thread_terminate         _tx_thread_terminate
#define tx_thread_time_slice_change _tx_thread_time_slice_change
#define tx_thread_wait_abort        _tx_thread_wait_abort

#define tx_time_get                 _tx_time_get
#define tx_time_set                 _tx_time_set
#define tx_timer_activate           _tx_timer_activate_api
#define tx_timer_change             _tx_timer_change
#define tx_timer_create             _tx_timer_create
#define tx_timer_deactivate         _tx_timer_deactivate_api
#define tx_timer_delete             _tx_timer_delete
#define tx_timer_info_get           _tx_timer_info_get

#else

/* Services with error checking.  */

#define tx_kernel_enter             _tx_initialize_kernel_enter

/* Define the system API mappings depending on the runtime error
   checking behavior selected by the user.  */

/* Services with standard ThreadX error checking.  */

#define tx_byte_allocate            _txe_byte_allocate
#define tx_byte_pool_create         _txe_byte_pool_create
#define tx_byte_pool_delete         _txe_byte_pool_delete
#define tx_byte_pool_info_get       _txe_byte_pool_info_get
#define tx_byte_pool_prioritize     _txe_byte_pool_prioritize
#define tx_byte_release             _txe_byte_release

#define tx_block_allocate           _txe_block_allocate
#define tx_block_pool_create        _txe_block_pool_create
#define tx_block_pool_delete        _txe_block_pool_delete
#define tx_block_pool_info_get      _txe_block_pool_info_get
#define tx_block_pool_prioritize    _txe_block_pool_prioritize
#define tx_block_release            _txe_block_release

#define tx_event_flags_create       _txe_event_flags_create
#define tx_event_flags_delete       _txe_event_flags_delete
#define tx_event_flags_get          _txe_event_flags_get
#define tx_event_flags_info_get     _txe_event_flags_info_get
#define tx_event_flags_set          _txe_event_flags_set

#define tx_interrupt_control        _tx_thread_interrupt_control

#define tx_queue_create             _txe_queue_create
#define tx_queue_delete             _txe_queue_delete
#define tx_queue_flush              _txe_queue_flush
#define tx_queue_info_get           _txe_queue_info_get
#define tx_queue_receive            _txe_queue_receive
#define tx_queue_send               _txe_queue_send
#define tx_queue_front_send         _txe_queue_front_send
#define tx_queue_prioritize         _txe_queue_prioritize

#define tx_semaphore_create         _txe_semaphore_create
#define tx_semaphore_delete         _txe_semaphore_delete
#define tx_semaphore_get            _txe_semaphore_get
#define tx_semaphore_info_get       _txe_semaphore_info_get
#define tx_semaphore_prioritize     _txe_semaphore_prioritize
#define tx_semaphore_put            _txe_semaphore_put

#define tx_mutex_create             _txe_mutex_create
#define tx_mutex_delete             _txe_mutex_delete
#define tx_mutex_get                _txe_mutex_get
#define tx_mutex_info_get           _txe_mutex_info_get
#define tx_mutex_prioritize         _txe_mutex_prioritize
#define tx_mutex_put                _txe_mutex_put

#define tx_thread_create            _txe_thread_create
#define tx_thread_delete            _txe_thread_delete
#define tx_thread_identify          _tx_thread_identify
#define tx_thread_info_get          _txe_thread_info_get
#define tx_thread_preemption_change _txe_thread_preemption_change
#define tx_thread_priority_change   _txe_thread_priority_change
#define tx_thread_relinquish        _txe_thread_relinquish
#define tx_thread_resume            _txe_thread_resume_api
#define tx_thread_sleep             _tx_thread_sleep
#define tx_thread_suspend           _txe_thread_suspend_api
#define tx_thread_terminate         _txe_thread_terminate
#define tx_thread_time_slice_change _txe_thread_time_slice_change
#define tx_thread_wait_abort        _txe_thread_wait_abort

#define tx_time_get                 _tx_time_get
#define tx_time_set                 _tx_time_set
#define tx_timer_activate           _txe_timer_activate_api
#define tx_timer_change             _txe_timer_change
#define tx_timer_create             _txe_timer_create
#define tx_timer_deactivate         _txe_timer_deactivate_api
#define tx_timer_delete             _txe_timer_delete
#define tx_timer_info_get           _txe_timer_info_get

#endif


/* Declare the tx_application_define function as having C linkage.  */
VOID        tx_application_define(VOID *);

/* Define the function prototypes of the ThreadX API.  */

VOID        tx_kernel_enter(VOID);

UINT        tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
                    ULONG wait_option);
UINT        tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
                    ULONG pool_size);
UINT        tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr);
UINT        tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes, 
                    ULONG *fragments, TX_THREAD **first_suspended, 
                    ULONG *suspended_count, TX_BYTE_POOL **next_pool);
UINT        tx_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr);
UINT        tx_byte_release(VOID *memory_ptr);

UINT        tx_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG wait_option);
UINT        tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
                    VOID *pool_start, ULONG pool_size);
UINT        tx_block_pool_delete(TX_BLOCK_POOL *pool_ptr);
UINT        tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks, 
                    ULONG *total_blocks, TX_THREAD **first_suspended, 
                    ULONG *suspended_count, TX_BLOCK_POOL **next_pool);
UINT        tx_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr);
UINT        tx_block_release(VOID *block_ptr);

UINT        tx_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr);
UINT        tx_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr);
UINT        tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
                    UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
UINT        tx_event_flags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_flags, 
                    TX_THREAD **first_suspended, ULONG *suspended_count, 
                    TX_EVENT_FLAGS_GROUP **next_group);
UINT        tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, 
                    UINT set_option);

UINT        tx_interrupt_control(UINT new_posture);

UINT        tx_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size, 
                        VOID *queue_start, ULONG queue_size);
UINT        tx_queue_delete(TX_QUEUE *queue_ptr);
UINT        tx_queue_flush(TX_QUEUE *queue_ptr);
UINT        tx_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,
                    TX_THREAD **first_suspended, ULONG *suspended_count, TX_QUEUE **next_queue);
UINT        tx_queue_receive(TX_QUEUE *queue_ptr, VOID *destination_ptr, ULONG wait_option);
UINT        tx_queue_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
UINT        tx_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option);
UINT        tx_queue_prioritize(TX_QUEUE *queue_ptr);


UINT        tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count);
UINT        tx_semaphore_delete(TX_SEMAPHORE *semaphore_ptr);
UINT        tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
UINT        tx_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value, 
                    TX_THREAD **first_suspended, ULONG *suspended_count, 
                    TX_SEMAPHORE **next_semaphore);
UINT        tx_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr);
UINT        tx_semaphore_put(TX_SEMAPHORE *semaphore_ptr);

UINT        tx_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit);
UINT        tx_mutex_delete(TX_MUTEX *mutex_ptr);
UINT        tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
UINT        tx_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,
                    TX_THREAD **first_suspended, ULONG *suspended_count, 
                    TX_MUTEX **next_mutex);
UINT        tx_mutex_prioritize(TX_MUTEX *mutex_ptr);
UINT        tx_mutex_put(TX_MUTEX *mutex_ptr);

UINT        tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, 
                VOID (*entry_function)(ULONG), ULONG entry_input,
                VOID *stack_start, ULONG stack_size, 
                UINT priority, UINT preempt_threshold, 
                ULONG time_slice, UINT auto_start);
UINT        tx_thread_delete(TX_THREAD *thread_ptr);
TX_THREAD  *tx_thread_identify(VOID);
UINT        tx_thread_info_get(TX_THREAD *thread_ptr, CHAR **name, UINT *state, ULONG *run_count, 
                UINT *priority, UINT *preemption_threshold, ULONG *time_slice, 
                TX_THREAD **next_thread, TX_THREAD **next_suspended_thread);
UINT        tx_thread_preemption_change(TX_THREAD *thread_ptr, UINT new_threshold,
                        UINT *old_threshold);
UINT        tx_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority,
                        UINT *old_priority);
VOID        tx_thread_relinquish(VOID);
UINT        tx_thread_resume(TX_THREAD *thread_ptr);
UINT        tx_thread_sleep(ULONG timer_ticks);
UINT        tx_thread_suspend(TX_THREAD *thread_ptr);
UINT        tx_thread_terminate(TX_THREAD *thread_ptr);
UINT        tx_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice);
UINT        tx_thread_wait_abort(TX_THREAD *thread_ptr);

ULONG       tx_time_get(VOID);
VOID        tx_time_set(ULONG new_time);

UINT        tx_timer_activate(TX_TIMER *timer_ptr);
UINT        tx_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG reschedule_ticks);
UINT        tx_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr, 
                VOID (*expiration_function)(ULONG), ULONG expiration_input, ULONG initial_ticks,
                ULONG reschedule_ticks, UINT auto_activate);
UINT        tx_timer_deactivate(TX_TIMER *timer_ptr);
UINT        tx_timer_delete(TX_TIMER *timer_ptr);
UINT        tx_timer_info_get(TX_TIMER *timer_ptr, CHAR **name, UINT *active, ULONG *remaining_ticks, 
                ULONG *reschedule_ticks, TX_TIMER **next_timer);


#endif


/* Determine if a C++ compiler is being used.  If so, complete the standard
   C conditional started above.  */
#ifdef   __cplusplus
        }
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -