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

📄 blcommon.cod

📁 EP9315的BSP包(WINCE下的BSP,内有各种驱动的详细的代码)
💻 COD
📖 第 1 页 / 共 2 页
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.20.9615 

	TTL	d:\wince420\platform\ep931x\eboot\.\blcommon.c
	CODE32

  00000			 AREA	 |.drectve|, DRECTVE
	DCB	"-defaultlib:coredll.lib "
	DCB	"-defaultlib:corelibc.lib "

	EXPORT	|pTOC| [ DATA ]
	EXPORT	|NKSignon| [ DATA ]

  00000			 AREA	 |.data|, DATA
	 COMMON	|g_pOEMVerifyMemory|, 0x4


  00000			 AREA	 |.rdata|, DATA, READONLY
|EdbgVendorIds| DCW 0x0
	DCW	0x0
	DCD	0x4033
	DCB	0x1
	DCB	"AD", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x4005
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x2078
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x10ec
	DCW	0x8029
	DCD	0xc0f0
	DCB	0x1
	DCB	"KS", 0x0
	DCW	0x10ec
	DCW	0x8129
	DCD	0x0
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0x900b
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xd0c9
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xe04c
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x1186
	DCW	0x1300
	DCD	0x50ba
	DCB	0x4
	DCB	"DL", 0x0
	DCW	0x100b
	DCW	0x20
	DCD	0xa0cc
	DCB	0x5
	DCB	"NG", 0x0
	DCW	0x10b7
	DCW	0x9050
	DCD	0x6008
	DCB	0x6
	DCB	"3C", 0x0
	DCW	0x10b7
	DCW	0x9200
	DCD	0x476
	DCB	0x6
	DCB	"3C", 0x0
|pTOC|	DCD	0xffffffff
	%	4
|NKSignon| DCB	0xa, "Microsoft Windows CE Ethernet Bootloader Common Lib"
	DCB	"rary Version %d.%d Built Jan 20 2007 09:53:23", 0xd, 0xa
	DCB	"Copyright (c) 2000-2001  Microsoft Corporation", 0xd, 0xa
	DCB	0x0
	EXPORT	|BootloaderMain|
	EXPORT	|??_C@_0CL@FKGK@System?5ready?$CB?$AN?6Preparing?5for?5dow@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BH@IFPC@Found?5pTOC?5signature?4?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BI@OBKJ@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CO@CLKL@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CM@PLHE@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CE@HOK@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| [ DATA ] ; `string'
	IMPORT	|OEMDebugInit|
	IMPORT	|OEMPlatformInit|
	IMPORT	|OEMPreDownload|
	IMPORT	|OEMLaunch|
	IMPORT	|OEMMapMemAddr|
	IMPORT	|bEthLaunch|
	IMPORT	|EdbgOutputDebugString|
	IMPORT	|memcpy|

  00000			 AREA	 |.bss|, NOINIT
|romhdr| %	0x54
; File d:\wince420\platform\ep931x\eboot\blcommon.c

  00000			 AREA	 |.text| { |BootloaderMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$BootloaderMain|, PDATA, SELECTION=5, ASSOC=|.text| { |BootloaderMain| } ; comdat associative
|$T37067| DCD	|BootloaderMain|
	DCD	0x40005c02

  00000			 AREA	 |.rdata| { |??_C@_0CL@FKGK@System?5ready?$CB?$AN?6Preparing?5for?5dow@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CL@FKGK@System?5ready?$CB?$AN?6Preparing?5for?5dow@| DCB "System "
	DCB	"ready!", 0xd, 0xa, "Preparing for download...", 0xd, 0xa
	DCB	0x0					; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BH@IFPC@Found?5pTOC?5signature?4?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BH@IFPC@Found?5pTOC?5signature?4?6?$AA@| DCB "Found pTOC signatur"
	DCB	"e.", 0xa, 0x0				; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BI@OBKJ@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BI@OBKJ@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@| DCB "ROMHDR at Ad"
	DCB	"dress %Xh", 0xd, 0xa, 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CO@CLKL@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CO@CLKL@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@| DCB "RomHdr.u"
	DCB	"lRAMStart=%Xh RomHdr.physfirst=%Xh.", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CM@PLHE@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CM@PLHE@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@| DCB "! Did n"
	DCB	"ot Find Windows CE pTOC signature.!", 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CE@HOK@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CE@HOK@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@| DCB "INFO: J"
	DCB	"umping to image at 0x%X...", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |BootloaderMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |BootloaderMain| PROC

; 70   : {

  00000	e92d4010	 stmdb     sp!, {r4, lr}
  00004	e24dd00c	 sub       sp, sp, #0xC
  00008		 |$M37065|

; 71   :     ROMHDR *pRomHdr = NULL;  // pTOC for NK image. MUST COPY IT OR CLEANBOOT may erase it
; 72   :     DWORD dwAction, dwpToc;   
; 73   :     DWORD dwImageStart = 0, dwImageLength = 0, dwLaunchAddr = 0;
; 74   : 
; 75   :     // relocate globals to RAM
; 76   :     if (!KernelRelocate (pTOC)) {

  00008	e59f015c	 ldr       r0, [pc, #0x15C]
  0000c	e3a04000	 mov       r4, #0
  00010	e5900000	 ldr       r0, [r0]
  00014	e58d4000	 str       r4, [sp]
  00018	e58d4008	 str       r4, [sp, #8]
  0001c	e58d4004	 str       r4, [sp, #4]
  00020	eb000000	 bl        KernelRelocate
  00024	e3500000	 cmp       r0, #0
  00028	1a000000	 bne       |$L36904|
  0002c		 |$L36903|

; 77   :         // spin forever
; 78   :         SPIN_FOREVER;

  0002c	eafffffe	 b         |$L36903|
  00030		 |$L36904|

; 79   :     }
; 80   : 
; 81   :     // (1) Init debug support. We can use OEMWriteDebugString afterward.
; 82   :     if (!OEMDebugInit ()) {

  00030	eb000000	 bl        OEMDebugInit
  00034	e3500000	 cmp       r0, #0
  00038	1a000000	 bne       |$L36908|
  0003c		 |$L36907|

; 83   :         // spin forever
; 84   :         SPIN_FOREVER;

  0003c	eafffffe	 b         |$L36907|
  00040		 |$L36908|

; 85   :     }
; 86   : 
; 87   :     // output banner
; 88   :     EdbgOutputDebugString (NKSignon, CURRENT_VERSION_MAJOR, CURRENT_VERSION_MINOR);

  00040	e59f0120	 ldr       r0, [pc, #0x120]
  00044	e3a02000	 mov       r2, #0
  00048	e3a01001	 mov       r1, #1
  0004c	eb000000	 bl        EdbgOutputDebugString

; 89   : 
; 90   :     // (3) initialize platform (clock, drivers, transports, etc)
; 91   :     if (!OEMPlatformInit ()) {

  00050	eb000000	 bl        OEMPlatformInit
  00054	e3500000	 cmp       r0, #0
  00058	1a000000	 bne       |$L36912|
  0005c		 |$L36911|

; 92   :         // spin forever
; 93   :         SPIN_FOREVER;

  0005c	eafffffe	 b         |$L36911|
  00060		 |$L36912|

; 94   :     }
; 95   : 
; 96   :     // system ready, preparing for download
; 97   :     EdbgOutputDebugString ("System ready!\r\nPreparing for download...\r\n");

  00060	e59f00fc	 ldr       r0, [pc, #0xFC]
  00064	eb000000	 bl        EdbgOutputDebugString

; 98   : 
; 99   :     // (4) call OEM specific pre-download function
; 100  :     switch (dwAction = OEMPreDownload ()) {

  00068	eb000000	 bl        OEMPreDownload
  0006c	e3500000	 cmp       r0, #0
  00070	0a000002	 beq       |$L36918|
  00074	e3500001	 cmp       r0, #1
  00078	0a00002b	 beq       |$L36933|
  0007c	ea00002f	 b         |$L36939|
  00080		 |$L36918|

; 101  :     case BL_DOWNLOAD:
; 102  :         // (5) download image
; 103  :         if (!DownloadImage (&dwImageStart, &dwImageLength, &dwLaunchAddr)) {

  00080	e28d2004	 add       r2, sp, #4
  00084	e28d1008	 add       r1, sp, #8
  00088	e28d0000	 add       r0, sp, #0
  0008c	eb000000	 bl        DownloadImage
  00090	e3500000	 cmp       r0, #0
  00094	1a000000	 bne       |$L36922|
  00098		 |$L36921|

; 104  :             SPIN_FOREVER;

  00098	eafffffe	 b         |$L36921|
  0009c		 |$L36922|

; 105  :         }
; 106  :         // Check for pTOC signature ("CECE") here, after image in place
; 107  :         if (*(LPDWORD) OEMMapMemAddr (dwImageStart, dwImageStart + PTOC_SIG_OFFSET) == PTOC_SIG) 

  0009c	e59d0000	 ldr       r0, [sp]
  000a0	e2801040	 add       r1, r0, #0x40
  000a4	eb000000	 bl        OEMMapMemAddr
  000a8	e59f20b0	 ldr       r2, [pc, #0xB0]
  000ac	e5901000	 ldr       r1, [r0]
  000b0	e1510002	 cmp       r1, r2
  000b4	1a000015	 bne       |$L36924|

; 108  :         {
; 109  :             EdbgOutputDebugString("Found pTOC signature.\n");

  000b8	e59f009c	 ldr       r0, [pc, #0x9C]
  000bc	eb000000	 bl        EdbgOutputDebugString

; 110  :             dwpToc = *(LPDWORD) OEMMapMemAddr (dwImageStart, dwImageStart + PTOC_OFFSET);

  000c0	e59d0000	 ldr       r0, [sp]
  000c4	e2801044	 add       r1, r0, #0x44
  000c8	eb000000	 bl        OEMMapMemAddr
  000cc	e5901000	 ldr       r1, [r0]

; 111  :             //
; 112  :             // need to map the content again since the pointer is going to be in a fixup address
; 113  :             ///
; 114  :             dwpToc = (DWORD) OEMMapMemAddr (dwImageStart, dwpToc);

  000d0	e59d0000	 ldr       r0, [sp]
  000d4	eb000000	 bl        OEMMapMemAddr

; 115  : 
; 116  : 
; 117  :             //
; 118  :             // NOTE: MUST COPY or a CLEAN_BOOT flag will erase it
; 119  :             //
; 120  :             memcpy (pRomHdr = &romhdr, (LPVOID) dwpToc, sizeof(ROMHDR));

  000d8	e59f4078	 ldr       r4, [pc, #0x78]
  000dc	e1a01000	 mov       r1, r0
  000e0	e1a00004	 mov       r0, r4
  000e4	e3a02054	 mov       r2, #0x54
  000e8	eb000000	 bl        memcpy

; 121  : 
; 122  :             EdbgOutputDebugString("ROMHDR at Address %Xh\r\n", dwImageStart + PTOC_SIG_OFFSET + sizeof (DWORD)); // right after signature

  000ec	e59d3000	 ldr       r3, [sp]
  000f0	e59f005c	 ldr       r0, [pc, #0x5C]
  000f4	e2831044	 add       r1, r3, #0x44
  000f8	eb000000	 bl        EdbgOutputDebugString

; 123  :             EdbgOutputDebugString("RomHdr.ulRAMStart=%Xh RomHdr.physfirst=%Xh.\r\n", romhdr.ulRAMStart, romhdr.physfirst);

  000fc	e5942008	 ldr       r2, [r4, #8]
  00100	e5941014	 ldr       r1, [r4, #0x14]
  00104	e59f0044	 ldr       r0, [pc, #0x44]
  00108	eb000000	 bl        EdbgOutputDebugString

; 124  : 
; 125  :         } else 

  0010c	ea000006	 b         |$L36933|
  00110		 |$L36924|

; 126  :         {
; 127  :             EdbgOutputDebugString("! Did not Find Windows CE pTOC signature.!\n");

  00110	e59f0034	 ldr       r0, [pc, #0x34]
  00114	eb000000	 bl        EdbgOutputDebugString

; 128  :             //
; 129  :             // In my image the rom header is not used anyway.
; 130  :             //
; 131  :             EdbgOutputDebugString("INFO: Jumping to image at 0x%X...\r\n", dwLaunchAddr);

  00118	e59d1004	 ldr       r1, [sp, #4]
  0011c	e59f0024	 ldr       r0, [pc, #0x24]
  00120	eb000000	 bl        EdbgOutputDebugString

; 132  :             bEthLaunch =FALSE;

  00124	e59f3018	 ldr       r3, [pc, #0x18]
  00128	e5834000	 str       r4, [r3]
  0012c		 |$L36933|

; 133  : 
; 134  :         }
; 135  : 
; 136  : 
; 137  :         // fall through
; 138  :     case BL_JUMP:
; 139  :         // (5) final call to launch the image. never returned
; 140  :         OEMLaunch (dwImageStart, dwImageLength, dwLaunchAddr, pRomHdr);

  0012c	e59d2004	 ldr       r2, [sp, #4]
  00130	e1a03004	 mov       r3, r4
  00134	e59d1008	 ldr       r1, [sp, #8]
  00138	e59d0000	 ldr       r0, [sp]
  0013c	eb000000	 bl        OEMLaunch
  00140		 |$L36939|

; 141  :         // should never return
; 142  :         // fall through
; 143  :     default:
; 144  :         // ERROR! spin forever
; 145  :         SPIN_FOREVER;

  00140	eafffffe	 b         |$L36939|
  00144		 |$L37069|
  00144	00000000	 DCD       |bEthLaunch|
  00148	00000000	 DCD       |??_C@_0CE@HOK@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@|
  0014c	00000000	 DCD       |??_C@_0CM@PLHE@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@|
  00150	00000000	 DCD       |??_C@_0CO@CLKL@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@|
  00154	00000000	 DCD       |??_C@_0BI@OBKJ@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@|
  00158	00000000	 DCD       |romhdr|
  0015c	00000000	 DCD       |??_C@_0BH@IFPC@Found?5pTOC?5signature?4?6?$AA@|
  00160	43454345	 DCD       0x43454345
  00164	00000000	 DCD       |??_C@_0CL@FKGK@System?5ready?$CB?$AN?6Preparing?5for?5dow@|
  00168	00000000	 DCD       |NKSignon|
  0016c	00000000	 DCD       |pTOC|
  00170		 |$M37066|

			 ENDP  ; |BootloaderMain|

	IMPORT	|memset|

  00000			 AREA	 |.text| { |KernelRelocate| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$KernelRelocate|, PDATA, SELECTION=5, ASSOC=|.text| { |KernelRelocate| } ; comdat associative
|$T37081| DCD	|KernelRelocate|
	DCD	0x40002301
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |KernelRelocate| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |KernelRelocate| PROC

; 154  : {

  00000	e92d40f0	 stmdb     sp!, {r4 - r7, lr}
  00004		 |$M37079|
  00004	e1a07000	 mov       r7, r0

; 155  :     ULONG loop;
; 156  :     COPYentry *cptr;
; 157  :     if (pTOC == (ROMHDR *const) -1) {

  00008	e3770001	 cmn       r7, #1

; 158  :         return FALSE; // spin forever!

  0000c	03a00000	 moveq     r0, #0

; 169  : }

  00010	08bd40f0	 ldmeqia   sp!, {r4 - r7, lr}
  00014	012fff1e	 bxeq      lr

; 159  :     }
; 160  :     // This is where the data sections become valid... don't read globals until after this
; 161  :     for (loop = 0; loop < pTOC->ulCopyEntries; loop++) {

  00018	e3a06000	 mov       r6, #0
  0001c	e5970020	 ldr       r0, [r7, #0x20]
  00020	e3500000	 cmp       r0, #0
  00024	9a000015	 bls       |$L36950|
  00028	e1a05006	 mov       r5, r6
  0002c		 |$L36948|
  0002c	e5970024	 ldr       r0, [r7, #0x24]
  00030	e0854000	 add       r4, r5, r0

; 162  :         cptr = (COPYentry *)(pTOC->ulCopyOffset + loop*sizeof(COPYentry));
; 163  :         if (cptr->ulCopyLen)

  00034	e5941008	 ldr       r1, [r4, #8]
  00038	e3510000	 cmp       r1, #0

; 164  :             memcpy((LPVOID)cptr->ulDest,(LPVOID)cptr->ulSource,cptr->ulCopyLen);

  0003c	11a02001	 movne     r2, r1
  00040	15940004	 ldrne     r0, [r4, #4]
  00044	15941000	 ldrne     r1, [r4]
  00048	1b000000	 blne      memcpy

; 165  :         if (cptr->ulCopyLen != cptr->ulDestLen)

  0004c	e5943008	 ldr       r3, [r4, #8]
  00050	e594000c	 ldr       r0, [r4, #0xC]
  00054	e1530000	 cmp       r3, r0

; 166  :             memset((LPVOID)(cptr->ulDest+cptr->ulCopyLen),0,cptr->ulDestLen-cptr->ulCopyLen);

  00058	10402003	 subne     r2, r0, r3
  0005c	15940004	 ldrne     r0, [r4, #4]
  00060	13a01000	 movne     r1, #0
  00064	10800003	 addne     r0, r0, r3
  00068	1b000000	 blne      memset
  0006c	e5970020	 ldr       r0, [r7, #0x20]
  00070	e2866001	 add       r6, r6, #1
  00074	e2855010	 add       r5, r5, #0x10
  00078	e1560000	 cmp       r6, r0

⌨️ 快捷键说明

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