Re: [gta02] a few questions
On 11/14/2013 12:17 AM, matteo sanvito wrote: / // Hi ed, // I don't know about your first question, while about the second one, // try to change to after ...STAT1) // // I'm glad to see that there is someone other that still uses gta02 :') // // Best regards, // matte // / Hi Matteo, Thanks for your reply! Could you explain a bit more why to change for ? Wouldn't changing: if(!readw(host-base + GLAMO_REG_MMC_RB_STAT1) GLAMO_STAT1_MMC_IDLE) to: if(!readw(host-base + GLAMO_REG_MMC_RB_STAT1) GLAMO_STAT1_MMC_IDLE) Change the logic of the program? Yes, this would change the behavior. Specifically, is a bitwise-and operator, whereas is a short-circuit and. I haven't actually looked at the code, but its likely that readw() returns an int or a char instead of a bool, so is comparing this to a mask constant. If any of the '1' bits in the binary representation of the return from readw match the '1' bits in the mask it will return non-zero, which is equivalent to 'true' in c-based languages. In the first case the if statement would be true if either readw(host-base + GLAMO_REG_MMC_RB_STAT1) is false, or GLAMO_STAT1_MMC_IDLE is true. in the second case the if statement would be true if eadw(host-base + GLAMO_REG_MMC_RB_STAT1) is false and GLAMO_STAT1_MMC_IDLE is true. I can't tell from the source code what the intention of the program was. The reason the compiler gave you the warning is that it can't tell what the intent is either. It could either be apply bitwise-not to the value returned from readw, then bitwise-and that to the mask and go into the block if the result is non-zero or it could be bitwise-and the return from readw() and the mask, then logical-not the result of that and go into the block if the result is true. Based on the operator precedence in C, the compiler will pick the first option, we just have to hope that that is what the original developer intended. Thanks for your time! Kind regards. PS Yes, the GTA02 is still my one and only mobile phone ;-) -Andrew ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [gta02] a few questions
On 11/14/2013 12:17 AM, matteo sanvito wrote: Hi ed, I don't know about your first question, while about the second one, try to change to after ...STAT1) I'm glad to see that there is someone other that still uses gta02 :') Best regards, matte Hi Matteo, Thanks for your reply! Could you explain a bit more why to change for ? Wouldn't changing: if(!readw(host-base + GLAMO_REG_MMC_RB_STAT1) GLAMO_STAT1_MMC_IDLE) to: if(!readw(host-base + GLAMO_REG_MMC_RB_STAT1) GLAMO_STAT1_MMC_IDLE) Change the logic of the program? In the first case the if statement would be true if either readw(host-base + GLAMO_REG_MMC_RB_STAT1) is false, or GLAMO_STAT1_MMC_IDLE is true. in the second case the if statement would be true if eadw(host-base + GLAMO_REG_MMC_RB_STAT1) is false and GLAMO_STAT1_MMC_IDLE is true. I can't tell from the source code what the intention of the program was. Thanks for your time! Kind regards. PS Yes, the GTA02 is still my one and only mobile phone ;-) ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
[gta02] a few questions
Hi all, I have a few questions: -1 When i try to start Radek's buildhost i get: ./start.sh: line 2: 371 Real-time signal 0 qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-trunk-versatile -initrd initrd.img-2.6.32-trunk-versatile -append root=/dev/sda1 -hda squeeze.img -redir tcp:2::22 -m 256 So it stops with Real-time signal 0. It used to work just fine, but after some upgrades of kvm it now seems unwilling to start. Has anyone a clue on what is going on? I can start it with: strace qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-trunk-versatile -initrd initrd.img-2.6.32-trunk-versatile -append root=/dev/sda1 -hda squeeze.img -redir tcp:2::22 -m 256 but then it is even slower then usual. -2 when building a kernel on the buildhost, i get a warning: drivers/mfd/glamo/glamo-mci.c:445: warning: suggest parentheses around operand of '!' or change '' to '' or '!' to '~' Line 445 reads: /* if we can't do it, reject as busy */ if (!readw(host-base + GLAMO_REG_MMC_RB_STAT1) GLAMO_STAT1_MMC_IDLE) { host-mrq = NULL; cmd-error = -EBUSY; mmc_request_done(host-mmc, host-mrq); return -EBUSY; } Is this really just cosmetics, or is there a bug in the code? ( i still have data corruption on the SD card every now and then ) this is still the old 2.6.29-rc3-09613-g973a41f-dirty kernel Kind regards, Ed ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [gta02] a few questions
Hi ed, I don't know about your first question, while about the second one, try to change to after ...STAT1) I'm glad to see that there is someone other that still uses gta02 :') Best regards, matteo ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community