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 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Port Specific                                                       */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 /**************************************************************************/
23 /*                                                                        */
24 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
25 /*                                                                        */
26 /*    gx_port.h                                       ARCv2_EM/MetaWare   */
27 /*                                                           6.1.8        */
28 /*  AUTHOR                                                                */
29 /*                                                                        */
30 /*    Kenneth Maxwell, Microsoft Corporation                              */
31 /*                                                                        */
32 /*  DESCRIPTION                                                           */
33 /*                                                                        */
34 /*    This file contains data type definitions and constants specific     */
35 /*    to the implementation of high-performance GUIX UI framework.        */
36 /*                                                                        */
37 /*  RELEASE HISTORY                                                       */
38 /*                                                                        */
39 /*    DATE              NAME                      DESCRIPTION             */
40 /*                                                                        */
41 /*  09-30-2010     Kenneth Maxwell          Initial Version 6.1           */
42 /*  04-02-2021     Kenneth Maxwell          Modified comment(s),          */
43 /*                                            resulting in version 6.1.6  */
44 /*  08-02-2021     Kenneth Maxwell          Modified comment(s), removed  */
45 /*                                            GX_SYSTEM_TIMER_TICKS and   */
46 /*                                            GX_TICKS_SECOND definitions,*/
47 /*                                            resulting in version 6.1.8  */
48 /*                                                                        */
49 /**************************************************************************/
50 
51 #ifndef GX_PORT_H
52 #define GX_PORT_H
53 
54 /* Determine if the optional GUIX user define file should be used.  */
55 
56 #ifdef GX_INCLUDE_USER_DEFINE_FILE
57 
58 /* Include the user defines in gx_user.h. The defines in this file may
59    alternately be defined on the command line.  */
60 
61 #include "gx_user.h"
62 #endif
63 
64 typedef INT    GX_BOOL;
65 
66 typedef SHORT  GX_VALUE;
67 
68 #define GX_VALUE_MAX                        0x7FFF
69 
70 
71 /* Define the basic system parameters.  */
72 
73 #ifndef GX_THREAD_STACK_SIZE
74 #define GX_THREAD_STACK_SIZE                4096
75 #endif
76 
77 #define GX_CONST                            const
78 
79 #define GX_INCLUDE_DEFAULT_COLORS
80 
81 #define GX_MAX_ACTIVE_TIMERS                32
82 
83 #define GX_MAX_VIEWS                        32
84 
85 #define GX_MAX_DISPLAY_HEIGHT               800
86 
87 
88 /* Define several macros for the error checking shell in GUIX.  */
89 
90 #ifndef TX_TIMER_PROCESS_IN_ISR
91 
92 #define GX_CALLER_CHECKING_EXTERNS          extern  TX_THREAD           *_tx_thread_current_ptr; \
93                                             extern  TX_THREAD           _tx_timer_thread; \
94                                             extern  volatile ULONG      _tx_thread_system_state;
95 
96 #define GX_THREADS_ONLY_CALLER_CHECKING     if ((_tx_thread_system_state) || \
97                                                 (_tx_thread_current_ptr == TX_NULL) || \
98                                                 (_tx_thread_current_ptr == &_tx_timer_thread)) \
99                                                 return(GX_CALLER_ERROR);
100 
101 #define GX_INIT_AND_THREADS_CALLER_CHECKING if (((_tx_thread_system_state) && (_tx_thread_system_state < ((ULONG) 0xF0F0F0F0))) || \
102                                                 (_tx_thread_current_ptr == &_tx_timer_thread)) \
103                                                 return(GX_CALLER_ERROR);
104 
105 
106 #define GX_NOT_ISR_CALLER_CHECKING          if ((_tx_thread_system_state) && (_tx_thread_system_state < ((ULONG) 0xF0F0F0F0))) \
107                                                 return(GX_CALLER_ERROR);
108 
109 #define GX_THREAD_WAIT_CALLER_CHECKING      if ((wait_option) && \
110                                                ((_tx_thread_current_ptr == NX_NULL) || (_tx_thread_system_state) || (_tx_thread_current_ptr == &_tx_timer_thread))) \
111                                             return(GX_CALLER_ERROR);
112 
113 
114 #else
115 
116 
117 
118 #define GX_CALLER_CHECKING_EXTERNS          extern  TX_THREAD           *_tx_thread_current_ptr; \
119                                             extern  volatile ULONG      _tx_thread_system_state;
120 
121 #define GX_THREADS_ONLY_CALLER_CHECKING     if ((_tx_thread_system_state) || \
122                                                 (_tx_thread_current_ptr == TX_NULL)) \
123                                                 return(GX_CALLER_ERROR);
124 
125 #define GX_INIT_AND_THREADS_CALLER_CHECKING if (((_tx_thread_system_state) && (_tx_thread_system_state < ((ULONG) 0xF0F0F0F0)))) \
126                                                 return(GX_CALLER_ERROR);
127 
128 #define GX_NOT_ISR_CALLER_CHECKING          if ((_tx_thread_system_state) && (_tx_thread_system_state < ((ULONG) 0xF0F0F0F0))) \
129                                                 return(GX_CALLER_ERROR);
130 
131 #define GX_THREAD_WAIT_CALLER_CHECKING      if ((wait_option) && \
132                                                ((_tx_thread_current_ptr == NX_NULL) || (_tx_thread_system_state))) \
133                                             return(GX_CALLER_ERROR);
134 
135 #endif
136 
137 
138 /* Define the version ID of GUIX.  This may be utilized by the application.  */
139 
140 #ifdef GX_SYSTEM_INIT
141 CHAR _gx_version_id[] =
142     "Copyright (c) Microsoft Corporation. All rights reserved.  *  GUIX ARCv2_EM/MetaWare Version 6.2.1 *";
143 #else
144 extern  CHAR _gx_version_id[];
145 #endif
146 
147 #endif
148 
149