[PATCH] Small kernel-api addition

John Levon (moz@compsoc.man.ac.uk)
Thu, 10 May 2001 18:29:18 +0100 (BST)


Clean against 2.4.4-ac6 and 2.4.4

thanks
john

--- Documentation/DocBook/kernel-api.tmpl.old Thu May 10 18:02:05 2001
+++ Documentation/DocBook/kernel-api.tmpl Thu May 10 18:02:57 2001
@@ -41,8 +41,9 @@
!Iinclude/linux/init.h
</sect1>

- <sect1><title>Atomics</title>
+ <sect1><title>Atomic and pointer manipulation</title>
!Iinclude/asm-i386/atomic.h
+!Iinclude/asm-i386/unaligned.h
</sect1>

<sect1><title>Delaying, scheduling, and timer routines</title>
--- include/asm-i386/unaligned.h.old Thu May 10 17:54:28 2001
+++ include/asm-i386/unaligned.h Thu May 10 18:29:11 2001
@@ -9,8 +9,29 @@
* architectures where unaligned accesses aren't as simple.
*/

+/**
+ * get_unaligned - get value from possibly mis-aligned location
+ * @ptr: pointer to value
+ *
+ * This macro should be used for accessing values larger in size than single
+ * bytes at locations that may be improperly aligned, e.g. retrieving a u16
+ * value from a location not u16-aligned.
+ *
+ * Note that unaligned accesses can be very expensive on some architectures.
+ */
#define get_unaligned(ptr) (*(ptr))

+/**
+ * put_unaligned - put value to a possibly mis-aligned location
+ * @val: value to place
+ * @ptr: pointer to location
+ *
+ * This macro should be used for placing values larger in size than single
+ * bytes at locations that may be improperly aligned, e.g. write a u16
+ * value to a location not u16-aligned.
+ *
+ * Note that unaligned accesses can be very expensive on some architectures.
+ */
#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))

#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/