X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fconfig.h;h=6dc4a7b6b9f1d2533f3221a9c8373063adda4283;hb=35e1184901ca38bdb2e56d154ed3b71f6096eacc;hp=49fe786bb7bb4370b239a6f9c1b4bbb3edde3925;hpb=ad140bede4f73f812bdd5c402ae59f0ccc11d3d5;p=cc65 diff --git a/src/ld65/config.h b/src/ld65/config.h index 49fe786bb..6dc4a7b6b 100644 --- a/src/ld65/config.h +++ b/src/ld65/config.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2010, Ullrich von Bassewitz */ +/* (C) 1998-2011, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -40,8 +40,10 @@ /* common */ #include "coll.h" +#include "filepos.h" /* ld65 */ +#include "lineinfo.h" #include "segments.h" @@ -52,63 +54,34 @@ +/* Forward for struct MemoryArea */ +struct MemoryArea; + /* File list entry */ typedef struct File File; struct File { unsigned Name; /* Name index of the file */ - unsigned Flags; - unsigned Format; /* Output format */ - Collection MemList; /* List of memory areas in this file */ -}; - -/* Segment list node. Needed because there are two lists (RUN & LOAD) */ -typedef struct MemListNode MemListNode; -struct MemListNode { - MemListNode* Next; /* Next entry */ - struct SegDesc* Seg; /* Segment */ -}; - -/* Memory list entry */ -typedef struct Memory Memory; -struct Memory { - unsigned Name; /* Name index of the memory section */ - unsigned Attr; /* Which values are valid? */ - unsigned Flags; /* Set of bitmapped flags */ - unsigned long Start; /* Start address */ - unsigned long Size; /* Length of memory section */ - unsigned long FillLevel; /* Actual fill level of segment */ - unsigned char FillVal; /* Value used to fill rest of seg */ - unsigned char Relocatable; /* Memory area is relocatable */ - MemListNode* SegList; /* List of segments for this section */ - MemListNode* SegLast; /* Last segment in this section */ - File* F; /* File that contains the entry */ + unsigned Flags; + unsigned Format; /* Output format */ + unsigned long Size; /* Size of the generated file */ + Collection MemoryAreas; /* List of memory areas in this file */ }; /* Segment descriptor entry */ typedef struct SegDesc SegDesc; struct SegDesc { unsigned Name; /* Index of the name */ - SegDesc* Next; /* Pointer to next entry in list */ + LineInfo* LI; /* Position of definition */ Segment* Seg; /* Pointer to segment structure */ unsigned Attr; /* Attributes for segment */ unsigned Flags; /* Set of bitmapped flags */ - Memory* Load; /* Load memory section */ - Memory* Run; /* Run memory section */ + struct MemoryArea* Load; /* Load memory section */ + struct MemoryArea* Run; /* Run memory section */ unsigned long Addr; /* Start address or offset into segment */ - unsigned char Align; /* Run area alignment if given */ - unsigned char AlignLoad; /* Load area alignment if given */ + unsigned long RunAlignment; /* Run area alignment if given */ + unsigned long LoadAlignment; /* Load area alignment if given */ }; -/* Segment list */ -extern SegDesc* SegDescList; /* Single linked list */ -extern unsigned SegDescCount; /* Number of entries in list */ - -/* Memory flags */ -#define MF_DEFINE 0x0001 /* Define start and size */ -#define MF_FILL 0x0002 /* Fill segment */ -#define MF_RO 0x0004 /* Read only memory area */ -#define MF_OVERFLOW 0x0008 /* Memory area overflow */ - /* Segment flags */ #define SF_RO 0x0001 /* Read only segment */ #define SF_BSS 0x0002 /* Segment is BSS style segment */ @@ -133,9 +106,11 @@ extern unsigned SegDescCount; /* Number of entries in list */ void CfgRead (void); /* Read the configuration */ -unsigned CfgAssignSegments (void); -/* Assign segments, define linker symbols where requested. The function will - * return the number of memory area overflows (so zero means anything went ok). +unsigned CfgProcess (void); +/* Process the config file after reading in object files and libraries. This + * includes postprocessing of the config file data but also assigning segments + * and defining segment/memory area related symbols. The function will return + * the number of memory area overflows (so zero means anything went ok). * In case of overflows, a short mapfile can be generated later, to ease the * task of rearranging segments for the user. */