loader.h

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C头文件 代码 · 共 139 行

H
139
字号
/*

  Copyright(c) 1998,1999 SIC/Hitachi,Ltd.

	Module Name:

		loader.h

	Revision History:

		26th April		1999		Released
		25th June		1999		Changed FLASH_CACHE
		21st October	1999		Changed FLASH_CACHE
		28th October	1999		Modify FLASH_CACHE value

*/
#ifndef _LOADER_H_
#define _LOADER_H_    1

#include <fwentry.h>


#ifdef  NULL
#undef  NULL
#endif
#ifdef  FALSE
#undef  FALSE
#endif
#ifdef  TRUE
#undef  TRUE
#endif

#define FALSE           0
#define TRUE            1
#define NULL            (void *)0

#define FLAG_AUTO_LAUNCH    1
#define FLAG_INIT_BREAK     2

#define SRECNV_OK               1
#define SRECNV_XMT              2
#define SRECNV_CHECKSUM         3
#define SRECNV_INVALID_RECORD   4

void
StartMonitor(
    void
    );

void
RestoreAndGo(
    unsigned int  vAddr
    );

int
DownloadImage(
    const unsigned char *   pPathName,
    unsigned int        *   pVaddr,
    int                     fLaunch
    );

int
ConvertSreRecord(
    const unsigned char *pBuf,
    unsigned int        *pFlags,
    unsigned int        *pVaddr
    );

unsigned char
AsciiToUnsignedChar(
    const unsigned char * pbuf
    );

unsigned int
AsciiToUnsignedint (
    const unsigned char * pBuf
    );

unsigned int
BigEndianAsciiToUnsignedint (
    const unsigned char * pBuf
    );

int
atox(
    const unsigned char *pbuf,
    unsigned int        *value
    );

unsigned char
toascii(
    unsigned char   c
    );

void
CacheInit(
    void
    );

void
FlushDCache(
    void
    );

void
FlushICache(
    void
    );

void
Launch(
    unsigned int  uAddr
    );


#define MachineSpin()   while(1){}
//#define CALL_FUNC(x)    ((PFUNC_V_V)x)()


#define RESET_FLAG(flag, field) do {flag &= ~field;} while(0)
#define SET_FLAG(flag, field)   do {flag |= field;} while(0)
#define TEST_FLAG(flag, field)  (flag & field)

#define LAUNCH_ON_SRE   0
#define FORCE_LAUNCH    1
#define FORCE_BREAK     2

#define BOOT_TYPE	  -1

// #define FLASH_START	0x00000000UL	// starting address of flash memory
// #define FLASH_END	0x01000000UL	// ending address of flash memory
// #define FLASH_CACHE 0x8c1e7000UL	// RAM buffer for copying image

// #define FLASH_BLOCK_SIZE		0x00040000UL	// S1
// #define FLASH_BLOCKS_PER_BANK	32UL
// #define TOTAL_FLASH_BLOCKS		((FLASH_END-FLASH_START)/FLASH_BLOCK_SIZE)

#endif

⌨️ 快捷键说明

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