[U-Boot-Users] possible ELDK4 gcc compiler bug

Pantelis Antoniou pantelis.antoniou at gmail.com
Thu Dec 7 18:33:31 CET 2006


On 07 Δεκ 2006, at 12:25 ΜΜ, Timur Tabi wrote:

> Matthias Fuchs wrote:
>
>> Do so with accessors result in code like this (still missing some  
>> casts):
>> out32(&(fpga->fifo[i].ctrl), in32(&(fpga->fifo[i].ctrl)) | 0x8000);
>> Is this really recommended?
>
> That's how I would do it.  You could use a temporary variable:
>
> u32 ctrl;
>
> ctrl = in32(&(fpga->fifo[i].ctrl));
> out32(&(fpga->fifo[i].ctrl), ctrl | 0x8000);
>
> -- 
> Timur Tabi
> Linux Kernel Developer @ Freescale

#define FPGA_SETBITS(f, m, v) \
	out32(&(f)->m, in32(&(f)->m | (v))


FPGA_SET_BITS(fifo[i].ctrl, 0x8000)

Knock yourself out.

Pantelis






More information about the U-Boot mailing list