/******************************************************************************
 *
 *                               Global_def                               
 *
 * @(#)Copyright (C) 1991 National Semiconductor Corp.
 *
 * This module contains the global definitions for both C and assembly 
 * modules of CMON.
 *
 * NOTE: It should not contain any lanuage dependant definitions or statements
 *       since it is included by the drivers too!
 *
 * History:
 *   +----------+------------+------------------------------------------------+
 *   |   Date   |     by     |     Description                                |
 *   +----------+------------+------------------------------------------------+
 *   |          | Coby       | Written                                        |
 *   +----------+------------+------------------------------------------------+
 *
 *****************************************************************************/

/*
 * Definitions for C. (makedefs utility) 
 */

#define public
#define private   static


/*
 * Boolean operators 
 */

#define NOT   !
#define AND   &&
#define OR    ||

#ifndef FALSE
#define FALSE  0
#define TRUE   1
#endif

/*
 * Define RAM when DEBUG is defined & vise versa
 */
#ifdef DEBUG
#ifndef RAM
#define RAM
#endif
#endif

#ifdef RAM
#ifndef DEBUG
#define DEBUG
#endif
#endif

/*
 * Include the device definitions
 */

#include "device.h"

/*
 * Include the appropriate board definition. 
 */

#define DB16K     1
#define DB16KA    2
#define DB32K     3
#define DB332     4
#define DB332B    5
#define DB532     6
#define CG16ED    7
#define CG160ED   8
#define GX32ED    9
#define GX320ED   10
#define SF_SIM	  11
#define VECTOR	  12
#define FX16FAX   13
#define DRAGON    13
#define CG160LX   14
#define SWIFT     14
#define AM160ED   15
#define VIPER	  16
#define FX164ED	  16
#define A1D	  17

#define USER      0

#include BOARD_FILE

/*
 * Define CPU familys
 */

#define	CG  1
#define GX  2
#define SF  3

#if ((CPU_TYPE == NS32016) || (CPU_TYPE == NS32008) || (CPU_TYPE == NS32032) \
     || (CPU_TYPE == NS32332) || (CPU_TYPE == NS32CG16) || (CPU_TYPE == NS32FX16))
#   define CORE_TYPE CG
#   define DE_AVAILABLE          FALSE
#   define NON_DE_AVAILABLE      TRUE
#endif 

#if ((CPU_TYPE == NS32CG160) || (CPU_TYPE == NS32FX164))
#   define CORE_TYPE CG
#   define DE_AVAILABLE          TRUE
#   define NON_DE_AVAILABLE      TRUE
#endif 

#if ((CPU_TYPE == NS32532) || (CPU_TYPE == NS32GX32) || \
     (CPU_TYPE == NS32GX320))
#   define CORE_TYPE GX
#   define DE_AVAILABLE          TRUE
#   define NON_DE_AVAILABLE      TRUE
#endif

#if (CPU_TYPE == NS32SF641) 
#   define CORE_TYPE SF
#   define DE_AVAILABLE          TRUE
#   define NON_DE_AVAILABLE      FALSE
#endif

#if (CPU_TYPE == NS32AM160) 
#define CORE_TYPE CG
#define DE_AVAILABLE             TRUE
#define NON_DE_AVAILABLE         FALSE
#endif

#define DIRECT_EXCEPTION_MODE 1
#define NON_DIRECT_EXCEPTION_MODE 0

/*
 * Define the CFG bits
 */
#if	(CORE_TYPE != SF  || defined (SIM_32K))
#   define CFG_I   0
#   define CFG_F 1
#   define CFG_M   2
#   define CFG_C   3
#   define CFG_FI  4
#   define CFG_FF  5
#   define CFG_FM  6
#   define CFG_P   7
#   define CFG_DE  8
#   define CFG_DC  9
#   define CFG_LDC 10
#   define CFG_IC  11
#   define CFG_LIC 12
#else
#   define CFG_F   0
#   define CFG_DC  2
#   define CFG_LDC 3
#   define CFG_IC  4
#   define CFG_LIC 5
#   define CFG_ISR 6
#endif
/*
 * Define the PSR bits
 */

#define PSR_C   0
#define PSR_T   1
#define PSR_L   2
#define PSR_V   4
#define PSR_F   5
#define PSR_Z   6
#define PSR_N   7
#define PSR_U   8
#define PSR_S   9
#define PSR_P   10
#define PSR_I   11

/*
 * Sizes for strings
 */

#define S_SIZE    20
#define L_SIZE    270
#define VL_SIZE   1050

/*
 * Values for reset_type__. They are not defined in enumeration because they
 * are also used in assembly.
 */

#define RESET     0
#define NMI       1
#define DBG       2

/*
 * Values for trap_type__. They are not defined in enumeration because they
 * are also used in assembly. The numbering is according to the interrupt table
 * entries.
 */

#define NVI_TRAP  0
#define FPU_TRAP  3
#define ILL_TRAP  4
#define DVZ_TRAP  6
#define FLG_TRAP  7
#define UND_TRAP 10
#define RBE_TRAP 11
#define NBE_TRAP 12
#define OVF_TRAP 13

/* 
 * Definitions of Transparent communication support by default
 */
#ifndef TRANSPARENT
#define TRANSPARENT TRUE
#endif


/*
 * Definition of stack sizes
 */

#define IS_SIZE          0x400
#define C_IS_SIZE        0x1800


#ifdef LAN_IOBASE
#	define LAN_EXIST
#endif

#ifdef  DSPM_RAM_BASE
#define	DSPM_SUPPORT
#endif
