Added missing port.h
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Jan 2000 17:52:10 +0000 (17:52 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Jan 2000 17:52:10 +0000 (17:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@22 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/port.h [new file with mode: 0644]

diff --git a/src/port.h b/src/port.h
new file mode 100644 (file)
index 0000000..2d39089
--- /dev/null
@@ -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
+