Re: [PATCH 13/17] [m68k] Atari: implement 16 bit access macros for ROM port ISA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




+#define rom_out_be32(addr, l)  \
+        ({u32 __w, __v = (l);  u32 _addr = ((u32) (addr)); \
+        __w = ((*(__force volatile u32 *) ((_addr | 0x10000) + (__v<<1)))); })

This doesn't look correct to me: "__v << 1" will not fit in 32-bit, so
you loose data.
Are 32-bit writes (and reads) supported?

Reads maybe (if someone designs the hardware) - writes won't be 32 bit ever.
We can drop the 32 bit case I think. 


+#define rom_out_le16(addr, w)  \
+        ({u16 __w, __v = cpu_to_le16(w); u32 _addr = ((u32) (addr)); \
+        __w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v & 0xFF)<<1)))); \
+        __w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v >> 8)<<1)))); })

As you have to split the 16-bit data word in two bytes anyway, it's
more efficient to
hardcode the passing of the bytes than using cpu_to_le16().

OK, make sense. 

Cheers,

	Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux