Selaa lähdekoodia

introduce lower_32_bits() macro

The file kernel.h contains the upper_32_bits macro.  This patch adds the
other part, the lower_32_bits macro.  Its first use will be in the driver
for AMD IOMMU.

Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joerg Roedel 17 vuotta sitten
vanhempi
commit
204b885e73
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      include/linux/kernel.h

+ 6 - 0
include/linux/kernel.h

@@ -75,6 +75,12 @@ extern const char linux_proc_banner[];
  */
  */
 #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
 #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
 
 
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
 #define	KERN_EMERG	"<0>"	/* system is unusable			*/
 #define	KERN_EMERG	"<0>"	/* system is unusable			*/
 #define	KERN_ALERT	"<1>"	/* action must be taken immediately	*/
 #define	KERN_ALERT	"<1>"	/* action must be taken immediately	*/
 #define	KERN_CRIT	"<2>"	/* critical conditions			*/
 #define	KERN_CRIT	"<2>"	/* critical conditions			*/