00001 #ifndef _ARCH_H8_H_ 00002 #define _ARCH_H8_H_ 00003 00004 /* 00005 * Copyright (C) 2004 by Jan Dubiec. All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. Neither the name of the copyright holders nor the names of 00017 * contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY JAN DUBIEC AND CONTRIBUTORS 00021 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00023 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JAN DUBIEC 00024 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00025 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00026 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00027 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00028 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00029 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00030 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 /* 00034 * $Log$ 00035 * Revision 1.1 2004/03/16 16:48:28 haraldkipp 00036 * Added Jan Dubiec's H8/300 port. 00037 * 00038 */ 00039 00040 /* 00041 * GCC for H8 microcontrolles defines following macros: 00042 * __H8300H__ when -mh switch is specified in the command line, 00043 * __H8300S__ when -ms switch is specified in the command line, 00044 * __H8300__ when none of above switches is specified. 00045 * 00046 */ 00047 00048 #if !defined(__H8300H__) && !defined(__H8300S__) 00049 #error "Nut/OS currently runs only on H8/300H or H8S microcontrollers." 00050 #endif 00051 00052 /* H8/300 is big endian core */ 00053 #if !defined(__BIG_ENDIAN__) 00054 #define __BIG_ENDIAN__ 00055 #endif 00056 00057 #include <dev/mweeprom.h> 00058 00059 #define CONST const 00060 #define INLINE inline 00061 00062 #define PSTR(p) (p) 00063 #define PRG_RDB(p) (*((const char *)(p))) 00064 00065 #define prog_char const char 00066 #define PGM_P prog_char * 00067 00068 #define SIGNAL(x) __attribute__((interrupt_handler)) void x(void) 00069 00070 #define main NutAppMain 00071 00072 #define strlen_P(x) strlen(x) 00073 #define strcpy_P(x,y) strcpy(x,y) 00074 #define strcmp_P(x, y) strcmp(x, y) 00075 #define memcpy_P(x, y, z) memcpy(x, y, z) 00076 #define fputs_P(x, y) fputs(x, y) 00077 #define fprintf_P fprintf 00078 00082 extern void *__bss_end; 00083 00087 extern void *__stack; 00088 00089 #define RAMSTART ((void *)0xffbf20) 00090 00091 /* #define RAMEND (0xffbf20 + 0x4000) */ 00092 00093 #endif /* #ifndef _CPU_H8_H_ */