www.pudn.com > S12G_Bootloader_Host_App.zip > startup.h, change:2010-04-06,size:2715b


/*************************************************** 
  FILE    : startup.h 
  PURPOSE : data structures for startup 
  LANGUAGE: ANSI-C 
****************************************************/ 
#ifndef STARTUP_H 
#define STARTUP_H 
#ifdef __cplusplus 
extern "C" { 
#endif 
#include <stdtypes.h> 
#include <hidef.h> 
/* 
  the following data structures contain the data needed to 
  initialize the processor and memory 
*/ 
typedef struct{ 
  unsigned char *beg; 
  int size;      /* [beg..beg+size] */ 
} _Range; 
typedef struct _Copy{ 
  int size; 
  unsigned char * dest; 
} _Copy; 
typedef struct _Cpp { 
  _PFunc  initFunc;      /* address of init function */ 
} _Cpp; 
typedef void (*_PFunc)(void); 
typedef struct _LibInit{ 
  struct _tagStartup  *startup; /* address of startup desc */ 
} _LibInit; 
#define STARTUP_FLAGS_NONE    0 
#define STARTUP_FLAGS_ROM_LIB (1<<0) /* ROM library */ 
#define STARTUP_FLAGS_NOT_INIT_SP (1<<1) /* init stack */ 
#ifdef __ELF_OBJECT_FILE_FORMAT__ 
/* ELF/DWARF object file format */ 
/* attention: the linker scans for these structs */ 
/* to obtain the available fields and their sizes. */ 
/* So do not change the names in this file. */ 
extern struct _tagStartup { 
  unsigned char flags;         /* STARTUP_FLAGS_xxx     */ 
  _PFunc         main;         /* first user fct        */ 
  unsigned short stackOffset;  /* initial stack pointer */ 
  unsigned short nofZeroOuts;  /* number of zero outs   */ 
  _Range         *pZeroOut;    /* vector of zero outs   */ 
  _Copy          *toCopyDownBeg; /* copy down start     */ 
  unsigned short nofLibInits;    /* number of ROM Libs  */ 
  _LibInit       *libInits;      /* vector of ROM Libs  */ 
  unsigned short  nofInitBodies; /* number of C++ inits */ 
  _Cpp           *initBodies;    /* C+ init funcs       */ 
  unsigned short  nofFiniBodies; /* number of C++ dtors */ 
  _Cpp           *finiBodies;    /* C+ dtors funcs      */ 
} _startupData; 
#else /* HIWARE format */ 
extern struct _tagStartup { 
  unsigned  flags;        /* STARTUP_FLAGS_xxx */ 
  _PFunc    main;         /* starting point of user code */ 
  unsigned  dataPage;     /* page where data begins */ 
  long      stackOffset;  /* initial stack pointer */ 
  int       nofZeroOuts;  /* number of zero out ranges */ 
  _Range    *pZeroOut;    /* ptr to zero out descriptor */ 
  long      toCopyDownBeg;/* address of copydown descr */ 
  _PFunc    *mInits;      /* ptr to C++ init fcts */ 
  _LibInit  *libInits;    /* ptr to ROM Lib descriptors */ 
} _startupData; 
#endif 
extern void _Startup(void);    /* execution begins here */ 
/*-------------------------------------------------*/ 
#ifdef __cplusplus 
 } 
#endif 
#endif /* STARTUP_H */