📄 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 (S1C38K) * 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 ){ /* All interrupts disable */ out_w(IRQ_DIS, 0xffffffff); /* All IRQs disable */ out_w(IRQ_LEVEL, 0x00000000); out_w(IRQ_POLAR, 0xffffffff); out_w(IRQ_CLR, 0xffffffff); out_w(FIQ_DIS, 0xffffffff); /* All FIQs disable */ out_w(FIQ_LEVEL, 0x00000000); out_w(FIQ_POLAR, 0xffffffff); out_w(FIQ_CLR, 0xffffffff); out_w(GPA_ENA, 0x00000000); /* All GPIO Port A disable */ out_w(GPB_ENA, 0x00000000); /* All GPIO Port B disable */ out_b(IRQ_MASK1, 0x00); /* All FPGA IRQ_STR1 disable */ /* Disable FPGA IRQ_STR2 except for the abort switch Abort switch is used by monitor */ out_b(IRQ_MASK2, in_b(IRQ_MASK2) & 0x05); /* Enable cascade connections */ out_w(FIQ_ENA, 0x00000001); /* FIQ 0 enable */ out_w(IRQ_ENA, 0x00000c00); /* IRQ 10,11 enable */ 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 + -