|
| 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 | +/** */ |
| 16 | +/** NetX Component */ |
| 17 | +/** */ |
| 18 | +/** User Specific */ |
| 19 | +/** */ |
| 20 | +/**************************************************************************/ |
| 21 | +/**************************************************************************/ |
| 22 | + |
| 23 | + |
| 24 | +/**************************************************************************/ |
| 25 | +/* */ |
| 26 | +/* PORT SPECIFIC C INFORMATION RELEASE */ |
| 27 | +/* */ |
| 28 | +/* nx_user.h PORTABLE C */ |
| 29 | +/* 6.0 */ |
| 30 | +/* */ |
| 31 | +/* AUTHOR */ |
| 32 | +/* */ |
| 33 | +/* Yuxin Zhou, Microsoft Corporation */ |
| 34 | +/* */ |
| 35 | +/* DESCRIPTION */ |
| 36 | +/* */ |
| 37 | +/* This file contains user defines for configuring NetX in specific */ |
| 38 | +/* ways. This file will have an effect only if the application and */ |
| 39 | +/* NetX library are built with NX_INCLUDE_USER_DEFINE_FILE defined. */ |
| 40 | +/* Note that all the defines in this file may also be made on the */ |
| 41 | +/* command line when building NetX library and application objects. */ |
| 42 | +/* */ |
| 43 | +/* RELEASE HISTORY */ |
| 44 | +/* */ |
| 45 | +/* DATE NAME DESCRIPTION */ |
| 46 | +/* */ |
| 47 | +/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ |
| 48 | +/* */ |
| 49 | +/**************************************************************************/ |
| 50 | + |
| 51 | +#ifndef NX_USER_H |
| 52 | +#define NX_USER_H |
| 53 | + |
| 54 | +/* Define the extension to hold the control block for 64-bit mode. */ |
| 55 | +#define NX_THREAD_EXTENSION_PTR_SET(a, b) { \ |
| 56 | + TX_THREAD *thread_ptr; \ |
| 57 | + thread_ptr = (TX_THREAD *) (a); \ |
| 58 | + (thread_ptr -> tx_thread_extension_ptr) = (VOID *)(b); \ |
| 59 | + } |
| 60 | +#define NX_THREAD_EXTENSION_PTR_GET(a, b, c) { \ |
| 61 | + NX_PARAMETER_NOT_USED(c); \ |
| 62 | + TX_THREAD *thread_ptr; \ |
| 63 | + thread_ptr = tx_thread_identify(); \ |
| 64 | + while(1)\ |
| 65 | + { \ |
| 66 | + if (thread_ptr -> tx_thread_extension_ptr) \ |
| 67 | + { \ |
| 68 | + (a) = (b *)(thread_ptr -> tx_thread_extension_ptr); \ |
| 69 | + break; \ |
| 70 | + } \ |
| 71 | + tx_thread_sleep(1); \ |
| 72 | + } \ |
| 73 | + } |
| 74 | +#define NX_TIMER_EXTENSION_PTR_SET(a, b) { \ |
| 75 | + TX_TIMER *timer_ptr; \ |
| 76 | + timer_ptr = (TX_TIMER *) (a); \ |
| 77 | + (timer_ptr -> tx_timer_internal.tx_timer_internal_extension_ptr) = (VOID *)(b); \ |
| 78 | + } |
| 79 | +#define NX_TIMER_EXTENSION_PTR_GET(a, b, c) { \ |
| 80 | + NX_PARAMETER_NOT_USED(c); \ |
| 81 | + if (!_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr) \ |
| 82 | + return; \ |
| 83 | + (a) = (b *)(_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr); \ |
| 84 | + } |
| 85 | + |
| 86 | +#endif |
| 87 | + |
0 commit comments