* doc/Makefile,
[fw/sdcc] / src / port.h
index 3e3aec9411ad99a1129379e54d36c05b93abc5df..778d67b4ccbadd2a0c451b4a5ef8c9e2f11ae134 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "SDCCicode.h"
 #include "SDCCargs.h"
+#include "SDCCpeeph.h"
 
 #define TARGET_ID_MCS51    1
 #define TARGET_ID_GBZ80    2
@@ -104,6 +105,8 @@ typedef struct
        void (*do_link) (void);
         /** Extension for object files (.rel, .obj, ...) */
        const char *rel_ext;
+       /** 1 if port needs the .lnk file, 0 otherwise */
+       const int needLinkerScript;
       }
     linker;
 
@@ -111,6 +114,9 @@ typedef struct
       {
 /** Default peephole rules */
        char *default_rules;
+       int (*getSize)(lineNode *line);
+       bitVect * (*getRegsRead)(lineNode *line);
+       bitVect * (*getRegsWritten)(lineNode *line);
       }
     peep;
 
@@ -189,6 +195,35 @@ typedef struct
       }
     support;
 
+    struct
+      {
+       void (*emitDebuggerSymbol) (char *);
+       struct
+         {
+           int (*regNum) (struct regs *);
+           bitVect * cfiSame;
+           bitVect * cfiUndef;
+           int addressSize;
+           int regNumRet;
+           int regNumSP;
+           int regNumBP;
+           int offsetSP;
+         }
+       dwarf;
+      }
+    debugger;
+
+    struct
+      {
+        int maxCount;
+        int sizeofElement;
+        int sizeofMatchJump[3];
+        int sizeofRangeCompare[3];
+        int sizeofSubtract;
+        int sizeofDispatch;
+      }
+    jumptableCost;
+        
 /** Prefix to add to a C function (eg "_") */
     const char *fun_prefix;
 
@@ -202,6 +237,8 @@ typedef struct
 /** Optional list of automatically parsed options.  Should be
     implemented to at least show the help text correctly. */
     OPTION *poptions;
+/** Initialise port spectific paths */
+    void (*initPaths)(void);
 /** Called after all the options have been parsed. */
     void (*finaliseOptions) (void);
     /** Called after the port has been selected but before any
@@ -230,6 +267,9 @@ typedef struct
     int (*genIVT) (FILE * of, symbol ** intTable, int intCount);
 
     void (*genXINIT) (FILE * of);
+    
+    /* Write port specific startup code */
+    void (*genInitStartup) (FILE * of);
 
     /* parameter passing in register related functions */
     void (*reset_regparms) (); /* reset the register count */
@@ -249,6 +289,16 @@ typedef struct
     */
     bool (*hasNativeMulFor) (iCode *ic, sym_link *left, sym_link *right);
 
+    /** Returns true if the port has implemented certain bit
+        manipulation iCodes (RRC, RLC, SWAP, GETHBIT)
+    */
+    bool (*hasExtBitOp) (int op, int size);
+    
+    /** Returns the relative expense of accessing a particular output
+        storage class. Larger values indicate higher expense.
+    */
+    int (*oclsExpense) (struct memmap *oclass);
+    
     /** If TRUE, then tprintf and !dw will be used for some initalisers
      */
     bool use_dw_for_init;