tkdev_init.c
来自「嵌入式操作系统T-Kernel 完整代码」· C语言 代码 · 共 65 行
C
65 行
/* *---------------------------------------------------------------------- * T-Kernel * * Copyright (C) 2004 by Ken Sakamura. All rights reserved. * T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * * Version: 1.01.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2004/6/28. * *---------------------------------------------------------------------- *//* * tkdev_init.c (M32104) * T-Kernel Device-Dependent Initialization/Finalization */#include "kernel.h"#include <tk/sysdef.h>#include <tk/syslib.h>#include <tm/tmonitor.h>EXPORT UW TimerClkDiv; /* Dividing rate of timer clock *//* * Target system-dependant initialization */EXPORT ER tkdev_initialize( void ){ INT i; /* Disable all ext. interrupts */ for ( i = 1; i <= 63; ++i ) { /* Exclude INT5 because it is used by the monitor */ if ( i == 6 ) continue; out_w(ICU1_CR(i), ICUCR_IREQ | 7); } for ( i = 1; i <= 31; ++i ) out_h(ICU2_CR(i), ICUCR_IREQ | 7); /* Enable acceptance of ICU2 (PLD ICU) connected to cascade */ SetIntMode(VECNO_ICU2, ISMOD_LEVEL_H); EnableInt(VECNO_ICU2, ICU2_INTLEVEL); /* Enable all levels of interrupts */ out_w(ICU1_IMASK, 0x70000); return E_OK;}/* Target system-dependant finalization * Normally jump to ROM monitor. * No return from this function. */EXPORT void tkdev_exit( void ){ disint(); tm_exit(0); /* Turn off power and exit */ /* Not suppose to return from 'tm_exit,' but just in case */ for ( ;; ) tm_monitor(); /* To T-Monitor */}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?