X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic16%2Fdevice.h;h=40361ea0bb281d634d06856c004715011bd7a6df;hb=5a1d5e778e85664f4e6657019348b4756b16eacb;hp=f25163331f7cb69712928763ccab8264bde0776a;hpb=8332acb8ebcdd1490779c012db097c74c71d039e;p=fw%2Fsdcc diff --git a/src/pic16/device.h b/src/pic16/device.h index f2516333..40361ea0 100644 --- a/src/pic16/device.h +++ b/src/pic16/device.h @@ -30,62 +30,56 @@ #ifndef __DEVICE_H__ #define __DEVICE_H__ -#if defined(__BORLANDC__) || defined(_MSC_VER) -#define STRCASECMP stricmp -#else -#define STRCASECMP strcasecmp -#endif - -#define CONFIGURATION_WORDS 20 -#define IDLOCATION_BYTES 20 - -typedef struct { - int sfrLoAddr; - int sfrHiAddr; -} sfrRangeInfo_t; - +#define CONFIGURATION_WORDS 20 +#define IDLOCATION_BYTES 20 typedef struct { - unsigned int mask; - int emit; - unsigned int value; + unsigned int mask; + int emit; + unsigned int value; + unsigned int andmask; } configRegInfo_t; typedef struct { - int confAddrStart; /* starting address */ - int confAddrEnd; /* ending address */ - configRegInfo_t crInfo[ CONFIGURATION_WORDS ]; + int confAddrStart; /* starting address */ + int confAddrEnd; /* ending address */ + configRegInfo_t crInfo[ CONFIGURATION_WORDS ]; } configWordsInfo_t; typedef struct { - unsigned char emit; - unsigned char value; + 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 ]; + int idAddrStart; /* starting ID address */ + int idAddrEnd; /* ending ID address */ + idRegInfo_t irInfo[ IDLOCATION_BYTES ]; } idBytesInfo_t; #define PROCESSOR_NAMES 4 /* Processor unique attributes */ typedef struct PIC16_device { - char *name[PROCESSOR_NAMES];/* aliases for the processor name */ - - 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 */ + char *name[PROCESSOR_NAMES]; /* aliases for the processor name */ + /* RAMsize *must* be the first item to copy for 'using' */ + int RAMsize; /* size of Data RAM - VR 031120 */ + int acsSplitOfs; /* access bank split offset */ + configWordsInfo_t cwInfo; /* configuration words info */ + idBytesInfo_t idInfo; /* ID Locations info */ + /* next *must* be the first field NOT being copied via 'using' */ + struct PIC16_device *next; /* linked list */ } PIC16_device; +extern PIC16_device *pic16; + /* 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 OF_LR_SUPPORT 0x00000001 +#define OF_NO_OPTIMIZE_GOTO 0x00000002 +#define OF_OPTIMIZE_CMP 0x00000004 +#define OF_OPTIMIZE_DF 0x00000008 typedef struct { int no_banksel; @@ -100,29 +94,45 @@ typedef struct { char *crt_name; int no_crt; int ip_stack; + unsigned long opt_flags; + int gstack; + unsigned int debgen; + int xinst; } pic16_options_t; -#define STACK_MODEL_SMALL (pic16_options.stack_model == 0) -#define STACK_MODEL_LARGE (pic16_options.stack_model == 1) +extern pic16_options_t pic16_options; + +#define STACK_MODEL_SMALL (pic16_options.stack_model == 0) +#define STACK_MODEL_LARGE (pic16_options.stack_model == 1) extern set *fix_idataSymSet; extern set *rel_idataSymSet; -extern pic16_options_t pic16_options; -extern PIC16_device *pic16; +#if 0 +/* This is an experimental code for #pragma inline + and is temporarily disabled for 2.5.0 release */ +extern set *asmInlineMap; +#endif /* 0 */ + +typedef struct { + unsigned long isize; + unsigned long adsize; + unsigned long udsize; + unsigned long idsize; + unsigned long intsize; +} stats_t; + +extern stats_t statistics; /****************************************/ 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__ */ +