📄 psecfg.c
字号:
/***********************************************************************//* *//* MODULE: psecfg.c 1.3 *//* DATE: 17:57:18 - 97/12/05 *//* PURPOSE: pSE+ configuration file *//* *//*---------------------------------------------------------------------*//* *//* 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 code in this module controls the configuration of the *//* pSE+ componet. Many configurations are possible, based on *//* these inputs: *//* * Options selected in "sys_conf.h" *//* *//***********************************************************************/#if defined(__cplusplus)extern "C" {#endif#include "sys_conf.h"#if (SC_PSE)#include <configs.h>#include "bsp.h"#include <bspfuncs.h>#if (SC_PSKT)#include <sys/socket.h>#endifextern void pse(void);extern void ptli(void);extern void pskt(void);long lbolt; /* lbolt variable */long HZ; /* clock tick interrupt frequency *//*---------------------------------------------------------------------*//* pSE+ configuration table. The definitions for this is *//* contained in <configs.h>. *//*---------------------------------------------------------------------*/pSE_CT PseCfg;pseappsc_t appsc_ct;psedrvcfg_t pse_modules[SE_MAX_PSE_MODULES + 1];psebufcfg_t pse_strbufs[SE_MAX_PSE_STRBUFS + 1];#if (SC_PTLI) unsigned long ptli_ct[1]; extern void TIRW_modinit(); extern struct streamtab tirwinfo; const psedrvparam_t tirw_mod = {"tirw", DT_MODULE, &tirwinfo, 0, 0}; extern void TIMOD_modinit(); extern struct streamtab timodinfo; const psedrvparam_t timod_mod = {"timod", DT_MODULE, &timodinfo, 0, 0};#endif#if (SC_PSKT) unsigned long pskt_ct[2]; extern void SOMOD_modinit(); extern struct streamtab somodinfo; const psedrvparam_t somod_mod = {"sockmod", DT_MODULE, &somodinfo, 0, 0}; const struct netconfig pskt_netconfig[] = {#if (SC_DEV_OTCP)#include <sys/spna_nc.h>#endif#if (SC_DEV_SOSI)#include <sys/sosi_nc.h>#endif {0, 0, 0, 0} };#endif/***********************************************************************//* PseSetup: Setup pSE+ componet *//* *//* INPUTS: FreeMemPtr pointer to free memory area that can be *//* used to allocate memory for this componet. *//* *//* NodeCfg pointer to the systems node configuration *//* table. This will be used to set the psect *//* element in the table. *//* *//* RETURNS: The new FreeMemPtr is returned. *//* *//***********************************************************************/UCHAR *PseSetup(UCHAR *FreeMemPtr, NODE_CT *NodeCfg){int i;HZ = KC_TICKS2SEC;/*---------------------------------------------------------------------*//* Build the pSE configuration table *//*---------------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ /* setup TLI, if installed */ /*-----------------------------------------------------------------*/i = 0;#if (SC_PTLI) ptli_ct[0] = (unsigned long)ptli; /* start of the code */ appsc_ct.tli_ct = (long)ptli_ct; /* address of pTLI table */ pse_modules[i].drv_init = TIMOD_modinit; pse_modules[i].drv_param = (psedrvparam_t *)&timod_mod; i++; pse_modules[i].drv_init = TIRW_modinit; pse_modules[i].drv_param = (psedrvparam_t *)&tirw_mod; i++;#endif /*-----------------------------------------------------------------*/ /* setup SOCKET, if installed */ /*-----------------------------------------------------------------*/#if (SC_PSKT) pskt_ct[0] = (unsigned long)pskt; /* start of the code */ pskt_ct[1] = (unsigned long)pskt_netconfig; /* netconfig for socket */ appsc_ct.skt_ct = (long)pskt_ct; /* address of pSKT table */ pse_modules[i].drv_init = SOMOD_modinit; pse_modules[i].drv_param = (psedrvparam_t *)&somod_mod; i++;#endif /*-----------------------------------------------------------------*/ /* end of STREAMS modules */ /*-----------------------------------------------------------------*/ pse_modules[i].drv_init = 0; pse_modules[i].drv_param = 0; /*-----------------------------------------------------------------*/ /* setup STREAMS buffers configuration */ /*-----------------------------------------------------------------*/ i = 0;#if NBUFS_0 pse_strbufs[i].n_bufs = NBUFS_0; pse_strbufs[i].b_size = 0; i++;#endif#if NBUFS_32 pse_strbufs[i].n_bufs = NBUFS_32; pse_strbufs[i].b_size = 32; i++;#endif#if NBUFS_64 pse_strbufs[i].n_bufs = NBUFS_64; pse_strbufs[i].b_size = 64; i++;#endif#if NBUFS_128 pse_strbufs[i].n_bufs = NBUFS_128; pse_strbufs[i].b_size = 128; i++;#endif#if NBUFS_256 pse_strbufs[i].n_bufs = NBUFS_256; pse_strbufs[i].b_size = 256; i++;#endif#if NBUFS_512 pse_strbufs[i].n_bufs = NBUFS_512; pse_strbufs[i].b_size = 512; i++;#endif#if NBUFS_1024 pse_strbufs[i].n_bufs = NBUFS_1024; pse_strbufs[i].b_size = 1024; i++;#endif#if NBUFS_2048 pse_strbufs[i].n_bufs = NBUFS_2048; pse_strbufs[i].b_size = 2048; i++;#endif#if NBUFS_4096 pse_strbufs[i].n_bufs = NBUFS_4096; pse_strbufs[i].b_size = 4096; i++;#endifpse_strbufs[i].n_bufs = 0;pse_strbufs[i].b_size = 0; /*-----------------------------------------------------------------*/ /* initialize the main configuration structure of pSE */ /*-----------------------------------------------------------------*/PseCfg.se_data_area = (char *)FreeMemPtr;PseCfg.se_data_size = SE_DATA_SIZE;FreeMemPtr = FreeMemPtr + SE_DATA_SIZE;PseCfg.se_code_start = (void *)pse;PseCfg.se_task_prio = SE_TASK_PRIO;PseCfg.se_stack_size = SE_STACK_SIZE;PseCfg.se_def_uid = SE_DEF_UID;PseCfg.se_def_gid = SE_DEF_GID;PseCfg.se_lbolt = &lbolt;PseCfg.se_appsc_ct = &appsc_ct;PseCfg.se_drvcfg = pse_modules;PseCfg.se_bufcfg = pse_strbufs;PseCfg.se_n_fds = SE_N_FDS;PseCfg.se_n_taskfds = SE_N_TASKFDS;PseCfg.se_n_links = SE_N_LINKS;PseCfg.se_n_timeouts = SE_N_TIMEOUTS;PseCfg.se_n_bufcalls = SE_N_BUFCALLS;PseCfg.se_n_queues = SE_N_QUEUES;PseCfg.se_n_mblks = SE_N_MBLKS;PseCfg.se_monmask = 0;PseCfg.se_monproc = (void (*)())0;PseCfg.se_reserved[0] = 0;PseCfg.se_reserved[1] = 0; /*-----------------------------------------------------------------*/ /* place pSE into the Node Configuration Table */ /*-----------------------------------------------------------------*/NodeCfg->psect = &PseCfg;return(FreeMemPtr);}#else static void stub(void){}#endif#if defined(__cplusplus)}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -