📄 tkdev_init.c
字号:
/* *---------------------------------------------------------------------- * T-Kernel * * Copyright (C) 2004-2006 by Ken Sakamura. All rights reserved. * T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * * Version: 1.02.02 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/9. * *---------------------------------------------------------------------- *//* * 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-dependent 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-dependent 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -