* src/pic/device.c (create_pic,ram_map): add memRange entries to PIC
[fw/sdcc] / src / pic / device.h
index 9b944cf1e242285b5135da49b5c5ca58b925da30..e2b118d90316e86e4390805e173bc740bab5b9e3 100644 (file)
@@ -44,6 +44,7 @@ typedef struct memRange {
                                 * e.g. alias = 0x80 means start_address is identical
                                 * to the memory location at (0x80 | start_address) */
        int bank;               /* PIC memory bank this range occupies */
+       struct memRange *next;  /* linked list */
 
 } memRange;
 
@@ -71,17 +72,23 @@ typedef struct AssignedMemory {
  */
 
 extern AssignedMemory *finalMapping;
-#define PROCESSOR_NAMES    4
 /* Processor unique attributes */
 typedef struct PIC_device {
-       char *name[PROCESSOR_NAMES];/* aliases for the processor name */
+       char *name;                 /* the processor name */
 
        memRange *ram;              /* RAM memory map */
        memRange *sfr;              /* SFR memory map */
 
        int maxRAMaddress;          /* maximum value for a data address */
+       int defMaxRAMaddrs;         /* default maximum value for a data address */
        int bankMask;               /* Bitmask that is ANDed with address to extract banking bits */
        //  int hasAliasedRAM:1;        /* True if there are bank independent registers */
+       int hasSecondConfigReg;     /* True if there is a second configuration register */
+       
+       int programMemSize;         /* program memory size in words - for device listing only */
+       int dataMemSize;            /* data (RAM) memory size in bytes - for device listing only */
+       int eepromMemSize;          /* EEPROM memory size in bytes - for device listing only */
+       int ioPins;                 /* number of I/O pins - for device listing only */
 
 } PIC_device;
 
@@ -99,5 +106,17 @@ int isREGinBank(regs *reg, int bank);
 int REGallBanks(regs *reg);
 void addMemRange(memRange *r, int type);
 void setMaxRAM(int size);
+void setDefMaxRam(void);
+
+void pic14_assignConfigWordValue(int address, int value);
+int pic14_emitConfigWord (FILE * vFile);
+int pic14_getConfigWord(int address);
+
+unsigned pic14_getMaxRam(void);
+int pic14_getHasSecondConfigReg(void);
+int pic14_allRAMShared(void);
+int pic14_hasSharebank(int *low, int *high, int *size);
+int pic14_getSharedStack(int *low, int *high, int *size);
+PIC_device * pic14_getPIC(void);
 
 #endif  /* __DEVICE_H__ */