📄 intel_28f160.cod
字号:
DCB 0x0, "r", 0x0, "g", 0x0, "e", 0x0, " ", 0x0, "t", 0x0, "h"
DCB 0x0, "a", 0x0, "n", 0x0, " ", 0x0, "t", 0x0, "h", 0x0, "e"
DCB 0x0, " ", 0x0, "m", 0x0, "a", 0x0, "x", 0x0, " ", 0x0, "s"
DCB 0x0, "e", 0x0, "c", 0x0, "t", 0x0, "o", 0x0, "r", 0x0, " "
DCB 0x0, "n", 0x0, "u", 0x0, "m", 0x0, ":", 0x0, "0", 0x0, "x"
DCB 0x0, "%", 0x0, "X", 0x0, "!", 0x0, 0xd, 0x0, 0xa, 0x0, 0x0
DCB 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |?Intel_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?Intel_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z| PROC ; Intel_Nor_FMD_WriteSector
; 374 : {
00000 |$L30350|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 e24ddf83 sub sp, sp, #0x83, 30
00008 |$M30348|
00008 e3530000 cmp r3, #0
0000c e1a05002 mov r5, r2
00010 e1a06001 mov r6, r1
00014 e1a04000 mov r4, r0
00018 e59f0194 ldr r0, [pc, #0x194]
0001c e5900000 ldr r0, [r0]
00020 e58d0208 str r0, [sp, #0x208]
; 375 : volatile SECTOR_ADDR physicalSectorAddr = 0;
00024 e3a02000 mov r2, #0
00028 e58d2000 str r2, [sp]
; 376 : BLOCK_ID blockID = 0;
; 377 : DWORD i = 0;
; 378 : DWORD j = 0;
; 379 : DWORD k = 0;
; 380 : volatile DWORD ulBlockAddress = 0;
0002c e58d2000 str r2, [sp]
; 381 : LPBYTE pBuffer = pSectorBuff;
; 382 : BOOL fRet = FALSE;
; 383 :
; 384 : BYTE bsTmpBuf[SECTOR_SIZE];
; 385 :
; 386 : //----- 1. Check the input parameters -----
; 387 : // NOTE: The FAL insures that the starting sector address is in the allowable range.
; 388 : if((dwNumSectors == 0) || ((pSectorBuff == NULL) && (pSectorInfoBuff == NULL)))
00030 0a00000d beq |$L29860|
00034 e3560000 cmp r6, #0
00038 1a000001 bne |$L29859|
0003c e3550000 cmp r5, #0
00040 0a000009 beq |$L29860|
00044 |$L29859|
; 389 : {
; 390 : return(FALSE);
; 391 : }
; 392 : if( (g_FlashInfo.dwBlkNum*g_FlashInfo.wSectorsPerBlock)<(startSectorAddr+dwNumSectors))
00044 e59f7164 ldr r7, [pc, #0x164]
00048 e0848003 add r8, r4, r3
0004c e597000c ldr r0, [r7, #0xC]
00050 e1d731b6 ldrh r3, [r7, #0x16]
00054 e0020093 mul r2, r3, r0
00058 e1520008 cmp r2, r8
0005c 2a000008 bcs |$L29861|
; 393 : {
; 394 : RETAILMSG(1, (TEXT("ERROR:The write sector num:0x%X is large than the max sector num:0x%X!\r\n"),startSectorAddr+dwNumSectors,g_FlashInfo.dwBlkNum*g_FlashInfo.wSectorsPerBlock));
00060 e59f0144 ldr r0, [pc, #0x144]
00064 e1a01008 mov r1, r8
00068 eb000000 bl NKDbgPrintfW
0006c |$L29860|
0006c e59d0208 ldr r0, [sp, #0x208]
00070 eb000000 bl __security_check_cookie
00074 e3a00000 mov r0, #0
00078 |$L29849|
; 455 : }
00078 e28ddf83 add sp, sp, #0x83, 30
0007c e8bd4ff0 ldmia sp!, {r4 - r11, lr}
00080 e12fff1e bx lr
00084 |$L29861|
; 395 : return FALSE;
; 396 : }
; 397 :
; 398 : //----- 2. Process the write request(s)... -----
; 399 : for(i = startSectorAddr; i < (startSectorAddr + dwNumSectors); i++)
00084 e1540008 cmp r4, r8
00088 2a000042 bcs |$L29865|
0008c e0843304 add r3, r4, r4, lsl #6
00090 e1a09183 mov r9, r3, lsl #3
00094 e3a0a001 mov r10, #1
00098 e3a0b001 mov r11, #1
0009c |$L29863|
0009c e597301c ldr r3, [r7, #0x1C]
; 400 : {
; 401 : //----- Determine the block this physical sector resides in -----
; 402 : blockID = (i/g_FlashInfo.wSectorsPerBlock);
; 403 :
; 404 : //----- Compute the physical address for the requested sector -----
; 405 : // Note we do this differently based on whether the caller wants us to write the sector information structure as well. Since we're
; 406 : // dealing with a NOR flash which is XIP-able, one might want to use this function to write an XIP region (i.e., no sector information
; 407 : // structures in flash).
; 408 : if (!s_bXIPMode)
000a0 e3530000 cmp r3, #0
000a4 1a000005 bne |$L29866|
000a8 e1d701b6 ldrh r0, [r7, #0x16]
000ac e1a01004 mov r1, r4
000b0 eb000000 bl __rt_udiv
000b4 e1d731b4 ldrh r3, [r7, #0x14]
; 409 : physicalSectorAddr = i*(SECTOR_SIZE + sizeof(SectorInfo)) + (blockID * g_FlashInfo.wUnusedBytesPerBlock);
000b8 e0239390 mla r3, r0, r3, r9
; 410 : else
000bc ea000000 b |$L30347|
000c0 |$L29866|
; 395 : return FALSE;
; 396 : }
; 397 :
; 398 : //----- 2. Process the write request(s)... -----
; 399 : for(i = startSectorAddr; i < (startSectorAddr + dwNumSectors); i++)
000c0 e1a03484 mov r3, r4, lsl #9
000c4 |$L30347|
; 411 : physicalSectorAddr = i*SECTOR_SIZE;
000c4 e58d3000 str r3, [sp]
; 412 :
; 413 :
; 414 : //----- Write the necessary sector data -----
; 415 : if(pSectorBuff)
000c8 e3560000 cmp r6, #0
000cc 0a000013 beq |$L29869|
; 416 : {
; 417 : pBuffer=pSectorBuff;
; 418 : if ((DWORD)pBuffer & ((1<<(g_FlashInfo.bBusWidth-1))- 1))
000d0 e5d73004 ldrb r3, [r7, #4]
000d4 e1a01006 mov r1, r6
000d8 e2433001 sub r3, r3, #1
000dc e1a0331a mov r3, r10, lsl r3
000e0 e2433001 sub r3, r3, #1
000e4 e1130006 tst r3, r6
000e8 0a000006 beq |$L29871|
; 419 : {
; 420 : //the buffer pointer must be dword aligned
; 421 : RETAILMSG(1, (TEXT("Nor_FMD_WriteSector: Unaligned pointer - using internal buffer\r\n")));
000ec e59f00b4 ldr r0, [pc, #0xB4]
000f0 eb000000 bl NKDbgPrintfW
; 422 : memcpy(bsTmpBuf, pBuffer, SECTOR_SIZE);
000f4 e28d0008 add r0, sp, #8
000f8 e3a02c02 mov r2, #2, 24
000fc e1a01006 mov r1, r6
00100 eb000000 bl memcpy
; 423 : pBuffer = bsTmpBuf;
00104 e28d1008 add r1, sp, #8
00108 |$L29871|
; 424 : }
; 425 :
; 426 : if(!WriteFlashEx( physicalSectorAddr, pBuffer, SECTOR_SIZE))
00108 e59d0000 ldr r0, [sp]
0010c e3a02c02 mov r2, #2, 24
00110 eb000000 bl |?WriteFlashEx@@YAHKPAEK@Z|
00114 e3500000 cmp r0, #0
00118 0affffd3 beq |$L29860|
; 427 : {
; 428 : return FALSE;
; 429 : }
; 430 : pSectorBuff += SECTOR_SIZE;
0011c e2866c02 add r6, r6, #2, 24
00120 |$L29869|
; 395 : return FALSE;
; 396 : }
; 397 :
; 398 : //----- 2. Process the write request(s)... -----
; 399 : for(i = startSectorAddr; i < (startSectorAddr + dwNumSectors); i++)
00120 e597301c ldr r3, [r7, #0x1C]
; 431 : }
; 432 :
; 433 : //----- Write the necessary sector info data (metadata) -----
; 434 : // NOTE: Notice that the 6 metadata bytes are just stored after the sector data...
; 435 : if(!s_bXIPMode && pSectorInfoBuff)
00124 e3530000 cmp r3, #0
00128 1a000016 bne |$L29864|
0012c e3550000 cmp r5, #0
00130 0a000014 beq |$L29864|
; 436 : {
; 437 : pBuffer=(BYTE*) pSectorInfoBuff;
; 438 : if ((DWORD)pBuffer & ((1<<(g_FlashInfo.bBusWidth-1))- 1))
00134 e5d73004 ldrb r3, [r7, #4]
00138 e1a01005 mov r1, r5
0013c e2433001 sub r3, r3, #1
00140 e1a0331b mov r3, r11, lsl r3
00144 e2433001 sub r3, r3, #1
00148 e1130005 tst r3, r5
0014c 0a000006 beq |$L29877|
; 439 : {
; 440 : //the buffer pointer must be dword aligned
; 441 : RETAILMSG(1, (TEXT("Nor_FMD_WriteSector: Unaligned pointer - using internal buffer\r\n")));
00150 e59f0050 ldr r0, [pc, #0x50]
00154 eb000000 bl NKDbgPrintfW
; 442 : memcpy(bsTmpBuf, pBuffer, sizeof(SectorInfo));
00158 e28d0008 add r0, sp, #8
0015c e3a02008 mov r2, #8
00160 e1a01005 mov r1, r5
00164 eb000000 bl memcpy
; 443 : pBuffer = bsTmpBuf;
00168 e28d1008 add r1, sp, #8
0016c |$L29877|
; 444 : }
; 445 :
; 446 : if (!WriteFlashEx( physicalSectorAddr+SECTOR_SIZE, (PUCHAR)pBuffer, sizeof(SectorInfo)))
0016c e59d3000 ldr r3, [sp]
00170 e3a02008 mov r2, #8
00174 e2830c02 add r0, r3, #2, 24
00178 eb000000 bl |?WriteFlashEx@@YAHKPAEK@Z|
0017c e3500000 cmp r0, #0
00180 0affffb9 beq |$L29860|
; 447 : {
; 448 : return FALSE;
; 449 : }
; 450 : pSectorInfoBuff += sizeof(SectorInfo);
00184 e2855040 add r5, r5, #0x40
00188 |$L29864|
; 395 : return FALSE;
; 396 : }
; 397 :
; 398 : //----- 2. Process the write request(s)... -----
; 399 : for(i = startSectorAddr; i < (startSectorAddr + dwNumSectors); i++)
00188 e2844001 add r4, r4, #1
0018c e1540008 cmp r4, r8
00190 e2899f82 add r9, r9, #0x82, 30
00194 3affffc0 bcc |$L29863|
00198 |$L29865|
; 451 : }
; 452 : }
; 453 :
; 454 : return TRUE;;
00198 e59d0208 ldr r0, [sp, #0x208]
0019c eb000000 bl __security_check_cookie
001a0 e3a00001 mov r0, #1
001a4 eaffffb3 b |$L29849|
001a8 |$L30353|
001a8 00000000 DCD |??_C@_1IC@OLJPHDMC@?$AAN?$AAo?$AAr?$AA_?$AAF?$AAM?$AAD?$AA_?$AAW?$AAr?$AAi?$AAt?$AAe?$AAS?$AAe?$AAc?$AAt?$AAo?$AAr?$AA?3@|
001ac 00000000 DCD |??_C@_1JC@BBAGBKBP@?$AAE?$AAR?$AAR?$AAO?$AAR?$AA?3?$AAT?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAs?$AAe?$AAc?$AAt@|
001b0 00000000 DCD |g_FlashInfo|
001b4 00000000 DCD |__security_cookie|
001b8 |$M30349|
ENDP ; |?Intel_Nor_FMD_WriteSector@@YAHKPAEPAU_SectorInfo@@K@Z|, Intel_Nor_FMD_WriteSector
EXPORT |?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z| ; Intel_Nor_FMD_GetBlockStatus
IMPORT |Nor_FMD_ReadSector|
00000 AREA |.text| { |?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z| } ; comdat associative
|$T30364| DCD |$L30363|
DCD 0x40001702
; Function compile flags: /Ogsy
00000 AREA |.text| { |?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?Intel_Nor_FMD_GetBlockStatus@@YAKK@Z| PROC ; Intel_Nor_FMD_GetBlockStatus
; 466 : {
00000 |$L30363|
00000 e92d4010 stmdb sp!, {r4, lr}
00004 e24dd008 sub sp, sp, #8
00008 |$M30361|
; 467 : SECTOR_ADDR Sector = blockID * g_FlashInfo.wSectorsPerBlock;
00008 e59f1048 ldr r1, [pc, #0x48]
; 468 : SectorInfo SI;
; 469 : DWORD dwResult = 0;
; 470 :
; 471 : if (!Nor_FMD_ReadSector(Sector, NULL, &SI, 1))
0000c e3a03001 mov r3, #1
00010 e28d2000 add r2, sp, #0
00014 e1d1e1b6 ldrh lr, [r1, #0x16]
00018 e3a01000 mov r1, #0
0001c e3a04000 mov r4, #0
00020 e000009e mul r0, lr, r0
00024 eb000000 bl Nor_FMD_ReadSector
00028 e3500000 cmp r0, #0
; 472 : return BLOCK_STATUS_UNKNOWN;
0002c 03a04001 moveq r4, #1
00030 0a000004 beq |$L29891|
; 473 :
; 474 : if (!(SI.bOEMReserved & OEM_BLOCK_READONLY))
00034 e5dd3004 ldrb r3, [sp, #4]
00038 e3130002 tst r3, #2
; 475 : dwResult |= BLOCK_STATUS_READONLY;
0003c 03a04004 moveq r4, #4
; 476 :
; 477 : if (!(SI.bOEMReserved & OEM_BLOCK_RESERVED))
00040 e3130001 tst r3, #1
; 478 : dwResult |= BLOCK_STATUS_RESERVED;
00044 03844008 orreq r4, r4, #8
00048 |$L29891|
; 472 : return BLOCK_STATUS_UNKNOWN;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -