1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>cpu_to_be32()/be32_to_cpu()/cpu_to_le32()/le32_to_cpu() include/asm/byteorder.h</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Unreliable Guide To Hacking The Linux Kernel"><link rel="up" href="common-routines.html" title="Chapter&#160;6.&#160;Common Routines"><link rel="prev" href="routines-udelay.html" title="mdelay()/udelay() include/asm/delay.h include/linux/delay.h"><link rel="next" href="routines-local-irqs.html" title="local_irq_save()/local_irq_restore() include/linux/irqflags.h"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><code class="function">cpu_to_be32()</code>/<code class="function">be32_to_cpu()</code>/<code class="function">cpu_to_le32()</code>/<code class="function">le32_to_cpu()</code>
2     <code class="filename">include/asm/byteorder.h</code>
3   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="routines-udelay.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;6.&#160;Common Routines</th><td width="20%" align="right">&#160;<a accesskey="n" href="routines-local-irqs.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="routines-endian"></a><code class="function">cpu_to_be32()</code>/<code class="function">be32_to_cpu()</code>/<code class="function">cpu_to_le32()</code>/<code class="function">le32_to_cpu()</code>
4     <code class="filename">include/asm/byteorder.h</code>
5   </h2></div></div></div><p>
6    The <code class="function">cpu_to_be32()</code> family (where the "32" can
7    be replaced by 64 or 16, and the "be" can be replaced by "le") are
8    the general way to do endian conversions in the kernel: they
9    return the converted value.  All variations supply the reverse as
10    well: <code class="function">be32_to_cpu()</code>, etc.
11   </p><p>
12    There are two major variations of these functions: the pointer
13    variation, such as <code class="function">cpu_to_be32p()</code>, which take
14    a pointer to the given type, and return the converted value.  The
15    other variation is the "in-situ" family, such as
16    <code class="function">cpu_to_be32s()</code>, which convert value referred
17    to by the pointer, and return void.
18   </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="routines-udelay.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="common-routines.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="routines-local-irqs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><code class="function">mdelay()</code>/<code class="function">udelay()</code>
19     <code class="filename">include/asm/delay.h</code>
20     <code class="filename">include/linux/delay.h</code>
21   &#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<code class="function">local_irq_save()</code>/<code class="function">local_irq_restore()</code>
22    <code class="filename">include/linux/irqflags.h</code>
23   </td></tr></table></div></body></html>
24