What's the difference b/w __raw_readl/__raw_writel and readl/writel in linux kernel?
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
Explanation of function used in embeded systems
I am not entirely sure what implementation or where you are using it. But judging from this, it is use to write data into I/O memory and as it is also mention at What's the difference b/w __raw_readl/__raw_writel and readl/writel in linux kernel?,
- raw denotes native byte ordering, non-raw means little-endian
- the __prefix alternatives don't include memory barriers
Also, you should try to look at http://lxr.free-electrons.com/source/arch/microblaze/include/asm/io.h#L66 to figure out more details and arguments for the function.
force a bit field read to 32 bits
As an example, the Linux kernel has inline functions that explicitly handle memory-mapped IO reads and writes. In newer kernels it's a big macro wrapper that boils down to an inline assembly movl
instruction, but it older kernels it was defined like this:
#define readl(addr) (*(volatile unsigned int *) (addr))
#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
Related Topics
Udev - Run Program on Usb Flash Drive Insert
How to Calculate the Total Size of Certain Files Only, Recursive, in Linux
Interrupting Epoll_Wait with a Non-Io Event, No Signals
How to Know Whether a Copy-On-Write Page Is an Actual Copy
How to Open a File in Assembler and Modify It
Packet Sniffing Using Raw Sockets in Linux in C
How to Replace Single Quotes with Another Character in Sed
What Is Kernel Section Mismatch
Error: Ld.So: Object 'Libgtk3-Nocsd.So.0' from Ld_Preload Cannot Be Preloaded
Shell Script Change Directory with Variable
Run Docker in Ubuntu Live Disk
How to "Git Pull" - Host Key Verification Failed
Install.Packages("Devtools") on R 3.0.2 Fails in Ubuntu 14.04
Change System Date Time in Docker Containers Without Impacting Host
Difference Between Real User Id, Effective User Id and Saved User Id