⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nocfg3s.h

📁 NORTi3 is a realtime multitasking operating system conforming to the micro-ITRON 3.0 specification.
💻 H
字号:
/******************************************************************************
* NORTi3 Standard Configuration Header                                        *
*                                                                             *
*  Copyright (c)  1995-2000, MiSPO Co., Ltd.                                  *
*  All rights reserved.                                                       *
*                                                                             *
* 03/Apr/2000                                                                 *
* 30/Oct/2001  The semicolon of extern "C" { ... }; is deleted.               *
******************************************************************************/
#ifndef NOCFG3S_H
#define NOCFG3S_H

#include "nosys3s.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef NULL
#define NULL    ((void *)0)
#endif

/* Constants for Configuration */

#ifndef TSKID_MAX
#define TSKID_MAX   8               /* 1 ~ 250 */
#endif
#ifndef SEMID_MAX
#define SEMID_MAX   1               /* 1 ~ 999 */
#endif
#ifndef FLGID_MAX
#define FLGID_MAX   1               /* 1 ~ 999 */
#endif
#ifndef MBXID_MAX
#define MBXID_MAX   1               /* 1 ~ 999 */
#endif
#ifndef MBFID_MAX
#define MBFID_MAX   1               /* 1 ~ 999 */
#endif
#ifndef MPFID_MAX
#define MPFID_MAX   1               /* 1 ~ 999 */
#endif
#ifndef CYCNO_MAX
#define CYCNO_MAX   1               /* 1 ~ 250 */
#endif
#ifndef ALMNO_MAX
#define ALMNO_MAX   1               /* 1 ~ 250 */
#endif
#ifndef TPRI_MAX
#define TPRI_MAX    8               /* 1 ~ 31 */
#endif
#ifndef TMRQSZ
#define TMRQSZ      1               /* 1,2,4,8,16,32,64,128,256 */
#endif
#ifndef CYCQSZ
#define CYCQSZ      1               /* 1,2,4,8,16,32,64,128,256 */
#endif
#ifndef ALMQSZ
#define ALMQSZ      1               /* 1,2,4,8,16,32,64,128,256 */
#endif
#ifndef ISTKSZ
#define ISTKSZ      512
#endif
#ifndef TSTKSZ
#define TSTKSZ      512
#endif
#ifndef MPLMSZ
#define MPLMSZ      0               /* 0: use stack area */
#endif
#ifndef STKMSZ
#define STKMSZ      0               /* 0: use default stack area */
#endif

#ifndef KNL_LEVEL
#if (defined(CPU_H83)||(defined(CPU_H8S)&&defined(INTM1)))
#define KNL_LEVEL   2
#elif (defined(CPU_68K)||defined(CPU_H8S)||defined(CPU_H85))
#define KNL_LEVEL   5
#elif defined(CPU_SH)
#define KNL_LEVEL   14
#elif (defined(CPU_ARM)||defined(CPU_THUMB))
#define KNL_LEVEL   2
#elif defined(CPU_PPC)
#define KNL_LEVEL   -1
#endif
#endif

/* Configuration Information */

const T_RCFG cdecl CFG =
{   TSKID_MAX,
    SEMID_MAX,
    FLGID_MAX,
    MBXID_MAX,
    MBFID_MAX,
    0,
    0,
    MPFID_MAX,
    CYCNO_MAX,
    ALMNO_MAX,
    TPRI_MAX,
    TMRQSZ,
    CYCQSZ,
    ALMQSZ,
    ISTKSZ,
    TSTKSZ,
    0,
    MPLMSZ,
    STKMSZ,
};
const T_VER FAR * const cdecl norti_ver = &_NORTI_VER;

/* Status Register Value of Kernel */

#if defined(CPU_68K)
const UH KNL_SR = 0x2000|((KNL_LEVEL)<<8);
#elif defined(CPU_H8S)
#if defined(INTM0)
const UH KNL_CCR = 0x8000;
#elif defined(INTM1)
#if KNL_LEVEL==1
const UH KNL_CCR = 0x8000;
#else
const UH KNL_CCR = 0xc000;
#endif
#else
const UH KNL_EXR = (KNL_LEVEL)<<8;
#endif
#elif defined(CPU_H85)
const UH KNL_SR = (KNL_LEVEL)<<8;
#elif defined(CPU_SH)
#if (defined(SH3)||defined(SH3E)||defined(SH4))
const UW KNL_SR = 0x40000000|((KNL_LEVEL)<<4); /* MD=1,RB=0,BL=0 */
#else
const UH KNL_SR = (KNL_LEVEL)<<4;
#endif
#elif (defined(CPU_ARM)||defined(CPU_THUMB))
const UH KNL_SR = (KNL_LEVEL)<<6;
#elif defined(CPU_H83)
#if defined(INTM0)
const UH KNL_CCR = 0x8000;
#elif KNL_LEVEL==1
const UH KNL_CCR = 0x8000;
#else
const UH KNL_CCR = 0xc000;
#endif
#elif defined(CPU_R3000)
const UW KNL_SR = 0xffff00fe;
#elif defined(CPU_PPC)
#if defined(INT_SIU)
const UW KNL_SR = (16-KNL_LEVEL);
#else
const UW KNL_SR = 0x00000010;
#endif
#endif

/* Kernel Internal Data */

T_TCB NEAR cdecl _TCB[TSKID_MAX+1];
T_SEM NEAR cdecl _SEM[SEMID_MAX];
T_FLG NEAR cdecl _FLG[FLGID_MAX];
T_MBX NEAR cdecl _MBX[MBXID_MAX];
T_MBF NEAR cdecl _MBF[MBFID_MAX];
T_MPF NEAR cdecl _MPF[MPFID_MAX];
T_CYC NEAR cdecl _CYC[CYCNO_MAX];
T_ALM NEAR cdecl _ALM[ALMNO_MAX];

SYSTIME NEAR cdecl SYSCK;
#if (SIZEOF_INT == 1)
UB NEAR IMASK;
#elif (defined(SH3) || defined(CPU_R3000) || defined(CPU_PPC))
UW NEAR cdecl IMASK;
#else
UH NEAR cdecl IMASK;
#endif
UH NEAR cdecl IDLCNT;
ER NEAR cdecl SYSER;
volatile B NEAR cdecl NOWPRI;
volatile B NEAR cdecl DELAY;
volatile B NEAR cdecl INEST;
volatile B NEAR cdecl DDISP;
volatile B NEAR cdecl SDISP;
volatile B NEAR cdecl TMREQ;
UB NEAR cdecl TMQMS;
UB NEAR cdecl CHQMS;
UB NEAR cdecl AHQMS;
UINT NEAR cdecl CTXPTN;
VP NEAR cdecl CTXPTR;
B FAR * NEAR cdecl ISP;
T_NMEM NEAR * NEAR cdecl SYSTOP;
T_MEM * NEAR cdecl MPLTOP;
T_MEM * NEAR cdecl STKTOP;
UB NEAR cdecl RDQ[TPRI_MAX+2];
UB NEAR cdecl TMQ[TMRQSZ];
UB NEAR cdecl CHQ[CYCQSZ];
UB NEAR cdecl AHQ[ALMQSZ];

#if ((MPLMSZ)/SIZEOF_INT!=0)
int * const cdecl pMPLMEM = MPLMEM;
#else
int * const cdecl pMPLMEM = NULL;
#endif

#if ((STKMSZ)/SIZEOF_INT!=0)
int * const cdecl pSTKMEM = STKMEM;
#else
int * const cdecl pSTKMEM = NULL;
#endif

/* ROMable NORTi3/86 only */

#if (defined(CPU_86)&&defined(ROM))
#if defined(__TURBOC__)
#if (defined(__SMALL__)||defined(__MEDIUM__))
#define sysini  sysini_rom
#endif
#elif defined(M_I86) /* MS-C */
#define sysini  sysini_rom
#if (_MSC_VER>=700)
UH NEAR cdecl STKHQQ = 0;
#else
UH NEAR pascal STKHQQ = 0;
#endif
#endif
#endif

#ifdef __cplusplus
}
#endif

#endif  /* NOCFG3S_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -