📄 dl_device_serial.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4345
TTL E:\WM604\PLATFORM\SEUICBSP\SRC\BOOTLOADER\EBOOT\.\DL_Device_Serial.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
00000 AREA |.data|, DATA
COMMON |g_pUARTReg|, 0x4
00000 AREA |.bss|, NOINIT
|g_SerialInitialized| % 0x4
|?Tail@?1??Serial_ReadData@@9@9| % 0x4 ; `Serial_ReadData'::`2'::Tail
00000 AREA |.data|, DATA
|?BlockNum@?1??Serial_ReadData@@9@9| DCB 0x1 ; `Serial_ReadData'::`2'::BlockNum
% 3
|?Front@?1??Serial_ReadData@@9@9| DCD 0xffffffff ; `Serial_ReadData'::`2'::Front
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 |GetCharReady|
; File e:\wm604\platform\seuicbsp\src\bootloader\eboot\dl_device_serial.c
00000 AREA |.text| { |GetCharReady| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetCharReady|, PDATA, SELECTION=5, ASSOC=|.text| { |GetCharReady| } ; comdat associative
|$T43021| DCD |$L43020|
DCD 0x40000800
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetCharReady| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetCharReady| PROC
; 28 : {
00000 |$L43020|
00000 |$M43018|
; 29 : if(((g_pUARTReg->lsr) & 0x1) != 0)
00000 e59f3014 ldr r3, [pc, #0x14]
00004 e5933000 ldr r3, [r3]
00008 e5933014 ldr r3, [r3, #0x14]
0000c e3130001 tst r3, #1
; 30 : return TRUE;
00010 13a00001 movne r0, #1
; 31 : else
; 32 : return FALSE;
00014 03a00000 moveq r0, #0
; 33 : }
00018 e12fff1e bx lr
0001c |$L43023|
0001c 00000000 DCD |g_pUARTReg|
00020 |$M43019|
ENDP ; |GetCharReady|
EXPORT |GetBytes|
00000 AREA |.text| { |GetBytes| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetBytes|, PDATA, SELECTION=5, ASSOC=|.text| { |GetBytes| } ; comdat associative
|$T43043| DCD |$L43042|
DCD 0x40002101
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetBytes| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetBytes| PROC
; 37 : {
00000 |$L43042|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 |$M43040|
; 38 : int num = 0;
00004 e3a02000 mov r2, #0
; 39 : int timewaited = 0, data;
00008 e3a0e000 mov lr, #0
; 40 :
; 41 : while(num < len)
0000c e3510000 cmp r1, #0
00010 da000013 ble |$L42886|
00014 e59f5064 ldr r5, [pc, #0x64]
00018 e59f605c ldr r6, [pc, #0x5C]
0001c e5954000 ldr r4, [r5]
; 42 : {
; 43 : while(!(g_pUARTReg->lsr & 0x1))
00020 ea000002 b |$L42885|
00024 |$L42888|
; 44 : {
; 45 : //make sure there are data in serial buffer
; 46 : if(timewaited > TIMEOUT_SERIAL)
00024 e15e0006 cmp lr, r6
00028 ca000010 bgt |$L43029|
; 47 : {
; 48 : return FALSE;
; 49 : }
; 50 : timewaited++;
0002c e28ee001 add lr, lr, #1
; 40 :
; 41 : while(num < len)
00030 |$L42885|
; 44 : {
; 45 : //make sure there are data in serial buffer
; 46 : if(timewaited > TIMEOUT_SERIAL)
00030 e5943014 ldr r3, [r4, #0x14]
; 47 : {
; 48 : return FALSE;
; 49 : }
; 50 : timewaited++;
00034 e3130001 tst r3, #1
00038 0afffff9 beq |$L42888|
; 51 : }
; 52 : timewaited = 0;
; 53 : // Read data
; 54 : data = g_pUARTReg->thr_rbr_dll;
0003c e5943000 ldr r3, [r4]
00040 e3a0e000 mov lr, #0
; 55 : buf[num] = (unsigned char)(data & 0xff);
00044 e7c23000 strb r3, [r2, +r0]
; 56 : if(g_pUARTReg->lsr & 0x8c)
00048 e5954000 ldr r4, [r5]
0004c e5943014 ldr r3, [r4, #0x14]
00050 e313008c tst r3, #0x8C
00054 1a000005 bne |$L43029|
; 59 : }
; 60 : num++;
00058 e2822001 add r2, r2, #1
0005c e1520001 cmp r2, r1
00060 bafffff2 blt |$L42885|
00064 |$L42886|
; 61 : }
; 62 : return TRUE;
00064 e3a00001 mov r0, #1
; 63 : }
00068 e8bd4070 ldmia sp!, {r4 - r6, lr}
0006c e12fff1e bx lr
00070 |$L43029|
; 57 : {
; 58 : return(FALSE);
00070 e3a00000 mov r0, #0
; 63 : }
00074 e8bd4070 ldmia sp!, {r4 - r6, lr}
00078 e12fff1e bx lr
0007c |$L43045|
0007c 01c9c380 DCD 0x1c9c380
00080 00000000 DCD |g_pUARTReg|
00084 |$M43041|
ENDP ; |GetBytes|
EXPORT |GetPacket|
EXPORT |GetPacketData|
00000 AREA |.text| { |GetPacketData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetPacketData|, PDATA, SELECTION=5, ASSOC=|.text| { |GetPacketData| } ; comdat associative
|$T43057| DCD |$L43056|
DCD 0x40002702
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetPacketData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetPacketData| PROC
; 66 : {
00000 |$L43056|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M43054|
00008 e1a04002 mov r4, r2
0000c e1a05001 mov r5, r1
00010 e1a06000 mov r6, r0
; 67 : unsigned char seq[2];
; 68 : unsigned char csum;
; 69 :
; 70 : if(GetBytes(seq, 2) == FALSE) //get sequence num
00014 e3a01002 mov r1, #2
00018 e28d0002 add r0, sp, #2
0001c eb000000 bl GetBytes
00020 e3500000 cmp r0, #0
; 71 : return FALSE;
00024 0a000016 beq |$L42908|
; 72 :
; 73 : if(GetBytes((unsigned char *)buf, *len) == FALSE) //get the data
00028 e5951000 ldr r1, [r5]
0002c e1a00006 mov r0, r6
00030 eb000000 bl GetBytes
00034 e3500000 cmp r0, #0
; 74 : return FALSE;
00038 0a000011 beq |$L42908|
; 75 :
; 76 : if(GetBytes(&csum, 1) == FALSE) //get the checksum
0003c e3a01001 mov r1, #1
00040 e28d0000 add r0, sp, #0
00044 eb000000 bl GetBytes
00048 e3500000 cmp r0, #0
; 77 : return FALSE;
0004c 0a00000c beq |$L42908|
; 78 :
; 79 : if(seq[0] != blocknum)
00050 e5dd3002 ldrb r3, [sp, #2]
00054 e1530004 cmp r3, r4
00058 0a00000b beq |$L42911|
; 80 : {
; 81 : if((blocknum == 0x02) && (seq[0] == 0x01))
0005c e3540002 cmp r4, #2
00060 1a000007 bne |$L42908|
00064 e3530001 cmp r3, #1
00068 1a000005 bne |$L42908|
; 82 : {
; 83 : // TeraTerm has a "peculiarity".
; 84 : if(GetPacket(buf, len, blocknum) == FALSE)
0006c e1a02004 mov r2, r4
00070 e1a01005 mov r1, r5
00074 e1a00006 mov r0, r6
00078 eb000000 bl GetPacket
0007c e3500000 cmp r0, #0
00080 1a000001 bne |$L42911|
00084 |$L42908|
; 85 : return FALSE;
; 86 : else
; 87 : return TRUE;
; 88 : }
; 89 : else
; 90 : {
; 91 : return FALSE;
00084 e3a00000 mov r0, #0
00088 ea000000 b |$L42900|
0008c |$L42911|
; 92 : }
; 93 :
; 94 : }
; 95 : return TRUE;
0008c e3a00001 mov r0, #1
00090 |$L42900|
; 96 : }
00090 e28dd004 add sp, sp, #4
00094 e8bd4070 ldmia sp!, {r4 - r6, lr}
00098 e12fff1e bx lr
0009c |$M43055|
ENDP ; |GetPacketData|
IMPORT |OEMWriteDebugByte|
00000 AREA |.text| { |GetPacket| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$GetPacket|, PDATA, SELECTION=5, ASSOC=|.text| { |GetPacket| } ; comdat associative
|$T43071| DCD |$L43070|
DCD 0x40002502
; Function compile flags: /Ogsy
00000 AREA |.text| { |GetPacket| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |GetPacket| PROC
; 99 : {
00000 |$L43070|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M43068|
00008 e1a05002 mov r5, r2
0000c e1a04001 mov r4, r1
00010 e1a06000 mov r6, r0
; 100 : char c;
; 101 :
; 102 : if(GetBytes(&c, 1) == FALSE)
00014 e3a01001 mov r1, #1
00018 e28d0000 add r0, sp, #0
0001c eb000000 bl GetBytes
00020 e3500000 cmp r0, #0
; 103 : return FALSE;
00024 0a000007 beq |$L43066|
; 104 :
; 105 : switch(c)
00028 e1dd30d0 ldrsb r3, [sp]
0002c e3530001 cmp r3, #1
00030 0a00000b beq |$L42925|
00034 e3530002 cmp r3, #2
00038 0a000007 beq |$L42927|
0003c e3530004 cmp r3, #4
00040 0a000002 beq |$L42930|
00044 e3530018 cmp r3, #0x18
00048 |$L43066|
00048 e3a00000 mov r0, #0
; 123 : case ESC: /* User-invoked abort */
; 124 : return FALSE;
0004c ea00000d b |$L42918|
00050 |$L42930|
; 116 : break;
; 117 : case CAN:
; 118 : return FALSE;
; 119 : break;
; 120 : case EOT:
; 121 : OEMWriteDebugByte(ACK);
00050 e3a00006 mov r0, #6
00054 eb000000 bl OEMWriteDebugByte
; 122 : break;
00058 ea000009 b |$L42926|
0005c |$L42927|
; 111 : break;
; 112 : case STX: /* 1024-byte incoming packet */
; 113 : *len = 1024;
0005c e3a03b01 mov r3, #1, 22
; 114 : if(GetPacketData(buf, len, blocknum) == FALSE)
; 115 : return FALSE;
00060 ea000000 b |$L43067|
00064 |$L42925|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -