📄 sys_conf.h
字号:
/* * Copyright (C) 2002 Koninklijke Philips Electronics N.V., * All Rights Reserved. * * This source code and any compilation or derivative thereof is the * proprietary information of Koninklijke Philips Electronics N.V. * and is confidential in nature. * Under no circumstances is this software to be exposed to or placed * under an Open Source License of any type without the expressed * written permission of Koninklijke Philips Electronics N.V. * *############################################################ *//*! * \file sys_conf.template.h * * \brief - * *//*-----------------------------------------------------------* * * %version: 1 % * instance: DS_1 * %date_created: Tue Nov 23 14:03:01 2004 % * *############################################################ *//***********************************************************************//* *//* MODULE: sys_conf.h *//* DATE: Updated 2003 for TriMedia *//* 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/***********************************************************************//* The defines close to the top of this file are more likely to be *//* used in TriMedia programs. *//***********************************************************************//*---------------------------------------------------------------------*//* pSOS+ configuration parameters *//* These parameters determine the operation of the pSOS kernel. *//* The number of objects are usually tuned to an application *//*---------------------------------------------------------------------*/#define KC_NTASK 103 /* max number of tasks */#define KC_NQUEUE 100 /* max number of message queues */#define KC_NSEMA4 64 /* max number of semaphores */#define KC_NMUTEX 64 /* max number of mutexes */#define KC_NTIMER 10 /* max number of timers *//*---------------------------------------------------------------------*//* The number above are "Local Objects." The total number used *//* at any time must be less than the following define *//*---------------------------------------------------------------------*/#define KC_NLOCOBJ 256 /* max number of local objects *//*---------------------------------------------------------------------*/#define KC_NMSGBUF (128*32) /* number of message buffers used for queues *//*---------------------------------------------------------------------*/#define KC_TICKS2SEC 100 /* clock tick interrupt frequency */#define KC_TICKS2SLICE 10 /* time slice quantum, in ticks *//*---------------------------------------------------------------------*//* The system stack can be used for interrupts */ #define KC_SYSSTK 0x8000 /* pSOS+ system stack size (bytes) *//*---------------------------------------------------------------------*/#define KC_ROOTSSTK 0x8000 /* ROOT supervisor stack size */#define KC_ROOTUSTK 0x8000 /* ROOT user stack size */#define KC_ROOTMODE 0x2000 /* ROOT initial mode */#define KC_ROOTPRI 230 /* ROOT task priority *//*---------------------------------------------------------------------*//*---------------------------------------------------------------------*//* 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#else#define KC_FATAL 0#endif/*---------------------------------------------------------------------*//* Prototype of task switch function is: *//* extern void MySwitchHandler ( *//* long entering_tid, *//* void* entering_tcb, *//* long leaving_tid, *//* void* leaving_tcb *//* ); *//*---------------------------------------------------------------------*/#if defined (USE_TMPROFILER)extern void tmosProfileTaskSwitchFunc ( unsigned long entering_tid, void* entering_tcb, unsigned long leaving_tid, void* leaving_tcb);#define KC_SWITCHCO ((void (*)()) tmosProfileTaskSwitchFunc) /* callout at task switch */#else#define KC_SWITCHCO 0#endif/*---------------------------------------------------------------------*/#if 0 extern void MyStartHandler ( long starting_tid, void* starting_tcb );#define KC_STARTCO MyStartHandler#else#define KC_STARTCO 0#endif/*---------------------------------------------------------------------*/#if 0 extern void MyDeleteHandler ( long starting_tid, void* starting_tcb );#define KC_DELETECO MyDeleteHandler#else#define KC_DELETECO 0#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -