Changeset 5144
- Timestamp:
- Feb 22, 2010 1:58:01 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/arch/i386/lib/walkcbfs.S (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/arch/i386/lib/walkcbfs.S
r4994 r5144 29 29 */ 30 30 walkcbfs: 31 cld 32 31 33 mov CBFS_HEADER_PTR, %eax 32 34 mov CBFS_HEADER_ROMSIZE(%eax), %ecx … … 48 50 add $1, %eax 49 51 walker: 52 mov 0(%ebx), %edi 53 cmp %edi, filemagic 54 jne searchfile 55 mov 4(%ebx), %edi 56 cmp %edi, filemagic+4 57 jne searchfile 58 50 59 mov %ebx, %edi 51 60 add $CBFS_FILE_STRUCTSIZE, %edi /* edi = address of first byte after struct cbfs_file */ … … 64 73 65 74 tryharder: 66 sub %ebx, %edi /* edi = # of walked bytes */ 75 sub %ebx, %edi 76 sub $CBFS_FILE_STRUCTSIZE, %edi /* edi = # of walked bytes */ 67 77 sub %edi, %esi /* esi = start of filename */ 68 78 … … 74 84 bswap %edi 75 85 add %edi, %ecx 76 mov CBFS_HEADER_PTR, %ebx 77 mov CBFS_HEADER_ALIGN(%ebx), %ebx 78 bswap %ebx 79 sub $1, %ebx 80 add %ebx, %ecx 81 mov %ebx, %edi 86 mov CBFS_HEADER_PTR, %edi 87 mov CBFS_HEADER_ALIGN(%edi), %edi 88 bswap %edi 89 sub $1, %edi 90 add %edi, %ecx 82 91 not %edi 83 92 and %edi, %ecx 93 94 /* if oldaddr >= addr, leave */ 95 cmp %ebx, %ecx 96 jbe out 97 84 98 mov %ecx, %ebx 85 99 86 /* look if we should exit */ 100 check_for_exit: 101 /* look if we should exit: did we pass into the bootblock already? */ 87 102 mov CBFS_HEADER_PTR, %ecx 88 mov CBFS_HEADER_ ROMSIZE(%ecx), %ecx103 mov CBFS_HEADER_BOOTBLOCKSIZE(%ecx), %ecx 89 104 bswap %ecx 90 105 not %ecx 91 106 add $1, %ecx 92 107 93 cmp %e bx, %ecx94 /* if we're still inside the ROM area, jump back */108 cmp %ecx, %ebx 109 /* if bootblockstart >= addr (==we're still in the data area) , jump back */ 95 110 jbe walker 96 111 112 out: 97 113 mov $0, %eax 98 114 jmp *%esp 115 116 117 searchfile: 118 /* if filemagic isn't found, move forward cbfs_header->align bytes */ 119 mov CBFS_HEADER_PTR, %edi 120 mov CBFS_HEADER_ALIGN(%edi), %edi 121 bswap %edi 122 add %edi, %ebx 123 jmp check_for_exit 124 125 filemagic: 126 .ascii "LARCHIVE"
Note: See TracChangeset
for help on using the changeset viewer.
