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

📄 detection.cod

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

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

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


  00000			 AREA	 |.bss|, NOINIT
|g_sPcmciaInfo| % 0x8
	EXPORT	|OEMHDDDetect|
; File d:\wince420\platform\ep931x\eboot\detection.c

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

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

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

  00000		 |OEMHDDDetect| PROC

; 46   : {

  00000	e52de004	 str       lr, [sp, #-4]!
  00004		 |$M36057|

; 47   :     //
; 48   :     // Check to make sure that a card is inserted into the card slot.
; 49   :     //    
; 50   :     if(*GPIO_PFDR & ( GPIOF_PCMCIA_CD1 | GPIOF_PCMCIA_CD2 ) )

  00004	e59f0030	 ldr       r0, [pc, #0x30]
  00008	e5900000	 ldr       r0, [r0]
  0000c	e3100006	 tst       r0, #6

; 51   :     {
; 52   :         return FALSE;

  00010	1a000005	 bne       |$L36008|

; 53   :     }
; 54   : 
; 55   :     //
; 56   :     // Read certain locations in attribute space to see if it is a compact flash 
; 57   :     // cards.
; 58   :     //
; 59   :     PCMCIAParseTuples();

  00014	eb000000	 bl        PCMCIAParseTuples

; 60   : 
; 61   :     //
; 62   :     // Check to see if it is a hard drive.
; 63   :     // 
; 64   :     if(g_sPcmciaInfo.ucFuncID == FUNCTION_FIXED_DISK)

  00018	e59f3018	 ldr       r3, [pc, #0x18]
  0001c	e5d30007	 ldrb      r0, [r3, #7]
  00020	e3500004	 cmp       r0, #4

; 65   :         return TRUE;

  00024	e3a00001	 mov       r0, #1
  00028	0a000000	 beq       |$L36005|
  0002c		 |$L36008|

; 66   :     
; 67   :     return FALSE;    

  0002c	e3a00000	 mov       r0, #0
  00030		 |$L36005|

; 68   : }

  00030	e8bd4000	 ldmia     sp!, {lr}
  00034	e12fff1e	 bx        lr
  00038		 |$L36061|
  00038	00000000	 DCD       |g_sPcmciaInfo|
  0003c	80840030	 DCD       0x80840030
  00040		 |$M36058|

			 ENDP  ; |OEMHDDDetect|

	EXPORT	|OEMNE2000Detect|

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

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

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

  00000		 |OEMNE2000Detect| PROC

; 77   : {

  00000	e52de004	 str       lr, [sp, #-4]!
  00004		 |$M36067|

; 78   :     //
; 79   :     // Check to make sure that a card is inserted into the card slot.
; 80   :     //    
; 81   :     if(*GPIO_PFDR & ( GPIOF_PCMCIA_CD1 | GPIOF_PCMCIA_CD2 ) )

  00004	e59f0088	 ldr       r0, [pc, #0x88]
  00008	e5900000	 ldr       r0, [r0]
  0000c	e3100006	 tst       r0, #6

; 82   :     {
; 83   :         return FALSE;

  00010	1a00001b	 bne       |$L36017|

; 84   :     }
; 85   : 
; 86   :     //
; 87   :     // Read certain locations in attribute space to see if it is a compact flash 
; 88   :     // cards.
; 89   :     //
; 90   :     PCMCIAParseTuples();

  00014	eb000000	 bl        PCMCIAParseTuples

; 91   : 
; 92   :     //
; 93   :     // Check to see if it is a Socket LPE NE2000 card.
; 94   :     //
; 95   :     if(g_sPcmciaInfo.usManfID == MANFID_SOCKET && 
; 96   :       (g_sPcmciaInfo.ucProdID == PRODID_SOCKET_LPE || 
; 97   :        g_sPcmciaInfo.ucProdID == PRODID_SOCKET_LPE_CF))

  00018	e59f3070	 ldr       r3, [pc, #0x70]
  0001c	e1d300b4	 ldrh      r0, [r3, #4]
  00020	e1a01800	 mov       r1, r0, lsl #16
  00024	e1a02821	 mov       r2, r1, lsr #16
  00028	e5d31006	 ldrb      r1, [r3, #6]
  0002c	e3520f41	 cmp       r2, #0x41, 30
  00030	1a000006	 bne       |$L36014|
  00034	e20100ff	 and       r0, r1, #0xFF
  00038	e350000d	 cmp       r0, #0xD
  0003c	0a000001	 beq       |$L36015|
  00040	e3500075	 cmp       r0, #0x75
  00044	1a000001	 bne       |$L36014|
  00048		 |$L36015|

; 98   :     {
; 99   :         *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x21;

  00048	e3a00021	 mov       r0, #0x21

; 100  :         return TRUE;

  0004c	ea000006	 b         |$L36066|
  00050		 |$L36014|

; 101  :     }
; 102  : 
; 103  :     //
; 104  :     // Check to see if it is a Corega NE2000 card.
; 105  :     //
; 106  :     if(g_sPcmciaInfo.usManfID == MANFID_COREGA && 
; 107  :        g_sPcmciaInfo.ucProdID == PRODID_COREGA_PCCT )

  00050	e3a00903	 mov       r0, #3, 18
  00054	e380000f	 orr       r0, r0, #0xF
  00058	e1520000	 cmp       r2, r0
  0005c	1a000008	 bne       |$L36017|
  00060	e31100ff	 tst       r1, #0xFF
  00064	1a000006	 bne       |$L36017|

; 108  :     {
; 109  :        *(volatile unsigned short *)(PCMCIACARD_ATTRIBUTE + 0x3F8) = 0x26;

  00068	e3a00026	 mov       r0, #0x26
  0006c		 |$L36066|
  0006c	e3a01312	 mov       r1, #0x12, 6
  00070	e3811ffe	 orr       r1, r1, #0xFE, 30
  00074	e1c100b0	 strh      r0, [r1]

; 110  :         return TRUE;

  00078	e3a00001	 mov       r0, #1

; 114  : }

  0007c	e8bd4000	 ldmia     sp!, {lr}
  00080	e12fff1e	 bx        lr
  00084		 |$L36017|

; 111  :     }
; 112  :     
; 113  :     return FALSE;    

  00084	e3a00000	 mov       r0, #0

; 114  : }

  00088	e8bd4000	 ldmia     sp!, {lr}
  0008c	e12fff1e	 bx        lr
  00090		 |$L36071|
  00090	00000000	 DCD       |g_sPcmciaInfo|
  00094	80840030	 DCD       0x80840030
  00098		 |$M36068|

			 ENDP  ; |OEMNE2000Detect|

	EXPORT	|??_C@_0DB@HECA@ManfID?5?$DN?50x?$CFx?0?5ProdID?5?$DN?50x?$CFx?0?5uc@| [ DATA ] ; `string'
	IMPORT	|EdbgOutputDebugString|

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

  00000			 AREA	 |.pdata$$PCMCIAParseTuples|, PDATA, SELECTION=5, ASSOC=|.text| { |PCMCIAParseTuples| } ; comdat associative
|$T36083| DCD	|PCMCIAParseTuples|
	DCD	0x40004201

  00000			 AREA	 |.rdata| { |??_C@_0DB@HECA@ManfID?5?$DN?50x?$CFx?0?5ProdID?5?$DN?50x?$CFx?0?5uc@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DB@HECA@ManfID?5?$DN?50x?$CFx?0?5ProdID?5?$DN?50x?$CFx?0?5uc@| DCB "M"
	DCB	"anfID = 0x%x, ProdID = 0x%x, ucFundID = 0x%x ", 0xd, 0xa
	DCB	0x0					; `string'
; Function compile flags: /Ogsy

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

  00000		 |PCMCIAParseTuples| PROC

; 124  : {

  00000	e92d4030	 stmdb     sp!, {r4, r5, lr}
  00004		 |$M36081|

; 125  :     volatile unsigned short *pCis = (volatile unsigned short *)PCMCIACARD_ATTRIBUTE;
; 126  : 
; 127  : 
; 128  :     //
; 129  :     // Return if the PCMCIA has already been parsed.
; 130  :     //
; 131  :     if(g_sPcmciaInfo.bInitialized)

  00004	e59f50f8	 ldr       r5, [pc, #0xF8]
  00008	e3a04312	 mov       r4, #0x12, 6
  0000c	e5950000	 ldr       r0, [r5]
  00010	e3500000	 cmp       r0, #0
  00014	1a000037	 bne       |$L36020|

; 132  :     {
; 133  :         return;
; 134  :     }
; 135  :         
; 136  : 
; 137  :     //
; 138  :     // Search thru all the CIS tuples until find CISTPL_VERS_1
; 139  :     // tuple or reach the end of all tuples
; 140  :     //
; 141  :     while ((*pCis & 0xFF) != CISTPL_END && ((ULONG)pCis < PCMCIACARD_ATTRIBUTE + 0x500))

  00018	ea000027	 b         |$L36079|
  0001c		 |$L36026|
  0001c	e3a00312	 mov       r0, #0x12, 6
  00020	e3800c05	 orr       r0, r0, #5, 24
  00024	e1540000	 cmp       r4, r0
  00028	2a000029	 bcs       |$L36076|

; 142  :     {
; 143  :         switch (*pCis & 0xFF)
; 144  :         {

  0002c	e1d400b0	 ldrh      r0, [r4]
  00030	e1a01800	 mov       r1, r0, lsl #16
  00034	e1a02821	 mov       r2, r1, lsr #16
  00038	e20200ff	 and       r0, r2, #0xFF
  0003c	e3500020	 cmp       r0, #0x20
  00040	0a000005	 beq       |$L36032|
  00044	e3500021	 cmp       r0, #0x21
  00048	1a000014	 bne       |$L36029|

; 148  :                 break;
; 149  :             case CISTPL_FUNCID:      
; 150  :                 g_sPcmciaInfo.ucFuncID = (UCHAR)(pCis[2] & 0xFF);

  0004c	e2840004	 add       r0, r4, #4
  00050	e1d010b0	 ldrh      r1, [r0]
  00054	e5c51007	 strb      r1, [r5, #7]

; 151  :                 break;

  00058	ea00000f	 b         |$L36080|
  0005c		 |$L36032|

; 145  :             case CISTPL_MANFID:      
; 146  :                 g_sPcmciaInfo.usManfID = (pCis[2] & 0xFF) | ((pCis[3] & 0xFF) << 8);

  0005c	e2840004	 add       r0, r4, #4
  00060	e1d010b0	 ldrh      r1, [r0]
  00064	e1a02801	 mov       r2, r1, lsl #16
  00068	e1a00822	 mov       r0, r2, lsr #16
  0006c	e2841006	 add       r1, r4, #6
  00070	e20030ff	 and       r3, r0, #0xFF
  00074	e1d100b0	 ldrh      r0, [r1]
  00078	e1a02800	 mov       r2, r0, lsl #16
  0007c	e1a01822	 mov       r1, r2, lsr #16
  00080	e1830401	 orr       r0, r3, r1, lsl #8
  00084	e1a02800	 mov       r2, r0, lsl #16
  00088	e1a01822	 mov       r1, r2, lsr #16

; 147  :                 g_sPcmciaInfo.ucProdID = pCis[4] & 0xFF;

  0008c	e2840008	 add       r0, r4, #8
  00090	e1c510b4	 strh      r1, [r5, #4]
  00094	e1d010b0	 ldrh      r1, [r0]
  00098	e5c51006	 strb      r1, [r5, #6]
  0009c		 |$L36080|
  0009c	e20120ff	 and       r2, r1, #0xFF
  000a0		 |$L36029|

; 152  :             default:
; 153  :                 break;
; 154  :         }
; 155  :         pCis += (*(pCis + 1) & 0xFF) + 2;  

  000a0	e2840002	 add       r0, r4, #2
  000a4	e1d010b0	 ldrh      r1, [r0]
  000a8	e1a02801	 mov       r2, r1, lsl #16
  000ac	e1a00822	 mov       r0, r2, lsr #16
  000b0	e20010ff	 and       r1, r0, #0xFF
  000b4	e2812002	 add       r2, r1, #2
  000b8	e0844082	 add       r4, r4, r2, lsl #1
  000bc		 |$L36079|
  000bc	e1d400b0	 ldrh      r0, [r4]
  000c0	e1a01800	 mov       r1, r0, lsl #16
  000c4	e1a02821	 mov       r2, r1, lsr #16
  000c8	e20200ff	 and       r0, r2, #0xFF
  000cc	e35000ff	 cmp       r0, #0xFF
  000d0	1affffd1	 bne       |$L36026|
  000d4		 |$L36076|

; 132  :     {
; 133  :         return;
; 134  :     }
; 135  :         
; 136  : 
; 137  :     //
; 138  :     // Search thru all the CIS tuples until find CISTPL_VERS_1
; 139  :     // tuple or reach the end of all tuples
; 140  :     //
; 141  :     while ((*pCis & 0xFF) != CISTPL_END && ((ULONG)pCis < PCMCIACARD_ATTRIBUTE + 0x500))

  000d4	e1d500b4	 ldrh      r0, [r5, #4]
  000d8	e5d53007	 ldrb      r3, [r5, #7]

; 156  :     }
; 157  : 
; 158  :     EdbgOutputDebugString
; 159  :     (
; 160  :         "ManfID = 0x%x, ProdID = 0x%x, ucFundID = 0x%x \r\n", 
; 161  :         (unsigned int)g_sPcmciaInfo.usManfID,
; 162  :         (unsigned int) g_sPcmciaInfo.ucProdID,
; 163  :         (unsigned int)g_sPcmciaInfo.ucFuncID
; 164  :     );

  000dc	e1a01800	 mov       r1, r0, lsl #16
  000e0	e5d52006	 ldrb      r2, [r5, #6]
  000e4	e59f0014	 ldr       r0, [pc, #0x14]
  000e8	e1a01821	 mov       r1, r1, lsr #16
  000ec	eb000000	 bl        EdbgOutputDebugString

; 165  : 
; 166  :     g_sPcmciaInfo.bInitialized = TRUE;

  000f0	e3a03001	 mov       r3, #1
  000f4	e5853000	 str       r3, [r5]
  000f8		 |$L36020|

; 167  : }        

  000f8	e8bd4030	 ldmia     sp!, {r4, r5, lr}
  000fc	e12fff1e	 bx        lr
  00100		 |$L36085|
  00100	00000000	 DCD       |??_C@_0DB@HECA@ManfID?5?$DN?50x?$CFx?0?5ProdID?5?$DN?50x?$CFx?0?5uc@|
  00104	00000000	 DCD       |g_sPcmciaInfo|
  00108		 |$M36082|

			 ENDP  ; |PCMCIAParseTuples|

	END

⌨️ 快捷键说明

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