memory.h

Go to the documentation of this file.
00001 /*      memory.h
00002 
00003         Copyright 2008 Fred Cooke
00004 
00005         This file is part of the FreeEMS project.
00006 
00007         FreeEMS software is free software: you can redistribute it and/or modify
00008         it under the terms of the GNU General Public License as published by
00009         the Free Software Foundation, either version 3 of the License, or
00010         (at your option) any later version.
00011 
00012         FreeEMS software is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016 
00017         You should have received a copy of the GNU General Public License
00018         along with any FreeEMS software.  If not, see <http://www.gnu.org/licenses/>.
00019 
00020         We ask that if you make any changes to this file you send them upstream to us at admin@diyefi.org
00021 
00022         Thank you for choosing FreeEMS to run your engine! */
00023 
00024 /* Header file multiple inclusion protection courtesy eclipse Header Template   */
00025 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual              */
00026 #ifndef FILE_MEMORY_H_SEEN
00027 #define FILE_MEMORY_H_SEEN
00028 
00029 /* http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Variable-Attributes.html */
00030 
00031 /* EEPROM */
00032 //#define EEPROM __attribute__ ((section (".eeprom")))
00033 /* EEPROM would appear to not be loadable by hcs12mem           */
00034 /* Furthermore it isn't really needed except in code anyway     */
00035 
00036 /* RAM divided up into special purpose blocks */
00037 #define RWINDOW         __attribute__ ((section (".rpage")))            /* 4k paged RAM window */
00038 //#define BURNBUF               __attribute__ ((section (".burnbuf")))          /* 1k block of RAM for flash write buffer */
00039 #define RXBUF           __attribute__ ((section (".rxbuf")))            /* 1k block of RAM for receive buffer */
00040 #define TXBUF           __attribute__ ((section (".txbuf")))            /* 1k block of RAM for transmit buffer */
00041 
00042 /* Direct flash blocks */
00043 #define SMALL1          __attribute__ ((section (".small1")))           /************************************************/
00044 #define SMALL2          __attribute__ ((section (".small2")))           /* Small blocks for pairs of structs of tables  */
00045 #define SMALL3          __attribute__ ((section (".small3")))           /* to ensure overflow is reported as an error   */
00046 #define SMALL4          __attribute__ ((section (".small4")))           /************************************************/
00047 #define FIXEDCONF1      __attribute__ ((section (".fixedconf1")))
00048 #define FIXEDCONF2      __attribute__ ((section (".fixedconf2")))
00049 #define LOOKUP          __attribute__ ((section (".lookup")))
00050 #define TEXT1           __attribute__ ((section (".text1")))            /* Unpaged space that must be explicitly used. */
00051 #define TEXT            __attribute__ ((section (".text")))                     /* Not required, code defaults to being stored here. */
00052 
00053 /* far shortcut for data */
00054 #define DFAR(label) __attribute__ ((section (label)))
00055 
00056 /* Paged flash blocks for data */
00057 #define PPAGE_E0 DFAR(".ppageE0")
00058 #define PPAGE_E1 DFAR(".ppageE1")
00059 #define PPAGE_E2 DFAR(".ppageE2")
00060 #define PPAGE_E3 DFAR(".ppageE3")
00061 #define PPAGE_E4 DFAR(".ppageE4")
00062 #define PPAGE_E5 DFAR(".ppageE5")
00063 #define PPAGE_E6 DFAR(".ppageE6")
00064 #define PPAGE_E7 DFAR(".ppageE7")
00065 #define PPAGE_E8 DFAR(".ppageE8")
00066 #define PPAGE_E9 DFAR(".ppageE9")
00067 #define PPAGE_EA DFAR(".ppageEA")
00068 #define PPAGE_EB DFAR(".ppageEB")
00069 #define PPAGE_EC DFAR(".ppageEC")
00070 #define PPAGE_ED DFAR(".ppageED")
00071 #define PPAGE_EE DFAR(".ppageEE")
00072 #define PPAGE_EF DFAR(".ppageEF")
00073 #define PPAGE_F0 DFAR(".ppageF0")
00074 #define PPAGE_F1 DFAR(".ppageF1")
00075 #define PPAGE_F2 DFAR(".ppageF2")
00076 #define PPAGE_F3 DFAR(".ppageF3")
00077 #define PPAGE_F4 DFAR(".ppageF4")
00078 #define PPAGE_F5 DFAR(".ppageF5")
00079 #define PPAGE_F6 DFAR(".ppageF6")
00080 #define PPAGE_F7 DFAR(".ppageF7")
00081 #define PPAGE_F8 DFAR(".ppageF8") /* Use this or below only for now */
00082 #define PPAGE_F9 DFAR(".ppageF9")
00083 #define PPAGE_FA DFAR(".ppageFA")
00084 #define PPAGE_FB DFAR(".ppageFB")
00085 #define PPAGE_FC DFAR(".ppageFC")
00086 #define BIGTABLES DFAR(".ppageFE")      /* This is the block that is present in the page window using linear addressing, represents 0x8000 - 0xBFFF ("text2" paged) */
00087 #define BIGTABLES_PPAGE 0xFE
00088 //#define PPAGE_FD DFAR(".ppageFD")     /* Represents 0x4000 - 0x7FFF ("text1" paged) */
00089 //#define PPAGE_FF DFAR(".ppageFF")     /* Represents 0xC000 - 0xFFFF ("text" paged) */
00090 /* The previous two lines are included for clarity only. */
00091 /* Changes to the memory layout should be reflected in memory.x and Makefile also */
00092 
00093 /* far shortcut for functions */
00094 #define FAR(label) __attribute__ ((far)) __attribute__ ((section (label)))
00095 
00096 /* Paged flash blocks for functions */
00097 #define FPPAGE_E0 FAR(".ppageE0")
00098 #define FPPAGE_E1 FAR(".ppageE1")
00099 #define FPPAGE_E2 FAR(".ppageE2")
00100 #define FPPAGE_E3 FAR(".ppageE3")
00101 #define FPPAGE_E4 FAR(".ppageE4")
00102 #define FPPAGE_E5 FAR(".ppageE5")
00103 #define FPPAGE_E6 FAR(".ppageE6")
00104 #define FPPAGE_E7 FAR(".ppageE7")
00105 #define FPPAGE_E8 FAR(".ppageE8")
00106 #define FPPAGE_E9 FAR(".ppageE9")
00107 #define FPPAGE_EA FAR(".ppageEA")
00108 #define FPPAGE_EB FAR(".ppageEB")
00109 #define FPPAGE_EC FAR(".ppageEC")
00110 #define FPPAGE_ED FAR(".ppageED")
00111 #define FPPAGE_EE FAR(".ppageEE")
00112 #define FPPAGE_EF FAR(".ppageEF")
00113 #define FPPAGE_F0 FAR(".ppageF0")
00114 #define FPPAGE_F1 FAR(".ppageF1")
00115 #define FPPAGE_F2 FAR(".ppageF2")
00116 #define FPPAGE_F3 FAR(".ppageF3")
00117 #define FPPAGE_F4 FAR(".ppageF4")
00118 #define FPPAGE_F5 FAR(".ppageF5")
00119 #define FPPAGE_F6 FAR(".ppageF6")
00120 #define FPPAGE_F7 FAR(".ppageF7")
00121 #define FPPAGE_F8 FAR(".ppageF8") /* Use this or below only for now */
00122 #define FPPAGE_F9 FAR(".ppageF9")
00123 #define FPPAGE_FA FAR(".ppageFA")
00124 #define FPPAGE_FB FAR(".ppageFB")
00125 #define FPPAGE_FC FAR(".ppageFC")
00126 #define FPPAGE_FE FAR(".ppageFE")       /* This is the block that is present in the page window using linear addressing, represents 0x8000 - 0xBFFF ("text2" paged) */
00127 //#define FPPAGE_FD FAR(".ppageFD")     /* Represents 0x4000 - 0x7FFF ("text1" paged) */
00128 //#define FPPAGE_FF FAR(".ppageFF")     /* Represents 0xC000 - 0xFFFF ("text" paged) */
00129 /* The previous two lines are included for clarity only. */
00130 /* Changes to the memory layout should be reflected in memory.x and Makefile also */
00131 
00132 #else
00133         /* let us know if we are being untidy with headers */
00134         #warning "Header file MEMORY_H seen before, sort it out!"
00135 /* end of the wrapper ifdef from the very top */
00136 #endif

Generated on Mon Nov 10 21:18:50 2008 for freeems by  doxygen 1.5.2