📄 sys_conf.h
字号:
/***********************************************************************/
/* */
/* MODULE: sys_conf.h */
/* DATE: 1.4 */
/* PURPOSE: pSOSystem configuration definitions */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1991 - 1995, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* This is a header file which defines all of the system-level */
/* parameters that are likely to need changing. */
/* */
/* It has been set up to be as close as possible to the settings */
/* which are appropriate for this application. However, you may */
/* need to make some changes to parameters to reflect your */
/* environment, such as IP addresses, etc. */
/* */
/* Chapter 7 of the pSOSystem Getting Started manual contains a */
/* complete description of the symbols that are defined in this */
/* file. */
/* */
/***********************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef _SYS_CONF_H
#define _SYS_CONF_H
/***********************************************************************/
/* */
/* These symbols are used to define other symbols in this file. */
/* They should never be changed. */
/* */
/***********************************************************************/
#define YES 1
#define NO 0
/*---------------------------------------------------------------------*/
/* User- installable callback functions: */
/* */
/* The following macros can be used for installing functions to be */
/* called at the following events: */
/* */
/* KC_FATAL at fatal error */
/* KC_STARTCO at task start */
/* KC_DELETECO at task deletion */
/* KC_SWITCHCO at task switch */
/* */
/* The required prototypes of the callback functions are as shown */
/* below. The names of the callback functions may be altered. */
/* When enabled, the implementations of the callback function must be */
/* provided elsewhere. For instance, a fatal error handler might be */
/* enabled by adding the following code to e.g. root.c, and changing */
/* the corresponding '#if 0' below to an '#if 1": */
/* */
/* extern void MyFatalHandler( */
/* long error */
/* long node */
/* ) */
/* { */
/* printf("pSOS execution terminated due to" */
/* " fatal error 0x%08x on node %d\n", */
/* error, node ); */
/* } */
/* */
/* NOTE1: The functions KC_STARTCO, KC_DELETECO, and KC_SWITCHCO */
/* identify the started-, deleted, and switched tasks by means */
/* of both their task id (tid, as returned by t_create), and */
/* pointers to their task control blocks (tcb). The useful */
/* contents of the task control blocks can be obtained by */
/* the pseudo psos function t_taskinfo, and therefore the */
/* tcb pointers should not be used. */
/* */
/* NOTE2: The functions KC_STARTCO, KC_DELETECO, and KC_SWITCHCO are */
/* called in kernel context, which is to be treated similar to */
/* interrupt service routines. For this reason, no calls to */
/* functions that might block are allowed. More specifically, */
/* calls to printf etc are not allowed. DP is allowed, and so */
/* is t_taskinfo. */
/* */
/*---------------------------------------------------------------------*/
#if 0
extern void MyFatalHandler(
long error,
long node
);
#define KC_FATAL MyFatalHandler
#endif
/*---------------------------------------------------------------------*/
#if 0
extern void MySwitchHandler (
long entering_tid,
void* entering_tcb,
long leaving_tid,
void* leaving_tcb
);
#define KC_SWITCHCO MySwitchHandler
#endif
/*---------------------------------------------------------------------*/
#if 0
extern void MyStartHandler (
long starting_tid,
void* starting_tcb
);
#define KC_STARTCO MyStartHandler
#endif
/*---------------------------------------------------------------------*/
#if 0
extern void MyDeleteHandler (
long starting_tid,
void* starting_tcb
);
#define KC_DELETECO MyDeleteHandler
#endif
/*---------------------------------------------------------------------*/
/***********************************************************************/
/* */
/* C O M P O N E N T C O N F I G U R A T I O N P A R A M E T E R S */
/* */
/* These parameters should work as is for this application. You */
/* may want to change some of them if you start customizing this */
/* application. */
/* */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/* pSOS+ configuration parameters */
/*---------------------------------------------------------------------*/
#define KC_RN0USIZE 0x100 /* region 0 unit size */
#define KC_NTASK 12 /* max number of tasks */
#define KC_NQUEUE 10 /* max number of message queues */
#define KC_NSEMA4 30 /* max number of semaphores */
#define KC_NMSGBUF 100 /* max number of message buffers */
#define KC_NTIMER 10 /* max number of timers */
#define KC_NLOCOBJ 50 /* max number of local objects */
#define KC_TICKS2SEC 100 /* clock tick interrupt frequency */
#define KC_TICKS2SLICE 10 /* time slice quantum, in ticks */
#define KC_ROOTSSTK 0x10000 /* ROOT supervisor stack size */
#define KC_ROOTUSTK 0x10000 /* ROOT user stack size */
#define KC_ROOTMODE 0x2000 /* ROOT initial mode */
#define KC_ROOTPRI 230 /* ROOT task priority */
/*---------------------------------------------------------------------*/
/* pSOS memory management */
/*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/* Stack overflow check. The following macro defines the number of */
/* bytes at the end of the stack (of each task) which will be filled */
/* with a known pattern, and which will be checked for being */
/* overwritten at each system call. In case overwrite is detected, */
/* then pSOS execution will abort with fatal error FAT_STKOVF (0xF30) */
/* SC_STACK_OVF_CHECK will be truncated to an integral number of words.*/
/* It has a default of 8 bytes (but set to a slightly higher value */
/* below). */
/*---------------------------------------------------------------------*/
#define SC_STACK_OVF_CHECK 24
/*---------------------------------------------------------------------*/
/* TCS_MALLOC_USE: When YES, do *not* map malloc/free on */
/* rn_getseg/rn_free from region 0, as is standard*/
/* in pSOS. Instead, use the TCS memory manager */
/* instead. */
/* The pSOS region manager might be more */
/* predictable in its real-time behavior, but this*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -