⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 var_intr.h

📁 ecos移植到R8H系列的源码。源码包来自http://www.cetoni.de/develop/develop_ecosh8s_en.html
💻 H
字号:
#ifndef CYGONCE_HAL_VAR_INTR_H
#define CYGONCE_HAL_VAR_INTR_H
//==========================================================================
//
//      var_intr.h
//
//      H8S Interrupt and clock support
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    yoshinori sato
// Contributors: yoshinori sato, Uwe Kindler
// Date:         2003-12-06
// Purpose:      H8S Interrupt Support
// Description:  The macros defined here provide the HAL APIs for handling
//               interrupts and the clock for H8S/2674 variants of the H8S
//               architecture.
//              
// Usage:
//              #include <cyg/hal/var_intr.h>
//              ...
//              
//
//####DESCRIPTIONEND####
//
//==========================================================================


//==========================================================================
//                                 INCLUDES
//==========================================================================
#include <pkgconf/hal.h>

#include <cyg/infra/cyg_type.h>

#include <cyg/hal/plf_intr.h>
#include <cyg/hal/var_arch.h>
#include <cyg/hal/var_intr_numbers.h>  // interrupt vector numbers


//==========================================================================
//                          VECTOR TRANSLATION
// DESCRIPTION:
//     Offers the possibillity to do some vector translation before
//     indexing into vector tables. H8S Interrupt vectors start at
//     vector CYGNUM_HAL_ISR_MIN so we have to sub CYGNUM_HAL_ISR_MIN
//     from vector in order to get the index into isr tables.
//==========================================================================
#if !defined(CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN)
#define HAL_TRANSLATE_VECTOR(_vector_, _index_)              \
        ((_index_) = (_vector_))
#endif // HAL_TRANSLATE_VECTOR


//==========================================================================
//                     INTERRUPT CONTROLLER MANAGEMENT
// DESCRIPTION:
//     These macros exert control over any prioritized interrupt controller 
//     that is present. If no priority controller exists, then these macros 
//     should be empty.
//
// NOTES:
//     Interrupt controller access
//     Read interrupt control registers back after writing to them. This
//     ensures that the written value is not sitting in the store buffers
//     when interrupts are re-enabled. It is all handled in var_misc.c
//==========================================================================

//--------------------------------------------------------------------------
// HAL_INTERRUPT_CONFIGURE provides control over how an interrupt signal is 
// detected.
//
externC void hal_interrupt_configure(int vector,int level,int up);
#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ )          \
        hal_interrupt_configure( _vector_, _level_, _up_ )

//--------------------------------------------------------------------------
// HAL_INTERRUPT_MASK() causes the interrupt associated with the given
// vector to be blocked.
//
externC void hal_interrupt_mask(int vector);
#define HAL_INTERRUPT_MASK( _vector_ )                          \
        hal_interrupt_mask( _vector_ )

//--------------------------------------------------------------------------
// HAL_INTERRUPT_UNMASK() causes the interrupt associated with the given 
// vector to be unblocked.
//
externC void hal_interrupt_unmask(int vector);
#define HAL_INTERRUPT_UNMASK( _vector_ )                        \
        hal_interrupt_unmask( _vector_ )

//--------------------------------------------------------------------------
// HAL_INTERRUPT_ACKNOWLEDGE() acknowledges the current interrupt from the 
// given vector. This is usually executed from the ISR for this vector when 
// it is prepared to allow further interrupts.
//
externC void hal_interrupt_acknowledge(int vector);
#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ )                   \
        hal_interrupt_acknowledge( _vector_ )

//--------------------------------------------------------------------------
// HAL_INTERRUPT_SET_LEVEL() provides control over the hardware priority of 
// the interrupt. The arguments are:
//
externC void hal_interrupt_set_level(int vector,int level);
#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ )            \
        hal_interrupt_set_level( _vector_, _level_ )


//--------------------------------------------------------------------------
//
//
#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY
#define HAL_CLOCK_LATENCY(_pvalue_) HAL_CLOCK_READ(_pvalue_)
#endif

//--------------------------------------------------------------------------
#endif // ifndef CYGONCE_HAL_VAR_INTR_H
// End of var_intr.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -