Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Linus: bootloader main.c,1.17,1.18

Re: Linus: bootloader main.c,1.17,1.18

From: <dave_at_beermex.com>
Date: Tue, 12 Jul 2005 13:51:46 +0100 (BST)

Hi Ronald;

or_l is not a function call - it compiles to inline code (i.e. no
CALL/RETURN, the body is actually applied in-place)

Furthermore, or_l is actually optimised assembler (just one assembly
instruction!) whereas the C code "X |= Y" compiles to two assembly
instructions, which is slower and also not atomic

Regards,
d

> Hi,
>
>> and_l(~0x01000000, &GPIO_OUT); -> /* GPIO24 is the Cypress chip
>> power */
>> GPIO_ENABLE |= 0x01000000; -> or_l(0x01000000, &GPIO_ENABLE);
>> GPIO_FUNCTION |= 0x01000000; -> or_l(0x01000000, &GPIO_FUNCTION);
>
> Not that I'm very into the rockbox code not deep c programming, but I'm
> curious about the above code change. It seems to me that the original code
> (left) is more like standard c and probably faster (no function calls).
> Can someone enlighten me on this one?
>
> Ronald
> _______________________________________________
> http://cool.haxx.se/mailman/listinfo/rockbox
>


_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-07-12

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy