How to mark memory pages as little endian?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to mark memory pages as little endian?

ソリューションへジャンプ
1,956件の閲覧回数
pete1
Contributor I

I am working with a P3041 processor.  We have a PCI board that DMA data in little endian format. What Linux function can I call to set these pages to be accessed in little endian format?  I know the MAS2 register has a bit for this.  Does Linux have support to set this bit?

Thanks.

0 件の賞賛
返信
1 解決策
1,728件の閲覧回数
scottwood
NXP Employee
NXP Employee

Linux does not support this.  You can use byte-swapping instructions (e.g. lwbrx, stwbrx).

If this is a kernel driver, use swapping functions like cpu_to_be32() and be32_to_cpu().  If it's a powerpc-specific kernel driver, functions such as ld_le32() and st_le32() are available to use the byte-swapping instructions, but these do not appear to be supported on any other architecture.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,729件の閲覧回数
scottwood
NXP Employee
NXP Employee

Linux does not support this.  You can use byte-swapping instructions (e.g. lwbrx, stwbrx).

If this is a kernel driver, use swapping functions like cpu_to_be32() and be32_to_cpu().  If it's a powerpc-specific kernel driver, functions such as ld_le32() and st_le32() are available to use the byte-swapping instructions, but these do not appear to be supported on any other architecture.

0 件の賞賛
返信