- struct {
- /** Command to run (eg link-z80) */
- const char **cmd;
- } linker;
-
- struct {
- /** Default peephole rules */
- char *default_rules;
- } peep;
-
- /** Basic type sizes */
- struct {
- int char_size;
- int short_size;
- int int_size;
- int long_size;
- int ptr_size;
- int fptr_size;
- int gptr_size;
- int bit_size;
- int float_size;
- int max_base_size;
- } s;
-
- /** Names for all the memory regions */
- struct {
- const char *xstack_name;
- const char *istack_name;
- const char *code_name;
- const char *data_name;
- const char *idata_name;
- const char *xdata_name;
- const char *bit_name;
- const char *reg_name;
- const char *static_name;
- const char *overlay_name;
- } mem;
-
+ struct
+ {
+ /** Command to run (eg link-z80) */
+ const char **cmd;
+ /** Alternate macro based form. */
+ const char *mcmd;
+ /** If non-null will be used to execute the link. */
+ 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;
+
+ struct
+ {
+/** Default peephole rules */
+ char *default_rules;
+ int (*getSize)(lineNode *line);
+ bitVect * (*getRegsRead)(lineNode *line);
+ bitVect * (*getRegsWritten)(lineNode *line);
+ bool (*deadMove) (const char *reg, lineNode *currPl, lineNode *head);
+ bool (*notUsed) (const char *reg, lineNode *currPl, lineNode *head);
+ }
+ peep;
+
+/** Basic type sizes */
+ struct
+ {
+ int char_size;
+ int short_size;
+ unsigned int int_size;
+ int long_size;
+ int ptr_size; //near
+ int fptr_size; //far
+ int gptr_size; //generic
+ int bit_size;
+ int float_size;
+ int max_base_size;
+ }
+ s;
+
+/** tags for far, near, xstack, code generic pointers */
+ struct
+ {
+ int tag_far;
+ int tag_near;
+ int tag_xstack;
+ int tag_code;
+ }
+ gp_tags;
+
+/** memory regions related stuff */
+ struct
+ {
+ const char * const xstack_name;
+ const char * const istack_name;
+ /*
+ * The following 2 items can't be const pointers
+ * due to ugly implementation in z80 target;
+ * this should be fixed in src/z80/main.c (borutr)
+ */
+ const char *code_name;
+ const char *data_name;
+ const char * const idata_name;
+ const char * const pdata_name;
+ const char * const xdata_name;
+ const char * const bit_name;
+ const char * const reg_name;
+ const char * const static_name;
+ const char * const overlay_name;
+ const char * const post_static_name;
+ const char * const home_name;
+ const char * const xidata_name; // initialized xdata
+ const char * const xinit_name; // a code copy of xidata
+ const char * const const_name; // const data (code or not)
+ const char * const cabs_name; // const absolute data (code or not)
+ const char * const xabs_name; // absolute xdata/pdata
+ const char * const iabs_name; // absolute idata/data
+ struct memmap *default_local_map; // default location for auto vars
+ struct memmap *default_globl_map; // default location for globl vars
+ int code_ro; /* code space read-only 1=yes */
+ }
+ mem;
+
+ struct
+ {
+ void (*genExtraAreaDeclaration)(FILE *, bool);
+ void (*genExtraAreaLinkOptions)(FILE *);
+ }
+ extraAreas;
+