On Fri, 20 May 2011, Dave Martin wrote: > On Fri, May 20, 2011 at 01:39:37PM +0100, Frank Hofmann wrote: > > I've simply done there what the "setmode" macro from > > <asm/assembler.h> is doing, have chosen not to include that file > > because it overrides "push" on a global scale for no good reason and > > that sort of thing makes me cringe. > > Actually, I guess you should be using that header, from a general > standardisation point of view. In particular, it would be nicer to > use setmode than to copy it. Absolutely. If there are issues with the generic infrastructure provided to you, by all means let's find a way to fix them instead of locally sidestepping them. > The setmode macro itself could be improved to use cps for Thumb-2, > but that would be a separate (and low-priority) patch. > > Re the push/pop macros, I'm not sure of the history for those. I'm responsible for those, from many years ago (November 2005 according to Git) when push didn't even exist as an official ARM mnemonic. BTW the converse macro is pull not pop. Those are used to write endian independent assembly string copy routines. > In the kernel, it seems customary to write stmfd sp!, / ldmfd sp!, > instead of push / pop, so you could always use those mnemonics instead. > They're equivalent. Yes, and more importantly they're backward compatible with older binutils version with no knowledge of the latest "unified" syntax. We preferably don't want to break compilation with those older tools, which is why we stick to ldmfd/stmfd. > > >>+ stm r0!, {r4-r12,lr} /* nonvolatile regs */ This asks to be written as "stmia r0!, ..." as well for the same reasons. Nicolas _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm