From 4eb2464c04077a4d1f1c20d20b8c3bf5d0829457 Mon Sep 17 00:00:00 2001 From: michaelh Date: Sun, 23 Jan 2000 17:52:10 +0000 Subject: [PATCH] Added missing port.h git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@22 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/port.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/port.h diff --git a/src/port.h b/src/port.h new file mode 100644 index 00000000..2d390891 --- /dev/null +++ b/src/port.h @@ -0,0 +1,72 @@ +/** @file port.h + Definitions for what a port must provide. + All ports are referenced in SDCCmain.c. +*/ +#ifndef PORT_INCLUDE +#define PORT_INCLUDE + +/* Processor specific names */ +typedef struct { + /** Target name used for -m */ + const char *target; + /** Target name string, used for --help */ + const char *target_name; + struct { + /** Command to run (eg as-z80) */ + const char *exec_name; + /** Arguments for debug mode */ + const char *debug_opts; + /** Arguments for normal assembly mode */ + const char *plain_opts; + /** TRUE if the output file name should be pre-pended to the args */ + bool requires_output_name; + } assembler; + struct { + /** Command to run (eg link-z80) */ + const char *exec_name; + } linker; + /** 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; + struct { + /** -1 for grows down (z80), +1 for grows up (mcs51) */ + int direction; + /** Extra overhead when calling between banks */ + int bank_overhead; + /** Extra overhead when the function is an ISR */ + int isr_overhead; + /** Standard overhead for a function call */ + int call_overhead; + /** Initial SP offset */ + int start_sp; + } stack; + struct { + /** One more than the smallest mul/div operation the processor can do nativley + Eg if the processor has an 8 bit mul, nativebelow is 2 */ + int nativebelow; + } muldiv; + /** Parses one option + its arguments */ + bool (*parseOption)(int *pargc, char **argv); + /** Called after all the options have been parsed. */ + void (*finaliseOptions)(void); + /** Called after the port has been selected but before any + options are parsed. */ + void (*setDefaultOptions)(void); + /** Does the dirty work. */ + void (*assignRegisters)(eBBlock **, int); +} PORT; + +extern PORT *port; + +#endif + -- 2.30.2