⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 start08.h

📁 Motorola MCU HC08下的uCOSII移植源代码
💻 H
字号:
/******************************************************************************
  FILE    : start08.h
  PURPOSE : datastructures for startup
  LANGUAGE: ANSI-C
*/
/********************************************************************************/

#ifndef START08_H
#define START08_H

#ifdef __cplusplus
extern "C" {
#endif

#include "hidef.h"

/*
  the following datastructures 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 void (*_PFunc)(void);

typedef struct _LibInit{
  _PFunc  *startup;      /* address of startup desc */
} _LibInit;

typedef struct _Cpp{
  _PFunc  initFunc;      /* address of init function */
} _Cpp;

#define STARTUP_FLAGS_NONE          0
#define STARTUP_FLAGS_ROM_LIB       (1<<0)  /* if module is a ROM library */
#define STARTUP_FLAGS_NOT_INIT_SP   (1<<1)  /* if stack pointer has not to be initialized */

#ifdef __ELF_OBJECT_FILE_FORMAT__

/* ELF/DWARF object file format */

/* attention: the linker scans the debug information for this structures */
/* to obtain the available fields and their sizes. */
/* So dont change the names in this file. */

extern struct _tagStartup {
     unsigned char   flags;           /* STARTUP_FLAGS_xxx */
     _PFunc          main;            /* top level procedure of user program */
#ifndef __NO_STACK_OFFSET
     unsigned short  stackOffset;     /* initial value of the stack pointer */
#endif
     unsigned short  nofZeroOuts;     /* number of zero out ranges */
     _Range          *pZeroOut;       /* vector of ranges with nofZeroOuts elements */ 
     _Copy           *toCopyDownBeg;  /* rom-address where copydown-data begins */
#if 0  /* switch on to implement ROM libraries */
     unsigned short  nofLibInits;     /* number of library startup descriptors */
     _LibInit        *libInits;       /* vector of pointers to library startup descriptors */
#endif
#if defined(__cplusplus)
     unsigned short  nofInitBodies;   /* number of init functions for C++ constructors */
     _Cpp            *initBodies;     /* vector of function pointers to init functions for C++ constructors */
#endif
} _startupData;    

#else

extern struct _tagStartup{
     unsigned   flags;             
    _PFunc      main;            /* top procedure of user program */
     unsigned   dataPage;        /* page where data allocation begins */
     long       stackOffset;
     int        nofZeroOuts;
    _Range      *pZeroOut;       /* pZeroOut is a vector of ranges with nofZeroOuts elements */ 
     long       toCopyDownBeg;   /* rom-address where copydown-data begins */
    _PFunc      *mInits;         /* mInits is a vector of function pointers, terminated by 0 */
    _PFunc      *libInits;       /* libInits is a vector of function pointers, terminated by 0x0000FFFF */
} _startupData;  

#endif  

extern void _Startup(void);    /* execution begins in this procedure */   
/*--------------------------------------------------------------------*/
#ifdef __cplusplus
 }
#endif

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -