1. Trang chủ
  2. » Công Nghệ Thông Tin

Real-Time Embedded Multithreading Using ThreadX and MIPS- P23 pps

17 177 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 17
Dung lượng 105,81 KB

Nội dung

www.newnespress.com Input Parameters activates Pointer to destination for the total number of activation requests performed on all timers. reactivates Pointer to destination for the total number of automatic reactivation performed on all periodic timers. deactivates Pointer to destination for the total number of deactivation requests performed on all timers. expirations Pointer to destination for the total number of expirations on all timers. expiration_adjusts Pointer to destination for the total number of internal expiration adjustments performed on all timers. These adjustments are done in the timer interrupt processing for timers that are larger than the default timer list size (by default timers with expirations greater than 32 ticks). NOTE : The ThreadX library and application must be built with TX_TIMER_ENABLE_ PERFORMANCE_INFO defi ned for this service to return performance information. NOTE : Supplying a TX_NULL for any parameter indicates that the parameter is not required. Return Values TX_SUCCESS (0x00) Successful timer system performance get. TX_FEATURE_NOT_ENABLED (0xFF) The system was not compiled with performance information enabled. Allowed From Initialization, threads, timers, and ISRs Application Timer Services J-13 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Example ULONG activates; ULONG reactivates; ULONG deactivates; ULONG expirations; ULONG expiration_adjusts; … /* Retrieve performance information on all previously created timers. */ status ϭ tx_timer_performance_system_info_get( & activates, & reactivates, & deactivates, & expirations, & expiration_adjusts); /* If status is TX_SUCCESS the performance information was successfully retrieved. */ See Also tx_timer_activate, tx_timer_change, tx_timer_create, tx_timer_deactivate, tx_timer_delete, tx_ timer_info_get, tx_timer_performance_info_get www.newnespress.com J-14 Appendix J Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. www.newnespress.com ThreadX API 1 APPENDIX K ThreadX Entry VOID tx_kernel_enter(VOID); Memory Byte Pool Services 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 **fi rst_suspended, ULONG *suspended_count, TX_BYTE_POOL **next_pool); 1 ThreadX is a registered trademark of Express Logic, Inc. The ThreadX API, associated data structures, and data types are copyrights of Express Logic, Inc. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. UINT tx_byte_pool_performance_info_get(TX_BYTE_POOL *pool_ptr, ULONG *allocates, ULONG *releases, ULONG *fragments_searched, ULONG *merges, ULONG *splits, ULONG *suspensions, ULONG *timeouts); UINT tx_byte_pool_performance_system_info_get(ULONG *allocates, ULONG *releases, ULONG *fragments_searched, ULONG *merges, ULONG *splits, ULONG *suspensions, ULONG *timeouts); UINT tx_byte_pool_prioritize(TX_BYTE_POOL *pool_ptr); UINT tx_byte_release(VOID *memory_ptr); Memory Block Pool Services 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 **fi rst_suspended, ULONG *suspended_count, TX_BLOCK_POOL **next_pool); www.newnespress.com K-2 Appendix K Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. www.newnespress.com UINT tx_block_pool_performance_info_get(TX_BLOCK_POOL *pool_ptr, ULONG *allocates, ULONG *releases, ULONG *suspensions, ULONG *timeouts); UINT tx_block_pool_performance_system_info_get(ULONG *allocates, ULONG *releases, ULONG *suspensions, ULONG *timeouts); UINT tx_block_pool_prioritize(TX_BLOCK_POOL *pool_ptr); UINT tx_block_release(VOID *block_ptr); Event Flag Services UINT tx_event_fl ags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr); UINT tx_event_fl ags_delete(TX_EVENT_FLAGS_GROUP *group_ptr); UINT tx_event_fl ags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_fl ags, UINT get_option, ULONG *actual_fl ags_ptr, ULONG wait_option); UINT tx_event_fl ags_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR **name, ULONG *current_fl ags, TX_THREAD **fi rst_suspended, ULONG *suspended_count, TX_EVENT_FLAGS_GROUP **next_group); UINT tx_event_fl ags_performance_info_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG *sets, ULONG *gets, ULONG *suspensions, ULONG *timeouts); ThreadX API K-3 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. UINT tx_event_fl ags_performance_system_info_get(ULONG *sets, ULONG *gets,ULONG *suspensions, ULONG *timeouts); UINT tx_event_fl ags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG fl ags_to_set, UINT set_option); UINT tx_event_fl ags_set_notify(TX_EVENT_FLAGS_GROUP *group_ptr, VOID(*events_set_notify)(TX_EVENT_FLAGS_GROUP *)); Interrupt Control Service UINT tx_interrupt_control(UINT new_posture); Message Queue Services 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_fl ush(TX_QUEUE *queue_ptr); UINT tx_queue_front_send(TX_QUEUE *queue_ptr, VOID *source_ptr, ULONG wait_option); UINT tx_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage, TX_THREAD **fi rst_suspended, ULONG *suspended_count, TX_QUEUE **next_queue); UINT tx_queue_performance_info_get(TX_QUEUE *queue_ptr, ULONG *messages_sent, ULONG *messages_received, www.newnespress.com K-4 Appendix K Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. www.newnespress.com ULONG *empty_suspensions, ULONG *full_suspensions, ULONG *full_errors, ULONG *timeouts); UINT tx_queue_performance_system_info_get(ULONG *messages_sent, ULONG *messages_received, ULONG *empty_suspensions, ULONG *full_suspensions, ULONG *full_errors, ULONG *timeouts); UINT tx_queue_prioritize(TX_QUEUE *queue_ptr); 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_send_notify(TX_QUEUE *queue_ptr, VOID (*queue_send_notify)(TX_QUEUE *)); Semaphore Services UINT tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling); 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 **fi rst_suspended, ThreadX API K-5 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ULONG *suspended_count, TX_SEMAPHORE **next_semaphore); UINT tx_semaphore_performance_info_get(TX_SEMAPHORE *semaphore_ptr, ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts); UINT tx_semaphore_performance_system_info_get(ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts); UINT tx_semaphore_prioritize(TX_SEMAPHORE *semaphore_ptr); UINT tx_semaphore_put(TX_SEMAPHORE *semaphore_ptr); UINT tx_semaphore_put_notify(TX_SEMAPHORE *semaphore_ptr, VOID (*semaphore_put_notify)(TX_SEMAPHORE *)); Mutex Services 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 **fi rst_suspended, ULONG *suspended_count, TX_MUTEX **next_mutex); UINT tx_mutex_performance_info_get(TX_MUTEX *mutex_ptr, ULONG *puts, ULONG *gets, ULONG *suspensions, www.newnespress.com K-6 Appendix K Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. www.newnespress.com ULONG *timeouts, ULONG *inversions, ULONG *inheritances); UINT tx_mutex_performance_system_info_get(ULONG *puts, ULONG *gets, ULONG *suspensions, ULONG *timeouts, ULONG *inversions, ULONG *inheritances); UINT tx_mutex_prioritize(TX_MUTEX *mutex_ptr); UINT tx_mutex_put(TX_MUTEX *mutex_ptr); Thread Services 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); UINT tx_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID(*entry_exit_notify)(TX_THREAD *, UINT)); 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, ThreadX API K-7 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. TX_THREAD **next_thread, TX_THREAD **next_suspended_thread); UINT tx_thread_performance_info_get(TX_THREAD *thread_ptr, ULONG *resumptions, ULONG *suspensions, ULONG *solicited_preemptions, ULONG *interrupt_preemptions, ULONG *priority_inversions, ULONG *time_slices, ULONG *relinquishes, ULONG *timeouts, ULONG *wait_aborts, TX_THREAD **last_preempted_by); UINT tx_thread_performance_system_info_get(ULONG *resumptions, ULONG *suspensions, ULONG *solicited_preemptions, ULONG *interrupt_preemptions, ULONG *priority_inversions, ULONG *time_slices, ULONG *relinquishes, ULONG *timeouts, ULONG *wait_aborts, ULONG *non_idle_returns, ULONG *idle_returns); 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_reset(TX_THREAD *thread_ptr); UINT tx_thread_resume(TX_THREAD *thread_ptr); UINT tx_thread_sleep(ULONG timer_ticks); UINT tx_thread_stack_error_notify(VOID(*error_handler) (TX_THREAD *)); www.newnespress.com K-8 Appendix K Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... 79 Thread execution state: completed, 79, 89, 90 executing, 89, 90 ready, 89, 90 suspended, 85, 89, 90 terminated, 89, 90 Thread scheduling, 59–65 Thread state transition, 89 ThreadX initialization, 56, 58–9 ThreadX interrupt handling, 65–8, 69 Tick counter, 154 Time services, K-9 Time-slice, 26–7, H-3, H-15 Timeout function, 154, 156 Timer, See Application timer Timer activation options, 159 Timer... MIPS architecture, 46, 47, 51, 68, 69 MIPS32, 46, 49 MIPS64, 46, 49 RISC, 45, 46, 47 MIPS core, 46 MIPS exception handling, 55, 56–9, 65, 68 MIPS instructions, 46 MIPS processor, 45–54 MIPS processor mode, 52, 53 MIPS registers, 46, 48, 49, 50, 51, 52, 60 Multiple mutex ownership, 99, 108 Multithreading, 7, 76 Mutex: attributes, 38, 103 control block, 101 creation, 102–3 deletion, 103 get, E-7, E-9 information... 27–8, 92, 180 Producer-consumer, 178, 196 Public resource, 31, 256, 267 Q Queue storage space, 237 Queue suspension, 236, 244 R Ready list, 103 Ready state, 89, 90 Ready thread, 22, 23, 94 Real-time kernel, 3–4, 7 Real-time system, 1–7 Rear of queue, 40, 242, 256 Receive message, 240–1 Recovery from deadly embrace, 108–9 Reentrant function, 76 Relinquish processor control, 24, 84 Resume thread execution,... Deadly embrace, 107–9, 180 recovery, 108–9 Decrement count, 107, 177, 206 De-fragmentation, 34, 128, 137 Determinism, 2, 25–6 Dynamic priority, 21 E Embedded system, 1, 25, 53 Entry function input, H-2, H-4 Event-chaining, 186, 220, 245 Event flags group, 39–40 AND operation, 209, 218 attributes, 39 clearing event flags, 232 control block, 210–11 creation, 211–12 deletion, 213 event-chaining, 220 get, C-4–C-7,... clock, 153, I-1 w ww n e w n e s p r e s s c o m Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Index-3 Interrupt, 7, 60, 68 Interrupt control service, D-1, K-4 Interrupt handling, 65 Interrupt service routine (ISR), 7, 27, 69, 87, 88, 128 Inter-thread communication, 7, F-2 Inter-thread mutual exclusion, 11, E-1 K Kernel, 26 Kernel entry, 53 L Logical operations, 211 Low... state, 80, 86, 90, 95, H-5 Compute timing performance, 174 Condition code, H-8 Conditional instruction execution, 55 Conditional suspension, 85, H-27, H-32 Control loop with polling, 5, 8 Cooperative multithreading, 24, 25, 30, 84, 96 Count Register, 48, 49, 50, 51, 54 Counting semaphore, 38–9, 177 attributes, 39 binary semaphore, 41, 42, 178, 181, 187, 188, 189, 198, 206 creation, 179, 180–1, 182,.. .ThreadX API K-9 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);... flags, 213–17 satisfying a get request, 214 services, C-1–C-15 set, C-12–C-13 set option, 218 setting event flags, 218–20 system performance information, C-10–C-12 Event notification, 177, 220 Exception handling, 56 Exclusive access, 100 Exclusive ownership, 104, E-4 Executing state, 89, 90 Execution context, 75 Expiration function, 154, 157, 158, 165, 272, 279, 282, 284, 286, J-4 Expiration time, 53 F . *suspended_count, TX_BYTE_POOL **next_pool); 1 ThreadX is a registered trademark of Express Logic, Inc. The ThreadX API, associated data structures, and data types are copyrights of Express Logic,. 90 Thread scheduling , 59 – 65 Thread state transition , 89 ThreadX initialization , 56 , 58 – 9 ThreadX interrupt handling , 65 – 8 , 69 Tick counter , 154 Time services , K-9 . timer list size (by default timers with expirations greater than 32 ticks). NOTE : The ThreadX library and application must be built with TX_TIMER_ENABLE_ PERFORMANCE_INFO defi ned for this service

Ngày đăng: 03/07/2014, 05:20