* doc/sdccman.lyx: removed PIC16 from PIC16 Port Specific Options,
[fw/sdcc] / src / pic16 / device.h
index 5ec7798657330618ab4ed53670b774e9edf23e71..d2bef36f57d6eaa1e05701e374d1a961ae0a25a1 100644 (file)
 #ifndef  __DEVICE_H__
 #define  __DEVICE_H__
 
-/* memRange - a structure to define a range of valid memory addresses 
- * 
- * The Memory of most PICs (and other micros) is a collection of
- * disjoint chunks. The memRange structure will define the start
- * and end address of one of these chunks. The memory map of a
- * particular device is a collection of memRange struct's.
- */
-
-typedef struct memRange {
-  int start_address;      /* first address in range */
-  int end_address;        /* last */
-  int alias;              /* bit mask defining how/if memory range is aliased 
-                          * 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 */
-
-} memRange;
-
-/* AssignedMemory - A structure to keep track of the memory that has been used.
- *
- * When a register gets assigned an address this struct is used to
- * keep track of a few details about the register. There is one of
- * these structures for each memory location in the device.
- */
-
-typedef struct AssignedMemory {
-  regs *reg;        /* Pointer to the register (NULL if this is an invalid address) */
-  int  instance;    /* the i'th byte of a multibyte register */
-  int  alias;       /* Bit mapping of aliased addresses (see memRange) */
-  int  bank;        /* Memory bank of this register */
-  int  isValid:1;   /* True if the address is legal */
-  int  isSFR:1;     /* True if the address is that of a Special Function reg */
-  int  isEmitted:1; /* True if the register has been written to a cBlock */
-
-} AssignedMemory;
-
-
-/*
- * pic16_finalMapping - Dynamically allocated array that records the register assignments
- */
-
-//extern AssignedMemory *pic16_finalMapping;
-
-/*
- * pic16_finalMappingSize - Size of register assignments that pic16_finalMapping can hold
- */
-
-//extern int pic16_finalMappingSize;
+#if defined(__BORLANDC__) || defined(_MSC_VER)
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
 
 
 #define PROCESSOR_NAMES    4
@@ -85,9 +42,6 @@ typedef struct AssignedMemory {
 typedef struct PIC16_device {
   char *name[PROCESSOR_NAMES];/* aliases for the processor name */
 
-  memRange *ram;              /* RAM memory map */
-  memRange *sfr;              /* SFR memory map */
-
   int maxRAMaddress;          /* maximum value for a data address */
   int bankMask;               /* Bitmask that is ANDed with address to extract banking bits */
   int RAMsize;               /* size of Data RAM - VR 031120 */
@@ -107,11 +61,9 @@ typedef struct {
        int omit_configw;
        int omit_ivt;
        int leave_reset;
-       int enable_stack;
        int stack_model;
 } pic16_options_t;
 
-#define USE_STACK      (pic16_options.enable_stack)
 #define STACK_MODEL_SMALL      (pic16_options.stack_model == 0)
 #define STACK_MODEL_LARGE      (pic16_options.stack_model == 1)
 
@@ -124,10 +76,9 @@ void pic16_assignConfigWordValue(int address, int value);
 int pic16_getConfigWord(int address);
 int pic16_isREGinBank(regs *reg, int bank);
 int pic16_REGallBanks(regs *reg);
-void pic16_addMemRange(memRange *r, int type);
 void pic16_setMaxRAM(int size);
 
-void checkAddReg(set **set, regs *reg);
+int checkAddReg(set **set, regs *reg);
 
 
 #endif  /* __DEVICE_H__ */