📄 root.c
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/demo/socktest/root.c,v 1.3 2003/01/15 14:04:57 josh Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** * All rights reserved. ****************************************************************************//***********************************************************************//* *//* MODULE: root.c *//* DATE: 98/6/23 *//* PURPOSE: Code for sample application 'ROOT' task *//* *//*---------------------------------------------------------------------*//* *//* Copyright 1991 - 1998 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. *//* *//***********************************************************************//* * $Log: root.c,v $ * Revision 1.3 2003/01/15 14:04:57 josh * directory structure shifting * * Revision 1.2 2001/11/09 22:10:14 josh * socktest path modifications, first pass * * Revision 1.1.1.1 2001/11/05 17:49:13 tneale * Tornado shuffle * * Revision 1.1 2001/04/24 18:53:14 paul * Initial revision. * *//* [clearcase]modification history-------------------01a,19apr05,job update copyright notices*/#include <wrn/wm/common/install.h>#include <sys_conf.h>#include <psos.h>#include <configs.h>#include <drv_intf.h>#include <probe.h>#include <prepc.h>#include <phile.h>#include <wrn/wm/demo/read_ini.h>#include <wrn/wm/demo/psosinit.h>#include <gsblk.h>#include <attache/psos/h/nidrv.h>#define SNARK_CLIENT_PRIO 190 /* Priority of the client task */#define SNARK_CLIENT_USRSTACK 1024 /* User stack size of client task */#define SNARK_CLIENT_SYSSTACK 4096 /* Supervisor stack size */#define SNARK_CLIENT_FLAGS 0x00 /* Flags for client task */#define SNARK_CLIENT_INITMODE T_SUPV /* Initial mode of the client task */#define NIDD_TASK_PRIORITY 191unsigned long AttTid;unsigned long AttKbdTid;extern NODE_CT *anchor;/***********************************************************************//* root: Code for the ROOT task *//* *//* NOTE: This executes as the 'ROOT' task. It suspends itself *//* when finished. *//* *//***********************************************************************/extern void psos_main (int, char **);void snark_task (){ char * main_argv[] = { "psos_main", (char *) 0 }; term_setup (); psos_main (1, main_argv);}void root(void){ ULONG i; printf ("System contains: "); if (anchor->pnact) printf ("pNA "); if (anchor->psosct) printf ("pSOS "); if (anchor->probect) printf ("pROBE "); if (anchor->philect) printf ("pHILE "); if (anchor->psect) printf ("pSE "); if (anchor->pmct) printf ("pMONT "); if (anchor->prepct) printf ("pREPC "); printf ("\n"); CreateNiDrvTask (NIDD_TASK_PRIORITY); if (t_create("ATTD", SNARK_CLIENT_PRIO, SNARK_CLIENT_SYSSTACK, SNARK_CLIENT_USRSTACK, SNARK_CLIENT_FLAGS, &AttTid) != 0) { printf("Task creation error (ATTD). Suspending root task.\n"); t_suspend (0L); } CreateKbdTask (100, GetAttacheQueueId (), AttTid); StartNiDrvTask (); if (t_start(AttTid, SNARK_CLIENT_INITMODE, snark_task, &i) != 0) { printf ("Task start error"); } StartKbdTask ();/*---------------------------------------------------------------------*//* That's the end of the 'ROOT' task, and the end of this application. *//* Now suspend the 'ROOT' task. *//*---------------------------------------------------------------------*/ printf("suspending root task\n"); t_suspend(0L);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -