patch-2.3.25 linux/include/asm-i386/pgtable.h

Next file: linux/include/asm-i386/string.h
Previous file: linux/include/asm-i386/pgtable-3level.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.24/linux/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h
@@ -495,8 +495,12 @@
 {
 }
 
-#define SWP_TYPE(entry) (((pte_val(entry)) >> 1) & 0x3f)
-#define SWP_OFFSET(entry) ((pte_val(entry)) >> 8)
+/* Encode and de-code a swap entry */
+#define SWP_TYPE(x)			(((x).val >> 1) & 0x3f)
+#define SWP_OFFSET(x)			((x).val >> 8)
+#define SWP_ENTRY(type, offset)		((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+#define pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) })
+#define swp_entry_to_pte(x)		((pte_t) { (x).val })
 
 #define module_map      vmalloc
 #define module_unmap    vfree

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)