Added missing port.h
[fw/sdcc] / src / port.h
1 /** @file port.h
2     Definitions for what a port must provide.
3     All ports are referenced in SDCCmain.c.
4 */
5 #ifndef PORT_INCLUDE
6 #define PORT_INCLUDE
7
8 /* Processor specific names */
9 typedef struct {
10     /** Target name used for -m */
11     const char *target;
12     /** Target name string, used for --help */
13     const char *target_name;
14     struct {
15         /** Command to run (eg as-z80) */
16         const char *exec_name;
17         /** Arguments for debug mode */
18         const char *debug_opts;
19         /** Arguments for normal assembly mode */
20         const char *plain_opts;
21         /** TRUE if the output file name should be pre-pended to the args */
22         bool requires_output_name;
23     } assembler;
24     struct {
25         /** Command to run (eg link-z80) */
26         const char *exec_name;
27     } linker;
28     /** Basic type sizes */
29     struct {
30         int char_size;
31         int short_size;
32         int int_size;
33         int long_size;
34         int ptr_size;
35         int fptr_size;
36         int gptr_size;
37         int bit_size;
38         int float_size;
39         int max_base_size;
40     } s;
41     struct {
42         /** -1 for grows down (z80), +1 for grows up (mcs51) */
43         int direction;
44         /** Extra overhead when calling between banks */
45         int bank_overhead;
46         /** Extra overhead when the function is an ISR */
47         int isr_overhead;
48         /** Standard overhead for a function call */
49         int call_overhead;
50         /** Initial SP offset */
51         int start_sp;
52     } stack;
53     struct {
54         /** One more than the smallest mul/div operation the processor can do nativley 
55             Eg if the processor has an 8 bit mul, nativebelow is 2 */
56         int nativebelow;
57     } muldiv;
58     /** Parses one option + its arguments */
59     bool (*parseOption)(int *pargc, char **argv);
60     /** Called after all the options have been parsed. */
61     void (*finaliseOptions)(void);
62     /** Called after the port has been selected but before any
63         options are parsed. */
64     void (*setDefaultOptions)(void);
65     /** Does the dirty work. */
66     void (*assignRegisters)(eBBlock **, int);
67 } PORT;
68
69 extern PORT *port;
70
71 #endif
72