00001 #ifndef CYGONCE_HAL_PLF_INTR_H 00002 #define CYGONCE_HAL_PLF_INTR_H 00003 00004 //========================================================================== 00005 // 00006 // plf_intr.h 00007 // 00008 // EDOSK-2674R interrupt and clock support 00009 // 00010 //========================================================================== 00011 //####ECOSGPLCOPYRIGHTBEGIN#### 00012 // ------------------------------------------- 00013 // This file is part of eCos, the Embedded Configurable Operating System. 00014 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. 00015 // 00016 // eCos is free software; you can redistribute it and/or modify it under 00017 // the terms of the GNU General Public License as published by the Free 00018 // Software Foundation; either version 2 or (at your option) any later version. 00019 // 00020 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY 00021 // WARRANTY; without even the implied warranty of MERCHANTABILITY or 00022 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00023 // for more details. 00024 // 00025 // You should have received a copy of the GNU General Public License along 00026 // with eCos; if not, write to the Free Software Foundation, Inc., 00027 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00028 // 00029 // As a special exception, if other files instantiate templates or use macros 00030 // or inline functions from this file, or you compile this file and link it 00031 // with other works to produce a work based on this file, this file does not 00032 // by itself cause the resulting work to be covered by the GNU General Public 00033 // License. However the source code for this file must still be made available 00034 // in accordance with section (3) of the GNU General Public License. 00035 // 00036 // This exception does not invalidate any other reasons why a work based on 00037 // this file might be covered by the GNU General Public License. 00038 // 00039 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. 00040 // at http://sources.redhat.com/ecos/ecos-license/ 00041 // ------------------------------------------- 00042 //####ECOSGPLCOPYRIGHTEND#### 00043 //========================================================================== 00044 //#####DESCRIPTIONBEGIN#### 00045 // 00046 // Author(s): yoshinori sato 00047 // Contributors: yoshinori sato, Uwe Kindler 00048 // Date: 2003-12-06 00049 // Purpose: Define Interrupt support 00050 // Description: The macros defined here provide the HAL APIs for handling 00051 // interrupts and the clock. 00052 // 00053 // Usage: 00054 // #include <cyg/hal/plf_intr.h> 00055 // ... 00056 // 00057 // 00058 //####DESCRIPTIONEND#### 00059 // 00060 //========================================================================== 00061 00062 00063 //========================================================================== 00064 // DOXYGEN FILE HEADER 00074 //========================================================================== 00075 00076 00077 //========================================================================== 00078 // HARDWARE PLATFORM RESET 00079 // DESCRIPTION: 00080 // The reset() function defined in hal_if.c will attempt to do a 00081 // hardware reset by calling this macro, but if this fails it will fall 00082 // back to simply jumping to the reset entry-point 00083 // (HAL_PLATFORM_RESET_ENTRY). 00084 // 00085 // NOTES: 00086 // This is a real hardware reset by triggering the internal h8s watchdog 00087 //========================================================================== 00088 externC void h8s_reset_watchdog (void); 00089 #define HAL_PLATFORM_RESET() h8s_reset_watchdog() 00090 00091 00092 //========================================================================== 00093 // MANUAL RESET 00094 // DESCRIPTION: 00095 // The call to this macro will execute a manual reset. This means the 00096 // whole initialisation code starting at _start label will be 00097 // executed again. 00098 // 00099 // NOTES: 00100 // h8s_reset_manual is implemented in hal_misc.c 00101 //========================================================================== 00102 externC void h8s_reset_manual (void); 00103 #define HAL_PLATFORM_RESET_ENTRY &h8s_reset_manual 00104 00105 00106 //========================================================================== 00107 // DELAY uS 00108 // 00109 // This is an optional definition. 00126 //========================================================================== 00127 externC void hal_delay_us(cyg_uint32 usecs); 00128 #define HAL_DELAY_US(n) hal_delay_us(n) 00129 00130 00131 //========================================================================== 00132 // CLOCK CONTROL 00133 // DESCRIPTION: 00134 // These macros provide control over a clock or timer device that may 00135 // be used by the kernel to provide time-out, delay and scheduling 00136 // services. 00137 // 00138 // NOTES: 00139 // Clock control is all handled in plf_misc.c 00140 //========================================================================== 00141 00142 //-------------------------------------------------------------------------- 00143 // HAL_CLOCK_INITIALIZE() initializes the timer device to interrupt at 00144 // the given period. 00145 // 00146 externC void hal_clock_initialize(cyg_uint32 period); 00147 #define HAL_CLOCK_INITIALIZE( _period_ ) \ 00148 hal_clock_initialize( _period_ ) 00149 00150 //-------------------------------------------------------------------------- 00151 // HAL_CLOCK_RESET() Re-initializes the timer to provoke the next interrupt. 00152 // This macro is only really necessary when the timer device needs to 00153 // be reset in some way after each interrupt - this is not necessary for 00154 // h8s interrupts so we define it empty 00155 // 00156 #define HAL_CLOCK_RESET( _vector_, _period_ ) 00157 00158 //-------------------------------------------------------------------------- 00159 // HAL_CLOCK_READ() reads the current value of the timer counter and puts 00160 // the value in the location pointed to by pvalue. 00161 // 00162 externC void hal_clock_read(cyg_uint32 *pvalue); 00163 #define HAL_CLOCK_READ( _pvalue_ ) \ 00164 hal_clock_read( _pvalue_ ) 00165 00166 00167 //-------------------------------------------------------------------------- 00168 #endif // ifndef CYGONCE_HAL_PLF_INTR_H 00169 // End of plf_intr.h
1.3.5