📄 root.c
字号:
/* root.c
*
*------------------------------------------------------------
*
* I N T E L P R O P R I E T A R Y
*
* COPYRIGHT (c) 1998-1999 BY INTEL CORPORATION. ALL RIGHTS
* RESERVED. NO PART OF THIS PROGRAM OR PUBLICATION MAY
* BE REPRODUCED, TRANSMITTED, TRANSCRIBED, STORED IN A
* RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER
* LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,
* MAGNETIC, OPTICAL, CHEMICAL, MANUAL, OR OTHERWISE, WITHOUT
* THE PRIOR WRITTEN PERMISSION OF :
*
* INTEL CORPORATION
*
* 2200 MISSION COLLEGE BLVD
*
* SANTA CLARA, CALIFORNIA 95052-8119
*
*------------------------------------------------------------
* system: SA1200
* subsystem: uCOS
* author: Henry Qian 12/02/98
* revisions:
*
* Dan White - 03/31/00 added sysCpuVerGet and check for Rev-b board of ixp1200
* Dan White - 04/18/00 changed sysCpuVerGet to sysCpuVerMake
* Dan White - 04/19/00 add extern to ixp1200_syscpurev global
* Dan White - 09/06/00 add ixp1200_SysCpuID global
*
*/
#include <stdio.h>
#include "os.h" /* uC/OS interface */
#include "interrupts.h"
#define OS_ROOT_STK_SIZE 0x400
unsigned int rootTaskStack[OS_ROOT_STK_SIZE];
#define OS_CNSL_STK_SIZE 0x400
unsigned int consoleTaskStack[OS_CNSL_STK_SIZE];
PFV userInit;
unsigned int useConsole;
#ifdef __cplusplus
extern "C"
{
#endif
unsigned long sysCpuVerMake(void);
unsigned long sysCpuVerGet(void);
unsigned long sysCpuIDMake(void);
unsigned long sysCpuIDGet(void);
#ifdef __cplusplus
}
#endif
extern int IXP1200_SysCpuRev;
extern int IXP1200_SysCpuID;
/*
* Main entry to start uC/OS.
*/
void ucosStart(PFV userInit_in, unsigned int useConsole_in)
{
userInit = userInit_in;
useConsole = useConsole_in;
ENTER_SVC;
/* init uC/OS */
OSInit();
SAr_DisableInt();
/* get the rev of board to global */
sysCpuVerMake();
IXP1200_SysCpuRev = sysCpuVerGet();
/* get the cpu ID of board to global */
sysCpuIDMake();
IXP1200_SysCpuID = sysCpuIDGet();
OSTaskCreate( rootTask,
0,
(void *)&rootTaskStack[OS_ROOT_STK_SIZE],
0, /* Task priority, highest */
OS_ROOT_STK_SIZE*sizeof(int));
/* start uC/OS */
OSStart();
/* never reached */
} /* ucosStart */
void rootTask(void* IGNORE)
{
SAr_OsNotUseUART();
SA_InitIRQ();
SA_InitSysTimer();
if (useConsole == USE_CONSOLE)
{
OSTaskCreate( consoleTask,
0,
(void *)&consoleTaskStack[OS_CNSL_STK_SIZE],
0x3E, /* lowest priority */
OS_CNSL_STK_SIZE*sizeof(int));
}
printf("\nuC/OS started\n");
userInit(); /* first user routine to call */
printf("root done\n");
OSTaskDel(0); /* commit suicide */
}
/* end of file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -