[U-Boot] fatls shows duplicated entries with long and short names

drambo drambo at broadcom.com
Sat Nov 23 00:30:36 CET 2013


I reverted my local change and the directory listing shows no duplicates
anymore which is surprising. An inspection of the generated assembly shows
more or less the same code with the exception of the early branch taken if
'dols' is 0. The 16/8 comparison is still awkward, but at this point I'm not
confident that is the real problem here. The changing result with the same
original code seems to point to perhaps a different root cause.

Here's the original assembly:
                        if (vfat_enabled) {
                                __u8 csum = mkcksum(dentptr->name,
dentptr->ext)
;
ae012560:       e1a00004        mov     r0, r4
ae012564:       e2841008        add     r1, r4, #8
ae012568:       ebfffc81        bl      ae011774 <mkcksum>
                                if (dols && csum == prevcksum) {
ae01256c:       e59dc010        ldr     ip, [sp, #16]
ae012570:       e35c0000        cmp     ip, #0
ae012574:       0a000005        beq     ae012590 <do_fat_read_at+0x718>
ae012578:       e59dc024        ldr     ip, [sp, #36]   ; 0x24
ae01257c:       e150000c        cmp     r0, ip
                                        prevcksum = 0xffff;
ae012580:       030fcfff        movweq  ip, #65535      ; 0xffff
                                        dentptr++;
ae012584:       02844020        addeq   r4, r4, #32
                                return NULL;
                        }
                        if (vfat_enabled) {
                                __u8 csum = mkcksum(dentptr->name,
dentptr->ext)
;
                                if (dols && csum == prevcksum) {
                                        prevcksum = 0xffff;
ae012588:       058dc024        streq   ip, [sp, #36]   ; 0x24
ae01258c:       0a000035        beq     ae012668 <do_fat_read_at+0x7f0>
                                        dentptr++;
                                        continue;
                                }
                        }

Here's the version without the local crc variable:
                        if (vfat_enabled) {
                                if (dols && mkcksum(dentptr->name,
dentptr->ext)
 == prevcksum) {
ae012560:       e59dc010        ldr     ip, [sp, #16]
ae012564:       e35c0000        cmp     ip, #0
ae012568:       0a000008        beq     ae012590 <do_fat_read_at+0x718>
ae01256c:       e1a00004        mov     r0, r4
ae012570:       e2841008        add     r1, r4, #8
ae012574:       ebfffc7e        bl      ae011774 <mkcksum>
ae012578:       e59dc024        ldr     ip, [sp, #36]   ; 0x24
ae01257c:       e150000c        cmp     r0, ip
                                        prevcksum = 0xffff;
ae012580:       030fcfff        movweq  ip, #65535      ; 0xffff
                                        dentptr++;
ae012584:       02844020        addeq   r4, r4, #32
                                debug("Dentname == NULL - %d\n", i);
                                return NULL;
                        }
                        if (vfat_enabled) {
                                if (dols && mkcksum(dentptr->name,
dentptr->ext)
 == prevcksum) {
                                        prevcksum = 0xffff;
ae012588:       058dc024        streq   ip, [sp, #36]   ; 0x24
ae01258c:       0a000035        beq     ae012668 <do_fat_read_at+0x7f0>
                                        dentptr++;
                                        continue;
                                }
                        }






--
View this message in context: http://u-boot.10912.n7.nabble.com/fatls-shows-duplicated-entries-with-long-and-short-names-tp165377p168237.html
Sent from the U-Boot mailing list archive at Nabble.com.


More information about the U-Boot mailing list