1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** Thread-Metric Component */
16 /** */
17 /** Porting Layer (Must be completed with RTOS specifics) */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22
23 /* Include necessary files. */
24
25 #include "tm_api.h"
26
27
28 /* This function called from main performs basic RTOS initialization,
29 calls the test initialization function, and then starts the RTOS function. */
tm_initialize(void (* test_initialization_function)(void))30 void tm_initialize(void (*test_initialization_function)(void))
31 {
32
33 }
34
35
36 /* This function takes a thread ID and priority and attempts to create the
37 file in the underlying RTOS. Valid priorities range from 1 through 31,
38 where 1 is the highest priority and 31 is the lowest. If successful,
39 the function should return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_thread_create(int thread_id,int priority,void (* entry_function)(void))40 int tm_thread_create(int thread_id, int priority, void (*entry_function)(void))
41 {
42
43 }
44
45
46 /* This function resumes the specified thread. If successful, the function should
47 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_thread_resume(int thread_id)48 int tm_thread_resume(int thread_id)
49 {
50
51 }
52
53
54 /* This function suspends the specified thread. If successful, the function should
55 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_thread_suspend(int thread_id)56 int tm_thread_suspend(int thread_id)
57 {
58
59 }
60
61
62 /* This function relinquishes to other ready threads at the same
63 priority. */
tm_thread_relinquish(void)64 void tm_thread_relinquish(void)
65 {
66
67 }
68
69
70 /* This function suspends the specified thread for the specified number
71 of seconds. If successful, the function should return TM_SUCCESS.
72 Otherwise, TM_ERROR should be returned. */
tm_thread_sleep(int seconds)73 void tm_thread_sleep(int seconds)
74 {
75
76 }
77
78
79 /* This function creates the specified queue. If successful, the function should
80 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_queue_create(int queue_id)81 int tm_queue_create(int queue_id)
82 {
83
84 }
85
86
87 /* This function sends a 16-byte message to the specified queue. If successful,
88 the function should return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_queue_send(int queue_id,unsigned long * message_ptr)89 int tm_queue_send(int queue_id, unsigned long *message_ptr)
90 {
91
92 }
93
94
95 /* This function receives a 16-byte message from the specified queue. If successful,
96 the function should return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_queue_receive(int queue_id,unsigned long * message_ptr)97 int tm_queue_receive(int queue_id, unsigned long *message_ptr)
98 {
99
100 }
101
102
103 /* This function creates the specified semaphore. If successful, the function should
104 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_semaphore_create(int semaphore_id)105 int tm_semaphore_create(int semaphore_id)
106 {
107
108 }
109
110
111 /* This function gets the specified semaphore. If successful, the function should
112 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_semaphore_get(int semaphore_id)113 int tm_semaphore_get(int semaphore_id)
114 {
115
116 }
117
118
119 /* This function puts the specified semaphore. If successful, the function should
120 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_semaphore_put(int semaphore_id)121 int tm_semaphore_put(int semaphore_id)
122 {
123
124 }
125
126
127 /* This function creates the specified memory pool that can support one or more
128 allocations of 128 bytes. If successful, the function should
129 return TM_SUCCESS. Otherwise, TM_ERROR should be returned. */
tm_memory_pool_create(int pool_id)130 int tm_memory_pool_create(int pool_id)
131 {
132
133 }
134
135
136 /* This function allocates a 128 byte block from the specified memory pool.
137 If successful, the function should return TM_SUCCESS. Otherwise, TM_ERROR
138 should be returned. */
tm_memory_pool_allocate(int pool_id,unsigned char ** memory_ptr)139 int tm_memory_pool_allocate(int pool_id, unsigned char **memory_ptr)
140 {
141
142 }
143
144
145 /* This function releases a previously allocated 128 byte block from the specified
146 memory pool. If successful, the function should return TM_SUCCESS. Otherwise, TM_ERROR
147 should be returned. */
tm_memory_pool_deallocate(int pool_id,unsigned char * memory_ptr)148 int tm_memory_pool_deallocate(int pool_id, unsigned char *memory_ptr)
149 {
150
151 }
152
153
154