#endif
#define CONFIGURATION_WORDS 20
+#define IDLOCATION_BYTES 20
typedef struct {
- int mask;
+ int sfrLoAddr;
+ int sfrHiAddr;
+} sfrRangeInfo_t;
+
+
+typedef struct {
+ unsigned int mask;
int emit;
- int value;
-} configRegInfo;
+ unsigned int value;
+} configRegInfo_t;
typedef struct {
int confAddrStart; /* starting address */
int confAddrEnd; /* ending address */
- configRegInfo crInfo[ CONFIGURATION_WORDS ];
-} configWordsInfo;
+ configRegInfo_t crInfo[ CONFIGURATION_WORDS ];
+} configWordsInfo_t;
+typedef struct {
+ unsigned char emit;
+ unsigned char value;
+} idRegInfo_t;
+
+typedef struct {
+ int idAddrStart; /* starting ID address */
+ int idAddrEnd; /* ending ID address */
+ idRegInfo_t irInfo[ IDLOCATION_BYTES ];
+} idBytesInfo_t;
#define PROCESSOR_NAMES 4
typedef struct PIC16_device {
char *name[PROCESSOR_NAMES];/* aliases for the processor name */
- 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 */
- int extMIface; /* device has external memory interface */
- configWordsInfo cwInfo; /* configuration words info */
+ int maxRAMaddress; /* maximum value for a data address */
+ int RAMsize; /* size of Data RAM - VR 031120 */
+ int acsSplitOfs; /* access bank split offset */
+ int extMIface; /* device has external memory interface */
+ sfrRangeInfo_t sfrRange; /* SFR range */
+ configWordsInfo_t cwInfo; /* configuration words info */
+ idBytesInfo_t idInfo; /* ID Locations info */
} PIC16_device;
/* Given a pointer to a register, this macro returns the bank that it is in */
#define REG_ADDR(r) ((r)->isBitField ? (((r)->address)>>3) : (r)->address)
-//#define REG_BANK(r) (pic16_finalMapping[REG_ADDR(r)].bank)
-//#define REG_isALIASED(r) (pic16_finalMapping[REG_ADDR(r)].alias != 0)
-//#define REG_isVALID(r) (pic16_finalMapping[REG_ADDR(r)].isValid)
typedef struct {
- int no_banksel;
- int opt_banksel;
- int omit_configw;
- int omit_ivt;
- int leave_reset;
- int stack_model;
+ int no_banksel;
+ int opt_banksel;
+ int omit_configw;
+ int omit_ivt;
+ int leave_reset;
+ int stack_model;
+ int ivt_loc;
+ int nodefaultlibs;
+ int dumpcalltree;
+ char *crt_name;
+ int no_crt;
+ int ip_stack;
} pic16_options_t;
#define STACK_MODEL_SMALL (pic16_options.stack_model == 0)
extern PIC16_device *pic16;
/****************************************/
-void pic16_assignConfigWordValue(int address, int value);
-int pic16_getConfigWord(int address);
+void pic16_assignConfigWordValue(int address, unsigned int value);
+void pic16_assignIdByteValue(int address, char value);
int pic16_isREGinBank(regs *reg, int bank);
int pic16_REGallBanks(regs *reg);
void pic16_setMaxRAM(int size);
int PIC16_IS_CONFIG_ADDRESS(int address);
+int PIC16_IS_IDLOC_ADDRESS(int address);
+int PIC16_IS_HWREG_ADDRESS(int address);
int checkAddReg(set **set, regs *reg);
int checkAddSym(set **set, symbol *reg);
+int checkSym(set *set, symbol *reg);
#endif /* __DEVICE_H__ */