1
0
mirror of https://github.com/azure-rtos/guix.git synced 2025-01-28 07:03:11 +08:00
guix/ports/generic/inc/gx_port.h
2021-10-13 06:50:21 +00:00

154 lines
7.5 KiB
C

/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** GUIX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/* */
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* gx_port.h Generic */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Kenneth Maxwell, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This file contains data type definitions and constants that work */
/* generically on most compiler and processor architectures. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 02-02-2021 Kenneth Maxwell Initial Version 6.1.4 */
/* 04-02-2021 Kenneth Maxwell Modified comment(s), */
/* resulting in version 6.1.6 */
/* 08-02-2021 Kenneth Maxwell Modified comment(s), removed */
/* GX_SYSTEM_TIMER_TICKS and */
/* GX_TICKS_SECOND definitions,*/
/* resulting in version 6.1.8 */
/* */
/**************************************************************************/
#ifndef GX_PORT_H
#define GX_PORT_H
/* Determine if the optional GUIX user define file should be used. */
#ifdef GX_INCLUDE_USER_DEFINE_FILE
/* Include the user defines in gx_user.h. The defines in this file may
alternately be defined on the command line. */
#include "gx_user.h"
#endif
typedef INT GX_BOOL;
typedef SHORT GX_VALUE;
#define GX_VALUE_MAX 0x7FFF
/* Define the basic system parameters. */
#ifndef GX_THREAD_STACK_SIZE
#define GX_THREAD_STACK_SIZE 4096
#endif
#define GX_CONST const
#define GX_INCLUDE_DEFAULT_COLORS
#define GX_MAX_ACTIVE_TIMERS 32
#define GX_MAX_VIEWS 32
#define GX_MAX_DISPLAY_HEIGHT 800
/* Define several macros for the error checking shell in GUIX. */
#ifdef GX_DISABLE_THREADX_BINDING
/* Here if not running with ThreadX RTOS */
#define GX_CALLER_CHECKING_EXTERNS
#define GX_THREADS_ONLY_CALLER_CHECKING
#define GX_INIT_AND_THREADS_CALLER_CHECKING
#define GX_NOT_ISR_CALLER_CHECKING
#define GX_THREAD_WAIT_CALLER_CHECKING
#else
#ifdef TX_TIMER_PROCESS_IN_ISR
#define GX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \
extern volatile ULONG _tx_thread_system_state;
#define GX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \
(_tx_thread_current_ptr == TX_NULL)) \
return(GX_CALLER_ERROR);
#define GX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && ((TX_THREAD_GET_SYSTEM_STATE()) < ((ULONG) 0xF0F0F0F0)))) \
return(GX_CALLER_ERROR);
#define GX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && ((TX_THREAD_GET_SYSTEM_STATE()) < ((ULONG) 0xF0F0F0F0))) \
return(GX_CALLER_ERROR);
#define GX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \
((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \
return(GX_CALLER_ERROR);
#else
#define GX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \
extern TX_THREAD _tx_timer_thread; \
extern volatile ULONG _tx_thread_system_state;
#define GX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \
(_tx_thread_current_ptr == TX_NULL) || \
(_tx_thread_current_ptr == &_tx_timer_thread)) \
return(GX_CALLER_ERROR);
#define GX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && ((TX_THREAD_GET_SYSTEM_STATE()) < ((ULONG) 0xF0F0F0F0))) || \
(_tx_thread_current_ptr == &_tx_timer_thread)) \
return(GX_CALLER_ERROR);
#define GX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && ((TX_THREAD_GET_SYSTEM_STATE()) < ((ULONG) 0xF0F0F0F0))) \
return(GX_CALLER_ERROR);
#define GX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \
((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \
return(GX_CALLER_ERROR);
#endif
#endif
/* Define the version ID of GUIX. This may be utilized by the application. */
#ifdef GX_SYSTEM_INIT
CHAR _gx_version_id[] =
"Copyright (c) Microsoft Corporation. All rights reserved. * GUIX Version 6.1.9 *";
#else
extern CHAR _gx_version_id[];
#endif
#endif