2 Definitions for what a port must provide.
3 All ports are referenced in SDCCmain.c.
8 /* Processor specific names */
10 /** Target name used for -m */
13 /** Target name string, used for --help */
14 const char *target_name;
17 /** TRUE if all types of glue functions should be inseted into
18 the file that also defines main.
19 We dont want this in cases like the z80 where the startup
20 code is provided by a seperate module.
25 /* assembler related information */
27 /** Command to run and arguments (eg as-z80) */
29 /** Arguments for debug mode. PENDING: ignored */
30 const char *debug_opts;
31 /** Arguments for normal assembly mode. PENDING: ignored */
32 const char *plain_opts;
33 /* print externs as global */
37 /* linker related info */
39 /** Command to run (eg link-z80) */
41 /** If non-null will be used to execute the link. */
42 void (*do_link)(void);
43 /** Extention for object files (.rel, .obj, ...) */
48 /** Default peephole rules */
52 /** Basic type sizes */
66 /** memory regions related stuff */
68 const char *xstack_name;
69 const char *istack_name;
70 const char *code_name;
71 const char *data_name;
72 const char *idata_name;
73 const char *xdata_name;
76 const char *static_name;
77 const char *overlay_name;
78 const char *post_static_name;
79 struct memmap *default_local_map ; /* default location for auto vars */
80 struct memmap *default_globl_map ; /* default location for globl vars*/
81 int code_ro; /* code space read-only 1=yes */
84 /* stack related information */
86 /** -1 for grows down (z80), +1 for grows up (mcs51) */
88 /** Extra overhead when calling between banks */
90 /** Extra overhead when the function is an ISR */
92 /** Standard overhead for a function call */
94 /** Re-enterant space */
96 /** 'banked' call overhead.
97 Mild overlap with bank_overhead */
102 /** One more than the smallest
103 mul/div operation the processor can do nativley
104 Eg if the processor has an 8 bit mul, nativebelow is 2 */
108 /** Prefix to add to a C function (eg "_") */
109 const char *fun_prefix;
111 /** Called once the processor target has been selected.
112 First chance to initalise and set any port specific varibles.
113 'port' is set before calling this. May be NULL.
116 /** Parses one option + its arguments */
117 bool (*parseOption)(int *pargc, char **argv, int *i);
118 /** Called after all the options have been parsed. */
119 void (*finaliseOptions)(void);
120 /** Called after the port has been selected but before any
121 options are parsed. */
122 void (*setDefaultOptions)(void);
123 /** Does the dirty work. */
124 void (*assignRegisters)(eBBlock **, int);
126 /** Returns the register name of a symbol.
127 Used so that 'regs' can be an incomplete type. */
128 const char *(*getRegName)(struct regs *reg);
130 /* list of keywords that are used by this
131 target (used by lexer) */
134 /* Write any port specific assembler output. */
135 void (*genAssemblerPreamble)(FILE *of);
137 /* Write the port specific IVT. If genIVT is NULL or if
138 * it returns zero, default (8051) IVT generation code
141 int (*genIVT)(FILE *of, symbol **intTable, int intCount);
144 /* parameter passing in register related functions */
145 void (*reset_regparms)(); /* reset the register count */
146 int (*reg_parm)(struct link *); /* will return 1 if can be passed in register */
148 /** Process the pragma string 'sz'. Returns 0 if recognised and
149 processed, 1 otherwise. May be NULL.
151 int (*process_pragma)(const char *sz);
153 /** If TRUE, then tprintf and !dw will be used for some initalisers
155 bool use_dw_for_init;