📄 tkdev_init.c
字号:
/* *---------------------------------------------------------------------- * 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 (VR4131) * T-Kernel Device-Dependent Initialization/Finalization */#include "kernel.h"#include <tk/sysdef.h>#include <tk/syslib.h>#include <tm/tmonitor.h>#include "tkdev_conf.h"/* * Target system-dependant initialization */EXPORT ER tkdev_initialize( void ){ /* All interrupts disable */ out_h(MSYSINT1REG, 0); /* ICU */ out_h(MSYSINT2REG, 0); out_h(GIUINTENL, 0); /* GPIO */ out_h(GIUINTENH, 0); /* Enable GPIO interrupt on ICU */ out_h(MGIUINTLREG, 0xffff); out_h(MGIUINTHREG, 0xffff); /* Enable cascade connections */ EnableInt(VECNO_GPIO); /* Enable power on (T-Monitor) interrupt */ EnableInt(EIT_GPIO(2)); out_h(GIUIOSELL, in_h(GIUIOSELL) & ~0x0001); /* GPIO0 input */ SetIntMode(VECNO_FPGA, IM_LEVEL|IM_LOW); EnableInt(VECNO_FPGA); 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -