Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference b/w __raw_readl/__raw_writel and readl/writel in linux kernel?

What's the difference b/w __raw_readl/__raw_writel and readl/writel in linux kernel? It is said readl/writel is safer than __raw_readl/__raw_writel, then why do we still use __raw_readl/__raw_writel ?

Under what circumstances should we use this: __raw_readl/__raw_writel or readl/writel ?

like image 260
Yifan Zhang Avatar asked Mar 22 '12 08:03

Yifan Zhang


1 Answers

It seems to be the case that

  • raw denotes native byte ordering, non-raw means little-endian
  • the __ prefix alternatives don't include memory barriers

See this LKML discussion and also the comments in linux/arch/arm/include/asm/io.h

like image 153
blueshift Avatar answered Oct 03 '22 07:10

blueshift