#include <asm-generic/access_ok.h> /* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type. * * As the alpha uses the same address space for kernel and user * data, we can just do these as direct assignments. (Of course, the * exception handling means that it's no longer "just"...) * * Careful to not * (a) re-use the arguments for side effects (sizeof/typeof is ok) * (b) require any knowledge of processes at this stage
*/ #define put_user(x, ptr) \
__put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) #define get_user(x, ptr) \
__get_user_check((x), (ptr), sizeof(*(ptr)))
/* * The "__xxx" versions do not do address space checking, useful when * doing multiple accesses to the same area (the programmer has to do the * checks by hand with "access_ok()")
*/ #define __put_user(x, ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) #define __get_user(x, ptr) \
__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
/* * The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to * encode the bits we need for resolving the exception. See the * more extensive comments with fixup_inline_exception below for * more information.
*/ #define EXC(label,cont,res,err) \ ".section __ex_table,\"a\"\n" \ " .long "#label"-.\n" \ " lda "#res","#cont"-"#label"("#err")\n" \ ".previous\n"
/* * The "__put_user_xx()" macros tell gcc they read from memory * instead of writing: this is because they do not write to * any memory gcc knows about, so there are no aliasing issues
*/ #define __put_user_64(x, addr) \
__asm__ __volatile__("1: stq %r2,%1\n" \ "2:\n" \
EXC(1b,2b,$31,%0) \
: "=r"(__pu_err) \
: "m" (__m(addr)), "rJ" (x), "0"(__pu_err))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.