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

📄 halkitl.cod

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

	TTL	d:\wince420\platform\ep931x\kernel\hal\.\halkitl.c
	CODE32

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


  00000			 AREA	 |.data|, DATA
	 COMMON	|bActiveKitl|, 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
	EXPORT	|InitDebugEther|
	EXPORT	|??_C@_0BC@JBAE@KITL?5Initialized?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0DM@LNO@KITL?5Initialization?5Failed?0?5No?5d@| [ DATA ] ; `string'
	IMPORT	|KitlInit|
	IMPORT	|EdbgOutputDebugString|
; File d:\wince420\platform\ep931x\kernel\hal\halkitl.c

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

  00000			 AREA	 |.pdata$$InitDebugEther|, PDATA, SELECTION=5, ASSOC=|.text| { |InitDebugEther| } ; comdat associative
|$T14170| DCD	|InitDebugEther|
	DCD	0x40000b01

  00000			 AREA	 |.rdata| { |??_C@_0BC@JBAE@KITL?5Initialized?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BC@JBAE@KITL?5Initialized?6?$AA@| DCB "KITL Initialized", 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0DM@LNO@KITL?5Initialization?5Failed?0?5No?5d@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DM@LNO@KITL?5Initialization?5Failed?0?5No?5d@| DCB "KITL Initiali"
	DCB	"zation Failed, No debugging support available", 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy

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

  00000		 |InitDebugEther| PROC

; 54   : {

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

; 55   :     // Initialize KITL transport
; 56   :     if (KitlInit (TRUE)) {

  00004	e3a00001	 mov       r0, #1
  00008	eb000000	 bl        KitlInit
  0000c	e3500000	 cmp       r0, #0

; 57   :         KITLOutputDebugString ("KITL Initialized\n");

  00010	159f0010	 ldrne     r0, [pc, #0x10]

; 58   :         // no longer need to start kernel services
; 59   :         // since KITL config message told us what to start and
; 60   :         // kitl will start it accordingly
; 61   : //        if (gpKitl->dwBootFlags & KITL_FL_DBGMSG)
; 62   : //            SetKernelCommDev (KERNEL_SVC_DBGMSG, KERNEL_COMM_ETHER);
; 63   : //        if (gpKitl->dwBootFlags & KITL_FL_PPSH)
; 64   : //            SetKernelCommDev (KERNEL_SVC_PPSH, KERNEL_COMM_ETHER);
; 65   : //        if (gpKitl->dwBootFlags & KITL_FL_KDBG)
; 66   : //            SetKernelCommDev (KERNEL_SVC_KDBG, KERNEL_COMM_ETHER);
; 67   :     } else {
; 68   :         KITLOutputDebugString ("KITL Initialization Failed, No debugging support available\n");

  00014	059f0008	 ldreq     r0, [pc, #8]
  00018	eb000000	 bl        EdbgOutputDebugString

; 69   :     }
; 70   : }

  0001c	e8bd4000	 ldmia     sp!, {lr}
  00020	e12fff1e	 bx        lr
  00024		 |$L14172|
  00024	00000000	 DCD       |??_C@_0DM@LNO@KITL?5Initialization?5Failed?0?5No?5d@|
  00028	00000000	 DCD       |??_C@_0BC@JBAE@KITL?5Initialized?6?$AA@|
  0002c		 |$M14169|

			 ENDP  ; |InitDebugEther|

	EXPORT	|InitParallelSerial|
	IMPORT	|SetKernelCommDev|
	IMPORT	|OEMInitParallelPort|

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

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

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

  00000		 |InitParallelSerial| PROC

; 73   : {

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

; 74   :     //
; 75   :     // Initialize the parallel port stuff.
; 76   :     OEMInitParallelPort();

  00004	eb000000	 bl        OEMInitParallelPort

; 77   : 
; 78   :     //
; 79   :     // Set the debugger to use serial/parallel.
; 80   :     //
; 81   :     SetKernelCommDev(KERNEL_SVC_DBGMSG,KERNEL_COMM_SERIAL);

  00008	e3a01000	 mov       r1, #0
  0000c	e3a00000	 mov       r0, #0
  00010	eb000000	 bl        SetKernelCommDev

; 82   :     SetKernelCommDev(KERNEL_SVC_PPSH,  KERNEL_COMM_PARALLEL);

  00014	e3a01001	 mov       r1, #1
  00018	e3a00001	 mov       r0, #1
  0001c	eb000000	 bl        SetKernelCommDev

; 83   :     SetKernelCommDev(KERNEL_SVC_KDBG, KERNEL_COMM_SERIAL);

  00020	e3a01000	 mov       r1, #0
  00024	e3a00002	 mov       r0, #2
  00028	eb000000	 bl        SetKernelCommDev

; 84   : 
; 85   :     return FALSE;

  0002c	e3a00000	 mov       r0, #0

; 86   : }

  00030	e8bd4000	 ldmia     sp!, {lr}
  00034	e12fff1e	 bx        lr
  00038		 |$M14177|

			 ENDP  ; |InitParallelSerial|

	EXPORT	|KitlEthEnableInts|
	IMPORT	|OEMEthEnableInts|
	IMPORT	|OEMEthDisableInts|

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

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

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

  00000		 |KitlEthEnableInts| PROC

; 90   : {

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

; 91   :     if (bEnable) 

  00004	e3500000	 cmp       r0, #0
  00008	0a000002	 beq       |$L14056|

; 92   :         OEMEthEnableInts();

  0000c	eb000000	 bl        OEMEthEnableInts

; 95   : }

  00010	e8bd4000	 ldmia     sp!, {lr}
  00014	e12fff1e	 bx        lr
  00018		 |$L14056|

; 93   :     else 
; 94   :         OEMEthDisableInts();

  00018	eb000000	 bl        OEMEthDisableInts

; 95   : }

  0001c	e8bd4000	 ldmia     sp!, {lr}
  00020	e12fff1e	 bx        lr
  00024		 |$M14184|

			 ENDP  ; |KitlEthEnableInts|

	EXPORT	|InitEther|
	EXPORT	|??_C@_0M@EILI@?$CLInitEther?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BH@PGGC@Using?5device?5name?3?5?$CFs?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0BL@KGFO@Device?5?$CFs?0?5IP?5?$CFs?0?5Port?5?$CFd?6?$AA@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CL@FJON@Unable?5to?5initialize?5KITL?5Ether?5@| [ DATA ] ; `string'
	EXPORT	|??_C@_0M@DHJI@?9InitEther?6?$AA@| [ DATA ] ; `string'
	IMPORT	|OEMEthInit|
	IMPORT	|OEMEthGetFrame|
	IMPORT	|inet_ntoa|
	IMPORT	|EbootGetDHCPAddr|
	IMPORT	|KitlEtherInit|
	IMPORT	|KitlEtherEncodeUDP|
	IMPORT	|KitlEtherDecodeUDP|
	IMPORT	|KitlEtherGetFrameHdrSize|
	IMPORT	|CreateDeviceName|
	IMPORT	|memset|
	IMPORT	|memcpy|

  00000			 AREA	 |.bss|, NOINIT
|MyAddr| %	0xc

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

  00000			 AREA	 |.pdata$$InitEther|, PDATA, SELECTION=5, ASSOC=|.text| { |InitEther| } ; comdat associative
|$T14198| DCD	|InitEther|
	DCD	0x40008902

  00000			 AREA	 |.rdata| { |??_C@_0M@EILI@?$CLInitEther?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0M@EILI@?$CLInitEther?6?$AA@| DCB "+InitEther", 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BH@PGGC@Using?5device?5name?3?5?$CFs?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BH@PGGC@Using?5device?5name?3?5?$CFs?6?$AA@| DCB "Using device na"
	DCB	"me: %s", 0xa, 0x0			; `string'

  00000			 AREA	 |.rdata| { |??_C@_0BL@KGFO@Device?5?$CFs?0?5IP?5?$CFs?0?5Port?5?$CFd?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BL@KGFO@Device?5?$CFs?0?5IP?5?$CFs?0?5Port?5?$CFd?6?$AA@| DCB "De"
	DCB	"vice %s, IP %s, Port %d", 0xa, 0x0	; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CL@FJON@Unable?5to?5initialize?5KITL?5Ether?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CL@FJON@Unable?5to?5initialize?5KITL?5Ether?5@| DCB "Unable to in"
	DCB	"itialize KITL Ether transport", 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0M@DHJI@?9InitEther?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0M@DHJI@?9InitEther?6?$AA@| DCB "-InitEther", 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy

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

  00000		 |InitEther| PROC

; 132  : {

  00000	e92d47f0	 stmdb     sp!, {r4 - r10, lr}
  00004	e24dd020	 sub       sp, sp, #0x20
  00008		 |$M14196|
  00008	e1a08000	 mov       r8, r0

; 133  :     EDBG_ADAPTER adp;
; 134  :     DWORD dwDHCPLeaseTime;
; 135  :     DWORD dwSubnetMask;
; 136  : 
; 137  :     KITLOutputDebugString ("+InitEther\n");

  0000c	e59f020c	 ldr       r0, [pc, #0x20C]
  00010	eb000000	 bl        EdbgOutputDebugString

; 138  : 
; 139  :     memset (&adp, 0, sizeof(adp));

  00014	e3a02018	 mov       r2, #0x18
  00018	e3a01000	 mov       r1, #0
  0001c	e28d0008	 add       r0, sp, #8
  00020	eb000000	 bl        memset

; 140  :     memset (pKitl, 0, sizeof (KITLTRANSPORT));

  00024	e3a0203c	 mov       r2, #0x3C
  00028	e3a01000	 mov       r1, #0
  0002c	e1a00008	 mov       r0, r8
  00030	eb000000	 bl        memset

; 141  : 
; 142  :     // use existing code for ether initialization
; 143  :     if (!OEMEthInit (&adp))

  00034	e28d0008	 add       r0, sp, #8
  00038	eb000000	 bl        OEMEthInit
  0003c	e3500000	 cmp       r0, #0

; 144  :         return FALSE;

  00040	0a000028	 beq       |$L14195|

; 145  : 
; 146  :     // we are going to completely ignore the info in bootargs and the adaptor info
; 147  :     // returned from OEMEthInit, except MAC address. Just to prove that KITL will connect standalone
; 148  : 
; 149  :     // get the MAC address
; 150  :     MyAddr.wMAC[0] = adp.Addr.wMAC[0];
; 151  :     MyAddr.wMAC[1] = adp.Addr.wMAC[1];

  00044	e59d200c	 ldr       r2, [sp, #0xC]

; 152  :     MyAddr.wMAC[2] = adp.Addr.wMAC[2];
; 153  :     
; 154  :     if((DRIVER_GLOBALS_POINTER)->eth.EbootMagicNum == EBOOT_MAGIC_NUM )
; 155  :     {
; 156  :         memcpy
; 157  :         (
; 158  :             pKitl->szName, 
; 159  :             (DRIVER_GLOBALS_POINTER)->eth.strEdbgName, 
; 160  :             EDBG_MAX_DEV_NAMELEN
; 161  :         );

  00048	e2885004	 add       r5, r8, #4
  0004c	e59f61c8	 ldr       r6, [pc, #0x1C8]
  00050	e1a00802	 mov       r0, r2, lsl #16
  00054	e1dd31b0	 ldrh      r3, [sp, #0x10]
  00058	e1a01820	 mov       r1, r0, lsr #16
  0005c	e1a02822	 mov       r2, r2, lsr #16
  00060	e1c610b4	 strh      r1, [r6, #4]
  00064	e3a0020a	 mov       r0, #0xA, 4
  00068	e1c620b6	 strh      r2, [r6, #6]
  0006c	e3800b22	 orr       r0, r0, #0x22, 22
  00070	e1c630b8	 strh      r3, [r6, #8]
  00074	e5900000	 ldr       r0, [r0]
  00078	e59f1198	 ldr       r1, [pc, #0x198]
  0007c	e1500001	 cmp       r0, r1
  00080	1a000004	 bne       |$L14089|
  00084	e59f1188	 ldr       r1, [pc, #0x188]
  00088	e3a02010	 mov       r2, #0x10
  0008c	e1a00005	 mov       r0, r5
  00090	eb000000	 bl        memcpy

; 162  :     }
; 163  :     else

  00094	ea000002	 b         |$L14091|
  00098		 |$L14089|

; 164  :     {
; 165  :         CreateDeviceName(&MyAddr, pKitl->szName);

  00098	e1a01005	 mov       r1, r5
  0009c	e1a00006	 mov       r0, r6
  000a0	eb000000	 bl        CreateDeviceName
  000a4		 |$L14091|

; 166  :     }
; 167  :     KITLOutputDebugString ("Using device name: %s\n", pKitl->szName);

  000a4	e59f0164	 ldr       r0, [pc, #0x164]
  000a8	e1a01005	 mov       r1, r5
  000ac	eb000000	 bl        EdbgOutputDebugString

; 168  : 
; 169  :     // If we haven't been given an IP address from our loader (or if we're not using static IP), get an IP address
; 170  :     // from a DHCP server.
; 171  :     if (adp.Addr.dwIP)

  000b0	e59d1008	 ldr       r1, [sp, #8]
  000b4	e3a07000	 mov       r7, #0
  000b8	e3510000	 cmp       r1, #0

; 172  :     {
; 173  :         // Static IP or we got the IP from our bootloader...
; 174  :         MyAddr.dwIP     = adp.Addr.dwIP;
; 175  :         dwSubnetMask    = 0;    // Don't care about subnet mask...
; 176  :         dwDHCPLeaseTime = adp.DHCPLeaseTime;

  000bc	159d0018	 ldrne     r0, [sp, #0x18]
  000c0	15861000	 strne     r1, [r6]
  000c4	158d7004	 strne     r7, [sp, #4]
  000c8	158d0000	 strne     r0, [sp]
  000cc	1a000008	 bne       |$L14095|

; 177  :     }
; 178  :     else
; 179  :     {
; 180  :         // Get a DHCP address...
; 181  :         if (!EbootGetDHCPAddr (&MyAddr, &dwSubnetMask, &dwDHCPLeaseTime))

⌨️ 快捷键说明

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