[PATCH 6/6] ARM: support kernel modules in BE8 mode

Nicolas Pitre nico at fluxnic.net
Mon Nov 21 23:17:01 EST 2011


On Tue, 22 Nov 2011, Bi Junxiao wrote:

> on 11/22/2011 03:29 AM Nicolas Pitre wrote:
> > On Tue, 15 Nov 2011, Junxiao Bi wrote:
> > 
> >    
> > > From: Stanley.Miao<stanley.miao at windriver.com>
> > > 
> > > In BE8 mode, data must be manipulated in big endian format while
> > > text must be little endian. Therefore, when relocating the text
> > > section of module in BE8 mode, we must convert the location offset
> > > of the text to big endian from the native little endian. After
> > > the relocation is complete, the location offset value is re-written
> > > as little endian.
> > > 
> > > Since only BE8 mode has such special requirement while other big endian
> > > mode not, cpu_to_le32 and le32_to_cpu can not be used to relocate the
> > > text. We introduce write_instr* and read_instr* to do it.
[...]
> > If only module.c requires this, please move those definitions there.
> >    
> Not only modules, all components that needs to read and write text segment
> like kprobes also needs this. As it is special to arm be8, how about define it
> in arch/arm/include/asm/swab.h?

There is a patch series proposed by Leif Lindholm adding generic ARM 
instruction condition code check that creates an opcode.h file.  That 
would be an ideal location for opcode accessor definitions.


Nicolas



More information about the linux-arm-kernel mailing list