hal_diag.h

Go to the documentation of this file.
00001 #ifndef CYGONCE_HAL_HAL_DIAG_H
00002 #define CYGONCE_HAL_HAL_DIAG_H
00003 
00004 //=============================================================================
00005 //
00006 //      hal_diag.h
00007 //
00008 //      HAL Support for Kernel Diagnostic Routines
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:     HAL Support for Kernel Diagnostic Routines
00050 // Description: Diagnostic routines for use during kernel development.
00051 // Usage:       #include <cyg/hal/hal_diag.h>
00052 //
00053 //####DESCRIPTIONEND####
00054 //
00055 //=============================================================================
00056 
00057 
00058 //=============================================================================
00059 //                            DOXYGEN FILE HEADER
00068 //=============================================================================
00069 
00070 
00071 //=============================================================================
00072 //                                  INCLUDES
00073 //=============================================================================
00074 #include <pkgconf/hal.h>
00075 #include <cyg/infra/cyg_type.h>
00076 
00077 
00078 //
00079 // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
00080 //
00081 // Virtual vector support allows the HAL to let the ROM monitor handle 
00082 // certain operations. The virtual vector table defines a calling interface 
00083 // between applications running in RAM and the ROM monitor.
00084 // All HAL IO happens via the virtual vector table / comm tables when those 
00085 // tables are supported by the HAL.
00086 //
00087 #if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
00088 #include <cyg/hal/hal_if.h>
00089 
00090 //=============================================================================
00091 //                              DIAGNOSTIC MACROS
00092 // DESCRIPTION:
00093 //     If CYGSEM_HAL_VIRTUAL_VECTOR_DIAG is defined, that means eCos ROM
00094 //     Monitor calling interface is enabled, then diag code uses the hal_if
00095 //     diag functions. 
00096 //=============================================================================
00097 //
00098 // we define the following macros conditionally and give the variant ant platform
00099 // HAL a chance of overwriting these macros
00100 //
00101 #define HAL_DIAG_INIT() hal_if_diag_init()
00102 #define HAL_DIAG_WRITE_CHAR(_c_) hal_if_diag_write_char(_c_)
00103 #define HAL_DIAG_READ_CHAR(_c_) hal_if_diag_read_char(&_c_)
00104 
00105 #endif // #if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
00106 
00107 
00108 #if !defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) || defined(CYGSEM_HAL_H8S_ADDITIONAL_DIAG_CODE)
00109 //=============================================================================
00110 //                                  EXTERNALS
00111 // NOTES:
00112 //     Functions implemented in hal_diag.c
00113 //=============================================================================
00114 externC void hal_plf_diag_init( void );
00115 externC void hal_diag_read_char(char *c);
00116 externC void hal_diag_write_char(char c);
00117 externC int  hal_diag_put_buf(const char *pbuf_in, int len_in);
00118 externC void hal_diag_put_string (unsigned char *pstr_in);
00119 externC void hal_diag_put_long(unsigned long l_in);
00120 externC void hal_diag_put_long_hex(long l_in);
00121 
00122 #endif // !defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) || defined(CYGSEM_HAL_ADDITIONAL_DIAG_CODE)
00123 
00124 
00125 #if !defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
00126 //=============================================================================
00127 //                              DIAGNOSTIC MACROS
00128 // DESCRIPTION:
00129 //     When vector table console code is not used, the we must map the 
00130 //     HAL_DIAG_INIT, HAL_DIAG_WRITE_CHAR and HAL_DIAG_READ_CHAR macros 
00131 //     directly to the low-level IO functions, hardwired to use a compile-time 
00132 //     configured channel.
00133 //=============================================================================
00134 #define HAL_DIAG_INIT() hal_plf_diag_init()
00135 #define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_)
00136 #define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_)
00137 
00138 #endif // End of #if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
00139 
00140 //-----------------------------------------------------------------------------
00141 // end of hal_diag.h                                                         
00142 #endif // CYGONCE_HAL_HAL_DIAG_H 

Generated on Tue Feb 17 09:06:12 2004 for eCos EDOSK-2674 HAL by doxygen 1.3.5