h8.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef _ARCH_H8_H_
  2. #define _ARCH_H8_H_
  3. /*
  4. * Copyright (C) 2004 by Jan Dubiec. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY JAN DUBIEC AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JAN DUBIEC
  23. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * $Log: h8.h,v $
  33. * Revision 1.1 2004/03/16 16:48:28 haraldkipp
  34. * Added Jan Dubiec's H8/300 port.
  35. *
  36. */
  37. /*
  38. * GCC for H8 microcontrolles defines following macros:
  39. * __H8300H__ when -mh switch is specified in the command line,
  40. * __H8300S__ when -ms switch is specified in the command line,
  41. * __H8300__ when none of above switches is specified.
  42. *
  43. */
  44. #if !defined(__H8300H__) && !defined(__H8300S__)
  45. #error "Nut/OS currently runs only on H8/300H or H8S microcontrollers."
  46. #endif
  47. /* H8/300 is big endian core */
  48. #if !defined(__BIG_ENDIAN__)
  49. #define __BIG_ENDIAN__
  50. #endif
  51. #include <dev/mweeprom.h>
  52. #define CONST const
  53. #define INLINE inline
  54. #define PSTR(p) (p)
  55. #define PRG_RDB(p) (*((const char *)(p)))
  56. #define prog_char const char
  57. #define PGM_P prog_char *
  58. #define SIGNAL(x) __attribute__((interrupt_handler)) void x(void)
  59. #define main NutAppMain
  60. #define strlen_P(x) strlen(x)
  61. #define strcpy_P(x,y) strcpy(x,y)
  62. #define strcmp_P(x, y) strcmp(x, y)
  63. #define memcpy_P(x, y, z) memcpy(x, y, z)
  64. #define fputs_P(x, y) fputs(x, y)
  65. #define fprintf_P fprintf
  66. /*!
  67. * \brief End of uninitialised data segment. Defined in the linker script.
  68. */
  69. extern void *__bss_end;
  70. /*!
  71. * \brief Begin of the stack segment. Defined in the linker script.
  72. */
  73. extern void *__stack;
  74. #define RAMSTART ((void *)0xffbf20)
  75. /* #define RAMEND (0xffbf20 + 0x4000) */
  76. #endif /* #ifndef _CPU_H8_H_ */