
7 Dec
2006
7 Dec
'06
6:33 p.m.
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