On Mon, May 11, 2020 at 09:21:21AM +0200, Ahmad Fatoum wrote: > These U-Boot style bitwise operations macros will be needed for > COMPILE_TEST-compiled drivers on platforms except for ARM. Add fallback > definitions there, based on the ARM ones. > > Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> > --- > include/asm-generic/io.h | 138 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 138 insertions(+) > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index 76e6d0dc1112..84bf0064d8b8 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -424,4 +424,142 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr) > #define IOMEM(addr) ((void __force __iomem *)(addr)) > #endif > > +/* > + * Clear and set bits in one shot. These macros can be used to clear and > + * set multiple bits in a register using a single call. These macros can > + * also be used to set a multiple-bit bit pattern using a mask, by > + * specifying the mask in the 'clear' parameter and the new bit pattern > + * in the 'set' parameter. > + */ > + > +#ifndef out_arch > +#define out_arch(type,endian,a,v) __raw_write##type(cpu_to_##endian(v),a) > +#endif Better add these to a separate file in case we want to sync io.h with Linux? Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox