[bootlin/training-materials updates] master: slides/kernel-driver-development-io-memory: Clarify a list of functions (a2c25de0)
Miquel Raynal
miquel.raynal at bootlin.com
Thu Apr 6 14:29:51 CEST 2023
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/a2c25de01c4dbf96ad823c94c5f23a718d3b1573
>---------------------------------------------------------------
commit a2c25de01c4dbf96ad823c94c5f23a718d3b1573
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Thu Apr 6 14:27:17 2023 +0200
slides/kernel-driver-development-io-memory: Clarify a list of functions
People not so used to the command line do not understand very well
read[bwlq] and interpret that as an array. As these functions are
actually quite fundamental, let's list them all one by one, it does not
hurt, so that later uses of read[bwlq] are actually understood the right
way.
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
a2c25de01c4dbf96ad823c94c5f23a718d3b1573
.../kernel-driver-development-io-memory.tex | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex b/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
index b719887c..7beca6d4 100644
--- a/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
+++ b/slides/kernel-driver-development-io-memory/kernel-driver-development-io-memory.tex
@@ -141,9 +141,15 @@ if (IS_ERR(base))
architectures.
\item To do PCI-style, little-endian accesses (byte swapping being done
automatically assuming a little-endian device):
-\begin{minted}{c}
-unsigned read[bwlq](void *addr);
-void write[bwlq](unsigned val, void *addr);
+\begin{minted}[fontsize=\small]{c}
+u8 readb(void __iomem *addr);
+u16 readw(void __iomem *addr);
+u32 readl(void __iomem *addr);
+u64 readq(void __iomem *addr);
+void writeb(u8 val, void __iomem *addr);
+void writew(u16 val, void __iomem *addr);
+void writel(u32 val, void __iomem *addr);
+void writeq(u64 val, void __iomem *addr);
\end{minted}
\item These helpers are protected against ordering issues and will
generally do the right thing for your architecture
More information about the training-materials-updates
mailing list