Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
pal/Test/Common/pal_rtos_test_utils.h@0:06ee5f8a484a, 2017-03-18 (annotated)
- Committer:
- djmeyers
- Date:
- Sat Mar 18 22:37:16 2017 +0000
- Revision:
- 0:06ee5f8a484a
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| djmeyers | 0:06ee5f8a484a | 1 | /* |
| djmeyers | 0:06ee5f8a484a | 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. |
| djmeyers | 0:06ee5f8a484a | 3 | * SPDX-License-Identifier: Apache-2.0 |
| djmeyers | 0:06ee5f8a484a | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| djmeyers | 0:06ee5f8a484a | 5 | * not use this file except in compliance with the License. |
| djmeyers | 0:06ee5f8a484a | 6 | * You may obtain a copy of the License at |
| djmeyers | 0:06ee5f8a484a | 7 | * |
| djmeyers | 0:06ee5f8a484a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| djmeyers | 0:06ee5f8a484a | 9 | * |
| djmeyers | 0:06ee5f8a484a | 10 | * Unless required by applicable law or agreed to in writing, software |
| djmeyers | 0:06ee5f8a484a | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| djmeyers | 0:06ee5f8a484a | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| djmeyers | 0:06ee5f8a484a | 13 | * See the License for the specific language governing permissions and |
| djmeyers | 0:06ee5f8a484a | 14 | * limitations under the License. |
| djmeyers | 0:06ee5f8a484a | 15 | */ |
| djmeyers | 0:06ee5f8a484a | 16 | |
| djmeyers | 0:06ee5f8a484a | 17 | #ifndef _PAL_RTOS_TEST_UTILS_H |
| djmeyers | 0:06ee5f8a484a | 18 | #define _PAL_RTOS_TEST_UTILS_H |
| djmeyers | 0:06ee5f8a484a | 19 | |
| djmeyers | 0:06ee5f8a484a | 20 | #include "pal_types.h" |
| djmeyers | 0:06ee5f8a484a | 21 | #include "pal_rtos.h" |
| djmeyers | 0:06ee5f8a484a | 22 | #include "pal_test_utils.h" |
| djmeyers | 0:06ee5f8a484a | 23 | |
| djmeyers | 0:06ee5f8a484a | 24 | #define THREAD_STACK_SIZE 1024*sizeof(uint32_t) |
| djmeyers | 0:06ee5f8a484a | 25 | |
| djmeyers | 0:06ee5f8a484a | 26 | typedef struct threadsArgument{ |
| djmeyers | 0:06ee5f8a484a | 27 | uint32_t arg1; |
| djmeyers | 0:06ee5f8a484a | 28 | uint32_t arg2; |
| djmeyers | 0:06ee5f8a484a | 29 | uint32_t arg3; |
| djmeyers | 0:06ee5f8a484a | 30 | uint32_t arg4; |
| djmeyers | 0:06ee5f8a484a | 31 | uint32_t arg5; |
| djmeyers | 0:06ee5f8a484a | 32 | uint32_t arg6; |
| djmeyers | 0:06ee5f8a484a | 33 | uint32_t arg7; |
| djmeyers | 0:06ee5f8a484a | 34 | }threadsArgument_t; |
| djmeyers | 0:06ee5f8a484a | 35 | |
| djmeyers | 0:06ee5f8a484a | 36 | |
| djmeyers | 0:06ee5f8a484a | 37 | extern threadsArgument_t g_threadsArg; |
| djmeyers | 0:06ee5f8a484a | 38 | |
| djmeyers | 0:06ee5f8a484a | 39 | extern uint32_t g_threadStorage[20]; |
| djmeyers | 0:06ee5f8a484a | 40 | |
| djmeyers | 0:06ee5f8a484a | 41 | void palThreadFunc1(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 42 | void palThreadFunc2(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 43 | void palThreadFunc3(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 44 | void palThreadFunc4(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 45 | void palThreadFunc5(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 46 | void palThreadFunc6(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 47 | |
| djmeyers | 0:06ee5f8a484a | 48 | |
| djmeyers | 0:06ee5f8a484a | 49 | typedef struct timerArgument{ |
| djmeyers | 0:06ee5f8a484a | 50 | uint32_t ticksBeforeTimer; |
| djmeyers | 0:06ee5f8a484a | 51 | uint32_t ticksInFunc1; |
| djmeyers | 0:06ee5f8a484a | 52 | uint32_t ticksInFunc2; |
| djmeyers | 0:06ee5f8a484a | 53 | }timerArgument_t; |
| djmeyers | 0:06ee5f8a484a | 54 | |
| djmeyers | 0:06ee5f8a484a | 55 | extern timerArgument_t g_timerArgs; |
| djmeyers | 0:06ee5f8a484a | 56 | |
| djmeyers | 0:06ee5f8a484a | 57 | void palTimerFunc1(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 58 | void palTimerFunc2(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 59 | |
| djmeyers | 0:06ee5f8a484a | 60 | |
| djmeyers | 0:06ee5f8a484a | 61 | void palThreadFuncCustom1(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 62 | void palThreadFuncCustom2(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 63 | void palThreadFuncCustom3(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 64 | void palThreadFuncCustom4(void const *argument); |
| djmeyers | 0:06ee5f8a484a | 65 | |
| djmeyers | 0:06ee5f8a484a | 66 | |
| djmeyers | 0:06ee5f8a484a | 67 | #define MEMORY_POOL1_BLOCK_SIZE 32 |
| djmeyers | 0:06ee5f8a484a | 68 | #define MEMORY_POOL1_BLOCK_COUNT 5 |
| djmeyers | 0:06ee5f8a484a | 69 | #define MEMORY_POOL2_BLOCK_SIZE 12 |
| djmeyers | 0:06ee5f8a484a | 70 | #define MEMORY_POOL2_BLOCK_COUNT 4 |
| djmeyers | 0:06ee5f8a484a | 71 | |
| djmeyers | 0:06ee5f8a484a | 72 | extern palMutexID_t mutex1; |
| djmeyers | 0:06ee5f8a484a | 73 | extern palMutexID_t mutex2; |
| djmeyers | 0:06ee5f8a484a | 74 | |
| djmeyers | 0:06ee5f8a484a | 75 | extern palSemaphoreID_t semaphore1; |
| djmeyers | 0:06ee5f8a484a | 76 | |
| djmeyers | 0:06ee5f8a484a | 77 | #endif //_PAL_RTOS_TEST_UTILS_H |