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

📄 loader.h

📁 WinCE 3.0 BSP, 包含Inter SA1110, Intel_815E, Advantech_PCM9574 等
💻 H
字号:
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995, 1996, 1997, 1998  Microsoft Corporation

Module Name:  

  loader.h

Abstract:  

  internal include file to bootload module
  
Functions:

  
Notes:


Revision History:

--*/
#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

#ifdef MIPS
#define BOOT_TYPE	  -2
#elif i386
#define BOOT_TYPE         -4
#else
#define BOOT_TYPE	  -1
#endif


#if  defined(MIPS) || defined(PPC403)
#define FLASH_START	0x9f000000UL	// starting address of flash memory
#define FLASH_END	0xa0000000UL	// ending address of flash memory
#define FLASH_CACHE	0x80070000UL	// RAM buffer for copying image
#elif defined(PPC821)
#define FLASH_START	0x0c000000UL	// starting address of flash memory
#define FLASH_END	0x0d000000UL	// ending address of flash memory
#define FLASH_CACHE	0x80100000UL	// RAM buffer for copying image
#else
#define FLASH_START	0x00000000UL	// starting address of flash memory
#define FLASH_END	0x01000000UL	// ending address of flash memory
#define FLASH_CACHE 0x8c070000UL	// RAM buffer for copying image
#endif

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

// Constants from platform\odo\files\config.bib
#if defined(MIPS) || defined(PPC)
#define RAMIMG_FREE_RAM_BASE    0x80080000
#define RAMIMG_FREE_RAM_SIZE    0x580000       // 6M - 320K (reserved)
#define FLASHIMG_FREE_RAM_BASE  0x80080000   
#define FLASHIMG_FREE_RAM_SIZE  0xf80000       // 16M - 320K (reserved)
#else
#define RAMIMG_FREE_RAM_BASE    0xac030000
#define RAMIMG_FREE_RAM_SIZE    0x5b0000       // 6M - 320K (reserved)
#define FLASHIMG_FREE_RAM_BASE  0xac050000   
#define FLASHIMG_FREE_RAM_SIZE  0xfb0000       // 16M - 320K (reserved)
#endif

#ifdef MIPS
#define OS_ENTRY	0xad000004		// ROM/FLASH OS entry point
#else
#define OS_ENTRY	0xb8000004		// ROM/FLASH OS entry point
#endif

#endif

⌨️ 快捷键说明

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