€•~Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ0/translations/zh_CN/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/pt_BR/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/arch/arm/kernel_user_helpers”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒKernel-provided User Helpers”h]”hŒKernel-provided User Helpers”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒJ/var/lib/git/docbuild/linux/Documentation/arch/arm/kernel_user_helpers.rst”h´KubhŒ paragraph”“”)�”}”(hXóThese are segment of kernel provided user code reachable from user space at a fixed address in kernel memory. This is used to provide user space with some operations which require kernel help because of unimplemented native feature and/or instructions in many ARM CPUs. The idea is for this code to be executed directly in user mode for best efficiency but which is too intimate with the kernel counter part to be left to user libraries. In fact this code might even differ from one CPU to another depending on the available instruction set, or whether it is a SMP systems. In other words, the kernel reserves the right to change this code as needed without warning. Only the entry points and their results as documented here are guaranteed to be stable.”h]”hXóThese are segment of kernel provided user code reachable from user space at a fixed address in kernel memory. This is used to provide user space with some operations which require kernel help because of unimplemented native feature and/or instructions in many ARM CPUs. The idea is for this code to be executed directly in user mode for best efficiency but which is too intimate with the kernel counter part to be left to user libraries. In fact this code might even differ from one CPU to another depending on the available instruction set, or whether it is a SMP systems. In other words, the kernel reserves the right to change this code as needed without warning. Only the entry points and their results as documented here are guaranteed to be stable.”…”�”}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hX‰This is different from (but doesn't preclude) a full blown VDSO implementation, however a VDSO would prevent some assembly tricks with constants that allows for efficient branching to those code segments. And since those code segments only use a few cycles before returning to user code, the overhead of a VDSO indirect far call would add a measurable overhead to such minimalistic operations.”h]”hX‹This is different from (but doesn’t preclude) a full blown VDSO implementation, however a VDSO would prevent some assembly tricks with constants that allows for efficient branching to those code segments. And since those code segments only use a few cycles before returning to user code, the overhead of a VDSO indirect far call would add a measurable overhead to such minimalistic operations.”…”�”}”(hhÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hXnUser space is expected to bypass those helpers and implement those things inline (either in the code emitted directly by the compiler, or part of the implementation of a library call) when optimizing for a recent enough processor that has the necessary native support, but only if resulting binaries are already to be incompatible with earlier ARM processors due to usage of similar native instructions for other things. In other words don't make binaries unable to run on earlier processors just for the sake of not using these kernel helpers if your compiled code is not going to use new instructions for other purpose.”h]”hXpUser space is expected to bypass those helpers and implement those things inline (either in the code emitted directly by the compiler, or part of the implementation of a library call) when optimizing for a recent enough processor that has the necessary native support, but only if resulting binaries are already to be incompatible with earlier ARM processors due to usage of similar native instructions for other things. In other words don’t make binaries unable to run on earlier processors just for the sake of not using these kernel helpers if your compiled code is not going to use new instructions for other purpose.”…”�”}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hXÄNew helpers may be added over time, so an older kernel may be missing some helpers present in a newer kernel. For this reason, programs must check the value of __kuser_helper_version (see below) before assuming that it is safe to call any particular helper. This check should ideally be performed only once at process startup time, and execution aborted early if the required helpers are not provided by the kernel version that process is running on.”h]”hXÄNew helpers may be added over time, so an older kernel may be missing some helpers present in a newer kernel. For this reason, programs must check the value of __kuser_helper_version (see below) before assuming that it is safe to call any particular helper. This check should ideally be performed only once at process startup time, and execution aborted early if the required helpers are not provided by the kernel version that process is running on.”…”�”}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K"hh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒkuser_helper_version”h]”hŒkuser_helper_version”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K+ubhÌ)�”}”(hŒLocation: 0xffff0ffc”h]”hŒLocation: 0xffff0ffc”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K-hjh²hubhÌ)�”}”(hŒReference declaration::”h]”hŒReference declaration:”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K/hjh²hubhŒ literal_block”“”)�”}”(hŒ&extern int32_t __kuser_helper_version;”h]”hŒ&extern int32_t __kuser_helper_version;”…”�”}”hj4sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j2h³hÊh´K1hjh²hubhÌ)�”}”(hŒ Definition:”h]”hŒ Definition:”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K3hjh²hubhŒ block_quote”“”)�”}”(hŒ£This field contains the number of helpers being implemented by the running kernel. User space may read this to determine the availability of a particular helper. ”h]”hÌ)�”}”(hŒ¢This field contains the number of helpers being implemented by the running kernel. User space may read this to determine the availability of a particular helper.”h]”hŒ¢This field contains the number of helpers being implemented by the running kernel. User space may read this to determine the availability of a particular helper.”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K5hjh²hubhÌ)�”}”(hŒUsage example::”h]”hŒUsage example:”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hjh²hubj3)�”}”(hŒñ#define __kuser_helper_version (*(int32_t *)0xffff0ffc) void check_kuser_version(void) { if (__kuser_helper_version < 2) { fprintf(stderr, "can't do atomic operations, kernel too old\n"); abort(); } }”h]”hŒñ#define __kuser_helper_version (*(int32_t *)0xffff0ffc) void check_kuser_version(void) { if (__kuser_helper_version < 2) { fprintf(stderr, "can't do atomic operations, kernel too old\n"); abort(); } }”…”�”}”hjzsbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´K;hjh²hubhÌ)�”}”(hŒNotes:”h]”hŒNotes:”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KEhjh²hubjS)�”}”(hŒßUser space may assume that the value of this field never changes during the lifetime of any single process. This means that this field can be read once during the initialisation of a library or startup phase of a program. ”h]”hÌ)�”}”(hŒÞUser space may assume that the value of this field never changes during the lifetime of any single process. This means that this field can be read once during the initialisation of a library or startup phase of a program.”h]”hŒÞUser space may assume that the value of this field never changes during the lifetime of any single process. This means that this field can be read once during the initialisation of a library or startup phase of a program.”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KGhj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´KGhjh²hubeh}”(h]”Œkuser-helper-version”ah ]”h"]”Œkuser_helper_version”ah$]”h&]”uh1hµhh·h²hh³hÊh´K+ubh¶)�”}”(hhh]”(h»)�”}”(hŒ kuser_get_tls”h]”hŒ kuser_get_tls”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¶h²hh³hÊh´KMubhÌ)�”}”(hŒLocation: 0xffff0fe0”h]”hŒLocation: 0xffff0fe0”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KOhj¶h²hubhÌ)�”}”(hŒReference prototype::”h]”hŒReference prototype:”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KQhj¶h²hubj3)�”}”(hŒvoid * __kuser_get_tls(void);”h]”hŒvoid * __kuser_get_tls(void);”…”�”}”hjãsbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´KShj¶h²hubhÌ)�”}”(hŒInput:”h]”hŒInput:”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KUhj¶h²hubjS)�”}”(hŒlr = return address ”h]”hÌ)�”}”(hŒlr = return address”h]”hŒlr = return address”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KWhjÿubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´KWhj¶h²hubhÌ)�”}”(hŒOutput:”h]”hŒOutput:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KYhj¶h²hubjS)�”}”(hŒr0 = TLS value ”h]”hÌ)�”}”(hŒr0 = TLS value”h]”hŒr0 = TLS value”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K[hj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K[hj¶h²hubhÌ)�”}”(hŒClobbered registers:”h]”hŒClobbered registers:”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K]hj¶h²hubjS)�”}”(hŒnone ”h]”hÌ)�”}”(hŒnone”h]”hŒnone”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K_hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K_hj¶h²hubhÌ)�”}”(hŒ Definition:”h]”hŒ Definition:”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kahj¶h²hubjS)�”}”(hŒFGet the TLS value as previously set via the __ARM_NR_set_tls syscall. ”h]”hÌ)�”}”(hŒEGet the TLS value as previously set via the __ARM_NR_set_tls syscall.”h]”hŒEGet the TLS value as previously set via the __ARM_NR_set_tls syscall.”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kchjqubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Kchj¶h²hubhÌ)�”}”(hŒUsage example::”h]”hŒUsage example:”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kehj¶h²hubj3)�”}”(hŒºtypedef void * (__kuser_get_tls_t)(void); #define __kuser_get_tls (*(__kuser_get_tls_t *)0xffff0fe0) void foo() { void *tls = __kuser_get_tls(); printf("TLS = %p\n", tls); }”h]”hŒºtypedef void * (__kuser_get_tls_t)(void); #define __kuser_get_tls (*(__kuser_get_tls_t *)0xffff0fe0) void foo() { void *tls = __kuser_get_tls(); printf("TLS = %p\n", tls); }”…”�”}”hj—sbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´Kghj¶h²hubhÌ)�”}”(hŒNotes:”h]”hŒNotes:”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kphj¶h²hubjS)�”}”(hŒJ- Valid only if __kuser_helper_version >= 1 (from kernel version 2.6.12). ”h]”hŒ bullet_list”“”)�”}”(hhh]”hŒ list_item”“”)�”}”(hŒHValid only if __kuser_helper_version >= 1 (from kernel version 2.6.12). ”h]”hÌ)�”}”(hŒGValid only if __kuser_helper_version >= 1 (from kernel version 2.6.12).”h]”hŒGValid only if __kuser_helper_version >= 1 (from kernel version 2.6.12).”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Krhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj¹ubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j·h³hÊh´Krhj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Krhj¶h²hubeh}”(h]”Œ kuser-get-tls”ah ]”h"]”Œ kuser_get_tls”ah$]”h&]”uh1hµhh·h²hh³hÊh´KMubh¶)�”}”(hhh]”(h»)�”}”(hŒ kuser_cmpxchg”h]”hŒ kuser_cmpxchg”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjìh²hh³hÊh´KuubhÌ)�”}”(hŒLocation: 0xffff0fc0”h]”hŒLocation: 0xffff0fc0”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kwhjìh²hubhÌ)�”}”(hŒReference prototype::”h]”hŒReference prototype:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kyhjìh²hubj3)�”}”(hŒKint __kuser_cmpxchg(int32_t oldval, int32_t newval, volatile int32_t *ptr);”h]”hŒKint __kuser_cmpxchg(int32_t oldval, int32_t newval, volatile int32_t *ptr);”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´K{hjìh²hubhÌ)�”}”(hŒInput:”h]”hŒInput:”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K}hjìh²hubjS)�”}”(hŒ5r0 = oldval r1 = newval r2 = ptr lr = return address ”h]”hÌ)�”}”(hŒ4r0 = oldval r1 = newval r2 = ptr lr = return address”h]”hŒ4r0 = oldval r1 = newval r2 = ptr lr = return address”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj5ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Khjìh²hubhÌ)�”}”(hŒOutput:”h]”hŒOutput:”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K„hjìh²hubjS)�”}”(hŒOr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0 ”h]”hÌ)�”}”(hŒNr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0”h]”hŒNr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K†hjìh²hubhÌ)�”}”(hŒClobbered registers:”h]”hŒClobbered registers:”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‰hjìh²hubjS)�”}”(hŒr3, ip, flags ”h]”hÌ)�”}”(hŒ r3, ip, flags”h]”hŒ r3, ip, flags”…”�”}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‹hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K‹hjìh²hubhÌ)�”}”(hŒ Definition:”h]”hŒ Definition:”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjìh²hubjS)�”}”(hŒñAtomically store newval in `*ptr` only if `*ptr` is equal to oldval. Return zero if `*ptr` was changed or non-zero if no exchange happened. The C flag is also set if `*ptr` was changed to allow for assembly optimization in the calling code. ”h]”hÌ)�”}”(hŒðAtomically store newval in `*ptr` only if `*ptr` is equal to oldval. Return zero if `*ptr` was changed or non-zero if no exchange happened. The C flag is also set if `*ptr` was changed to allow for assembly optimization in the calling code.”h]”(hŒAtomically store newval in ”…”�”}”(hj«h²hh³Nh´NubhŒtitle_reference”“”)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hj«ubhŒ only if ”…”�”}”(hj«h²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hj«ubhŒ$ is equal to oldval. Return zero if ”…”�”}”(hj«h²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hj«ubhŒL was changed or non-zero if no exchange happened. The C flag is also set if ”…”�”}”(hj«h²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hj«ubhŒD was changed to allow for assembly optimization in the calling code.”…”�”}”(hj«h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hj§ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K�hjìh²hubhÌ)�”}”(hŒUsage example::”h]”hŒUsage example:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K”hjìh²hubj3)�”}”(hXQtypedef int (__kuser_cmpxchg_t)(int oldval, int newval, volatile int *ptr); #define __kuser_cmpxchg (*(__kuser_cmpxchg_t *)0xffff0fc0) int atomic_add(volatile int *ptr, int val) { int old, new; do { old = *ptr; new = old + val; } while(__kuser_cmpxchg(old, new, ptr)); return new; }”h]”hXQtypedef int (__kuser_cmpxchg_t)(int oldval, int newval, volatile int *ptr); #define __kuser_cmpxchg (*(__kuser_cmpxchg_t *)0xffff0fc0) int atomic_add(volatile int *ptr, int val) { int old, new; do { old = *ptr; new = old + val; } while(__kuser_cmpxchg(old, new, ptr)); return new; }”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´K–hjìh²hubhÌ)�”}”(hŒNotes:”h]”hŒNotes:”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¥hjìh²hubjS)�”}”(hŒ†- This routine already includes memory barriers as needed. - Valid only if __kuser_helper_version >= 2 (from kernel version 2.6.12). ”h]”j¸)�”}”(hhh]”(j½)�”}”(hŒ9This routine already includes memory barriers as needed. ”h]”hÌ)�”}”(hŒ8This routine already includes memory barriers as needed.”h]”hŒ8This routine already includes memory barriers as needed.”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K§hj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj7ubj½)�”}”(hŒHValid only if __kuser_helper_version >= 2 (from kernel version 2.6.12). ”h]”hÌ)�”}”(hŒGValid only if __kuser_helper_version >= 2 (from kernel version 2.6.12).”h]”hŒGValid only if __kuser_helper_version >= 2 (from kernel version 2.6.12).”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K©hjRubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj7ubeh}”(h]”h ]”h"]”h$]”h&]”jÜjÝuh1j·h³hÊh´K§hj3ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K§hjìh²hubeh}”(h]”Œ kuser-cmpxchg”ah ]”h"]”Œ kuser_cmpxchg”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kuubh¶)�”}”(hhh]”(h»)�”}”(hŒkuser_memory_barrier”h]”hŒkuser_memory_barrier”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj~h²hh³hÊh´K¬ubhÌ)�”}”(hŒLocation: 0xffff0fa0”h]”hŒLocation: 0xffff0fa0”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K®hj~h²hubhÌ)�”}”(hŒReference prototype::”h]”hŒReference prototype:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K°hj~h²hubj3)�”}”(hŒ"void __kuser_memory_barrier(void);”h]”hŒ"void __kuser_memory_barrier(void);”…”�”}”hj«sbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´K²hj~h²hubhÌ)�”}”(hŒInput:”h]”hŒInput:”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K´hj~h²hubjS)�”}”(hŒlr = return address ”h]”hÌ)�”}”(hŒlr = return address”h]”hŒlr = return address”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¶hjÇubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K¶hj~h²hubhÌ)�”}”(hŒOutput:”h]”hŒOutput:”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¸hj~h²hubjS)�”}”(hŒnone ”h]”hÌ)�”}”(hŒnone”h]”hŒnone”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kºhjíubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Kºhj~h²hubhÌ)�”}”(hŒClobbered registers:”h]”hŒClobbered registers:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¼hj~h²hubjS)�”}”(hŒnone ”h]”hÌ)�”}”(hŒnone”h]”hŒnone”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´K¾hj~h²hubhÌ)�”}”(hŒ Definition:”h]”hŒ Definition:”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÀhj~h²hubjS)�”}”(hŒoApply any needed memory barrier to preserve consistency with data modified manually and __kuser_cmpxchg usage. ”h]”hÌ)�”}”(hŒnApply any needed memory barrier to preserve consistency with data modified manually and __kuser_cmpxchg usage.”h]”hŒnApply any needed memory barrier to preserve consistency with data modified manually and __kuser_cmpxchg usage.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÂhj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´KÂhj~h²hubhÌ)�”}”(hŒUsage example::”h]”hŒUsage example:”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÅhj~h²hubj3)�”}”(hŒVtypedef void (__kuser_dmb_t)(void); #define __kuser_dmb (*(__kuser_dmb_t *)0xffff0fa0)”h]”hŒVtypedef void (__kuser_dmb_t)(void); #define __kuser_dmb (*(__kuser_dmb_t *)0xffff0fa0)”…”�”}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´KÇhj~h²hubhÌ)�”}”(hŒNotes:”h]”hŒNotes:”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÊhj~h²hubjS)�”}”(hŒJ- Valid only if __kuser_helper_version >= 3 (from kernel version 2.6.15). ”h]”j¸)�”}”(hhh]”j½)�”}”(hŒHValid only if __kuser_helper_version >= 3 (from kernel version 2.6.15). ”h]”hÌ)�”}”(hŒGValid only if __kuser_helper_version >= 3 (from kernel version 2.6.15).”h]”hŒGValid only if __kuser_helper_version >= 3 (from kernel version 2.6.15).”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÌhj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hjubah}”(h]”h ]”h"]”h$]”h&]”jÜjÝuh1j·h³hÊh´KÌhj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´KÌhj~h²hubeh}”(h]”Œkuser-memory-barrier”ah ]”h"]”Œkuser_memory_barrier”ah$]”h&]”uh1hµhh·h²hh³hÊh´K¬ubh¶)�”}”(hhh]”(h»)�”}”(hŒkuser_cmpxchg64”h]”hŒkuser_cmpxchg64”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj®h²hh³hÊh´KÏubhÌ)�”}”(hŒLocation: 0xffff0f60”h]”hŒLocation: 0xffff0f60”…”�”}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÑhj®h²hubhÌ)�”}”(hŒReference prototype::”h]”hŒReference prototype:”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÓhj®h²hubj3)�”}”(hŒ‡int __kuser_cmpxchg64(const int64_t *oldval, const int64_t *newval, volatile int64_t *ptr);”h]”hŒ‡int __kuser_cmpxchg64(const int64_t *oldval, const int64_t *newval, volatile int64_t *ptr);”…”�”}”hjÛsbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´KÕhj®h²hubhÌ)�”}”(hŒInput:”h]”hŒInput:”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÙhj®h²hubjS)�”}”(hŒ_r0 = pointer to oldval r1 = pointer to newval r2 = pointer to target value lr = return address ”h]”hÌ)�”}”(hŒ^r0 = pointer to oldval r1 = pointer to newval r2 = pointer to target value lr = return address”h]”hŒ^r0 = pointer to oldval r1 = pointer to newval r2 = pointer to target value lr = return address”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÛhj÷ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´KÛhj®h²hubhÌ)�”}”(hŒOutput:”h]”hŒOutput:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kàhj®h²hubjS)�”}”(hŒOr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0 ”h]”hÌ)�”}”(hŒNr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0”h]”hŒNr0 = success code (zero or non-zero) C flag = set if r0 == 0, clear if r0 != 0”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kâhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Kâhj®h²hubhÌ)�”}”(hŒClobbered registers:”h]”hŒClobbered registers:”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kåhj®h²hubjS)�”}”(hŒr3, lr, flags ”h]”hÌ)�”}”(hŒ r3, lr, flags”h]”hŒ r3, lr, flags”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KçhjCubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Kçhj®h²hubhÌ)�”}”(hŒ Definition:”h]”hŒ Definition:”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kéhj®h²hubjS)�”}”(hX1Atomically store the 64-bit value pointed by `*newval` in `*ptr` only if `*ptr` is equal to the 64-bit value pointed by `*oldval`. Return zero if `*ptr` was changed or non-zero if no exchange happened. The C flag is also set if `*ptr` was changed to allow for assembly optimization in the calling code. ”h]”(hÌ)�”}”(hŒÊAtomically store the 64-bit value pointed by `*newval` in `*ptr` only if `*ptr` is equal to the 64-bit value pointed by `*oldval`. Return zero if `*ptr` was changed or non-zero if no exchange happened.”h]”(hŒ-Atomically store the 64-bit value pointed by ”…”�”}”(hjmh²hh³Nh´Nubj´)�”}”(hŒ `*newval`”h]”hŒ*newval”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjmubhŒ in ”…”�”}”(hjmh²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjmubhŒ only if ”…”�”}”(hjmh²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjmubhŒ) is equal to the 64-bit value pointed by ”…”�”}”(hjmh²hh³Nh´Nubj´)�”}”(hŒ `*oldval`”h]”hŒ*oldval”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjmubhŒ. Return zero if ”…”�”}”(hjmh²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjmubhŒ1 was changed or non-zero if no exchange happened.”…”�”}”(hjmh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KëhjiubhÌ)�”}”(hŒdThe C flag is also set if `*ptr` was changed to allow for assembly optimization in the calling code.”h]”(hŒThe C flag is also set if ”…”�”}”(hjÕh²hh³Nh´Nubj´)�”}”(hŒ`*ptr`”h]”hŒ*ptr”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j³hjÕubhŒD was changed to allow for assembly optimization in the calling code.”…”�”}”(hjÕh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kïhjiubeh}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Këhj®h²hubhÌ)�”}”(hŒUsage example::”h]”hŒUsage example:”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kòhj®h²hubj3)�”}”(hXËtypedef int (__kuser_cmpxchg64_t)(const int64_t *oldval, const int64_t *newval, volatile int64_t *ptr); #define __kuser_cmpxchg64 (*(__kuser_cmpxchg64_t *)0xffff0f60) int64_t atomic_add64(volatile int64_t *ptr, int64_t val) { int64_t old, new; do { old = *ptr; new = old + val; } while(__kuser_cmpxchg64(&old, &new, ptr)); return new; }”h]”hXËtypedef int (__kuser_cmpxchg64_t)(const int64_t *oldval, const int64_t *newval, volatile int64_t *ptr); #define __kuser_cmpxchg64 (*(__kuser_cmpxchg64_t *)0xffff0f60) int64_t atomic_add64(volatile int64_t *ptr, int64_t val) { int64_t old, new; do { old = *ptr; new = old + val; } while(__kuser_cmpxchg64(&old, &new, ptr)); return new; }”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jBjCuh1j2h³hÊh´Kôhj®h²hubhÌ)�”}”(hŒNotes:”h]”hŒNotes:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj®h²hubjS)�”}”(hX - This routine already includes memory barriers as needed. - Due to the length of this sequence, this spans 2 conventional kuser "slots", therefore 0xffff0f80 is not used as a valid entry point. - Valid only if __kuser_helper_version >= 5 (from kernel version 3.1).”h]”j¸)�”}”(hhh]”(j½)�”}”(hŒ9This routine already includes memory barriers as needed. ”h]”hÌ)�”}”(hŒ8This routine already includes memory barriers as needed.”h]”hŒ8This routine already includes memory barriers as needed.”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj)ubj½)�”}”(hŒ†Due to the length of this sequence, this spans 2 conventional kuser "slots", therefore 0xffff0f80 is not used as a valid entry point. ”h]”hÌ)�”}”(hŒ…Due to the length of this sequence, this spans 2 conventional kuser "slots", therefore 0xffff0f80 is not used as a valid entry point.”h]”hŒ‰Due to the length of this sequence, this spans 2 conventional kuser “slotsâ€�, therefore 0xffff0f80 is not used as a valid entry point.”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjDubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj)ubj½)�”}”(hŒDValid only if __kuser_helper_version >= 5 (from kernel version 3.1).”h]”hÌ)�”}”(hj^h]”hŒDValid only if __kuser_helper_version >= 5 (from kernel version 3.1).”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj)ubeh}”(h]”h ]”h"]”h$]”h&]”jÜjÝuh1j·h³hÊh´Mhj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÊh´Mhj®h²hubeh}”(h]”Œkuser-cmpxchg64”ah ]”h"]”Œkuser_cmpxchg64”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÏubeh}”(h]”Œkernel-provided-user-helpers”ah ]”h"]”Œkernel-provided user helpers”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j²Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jŒj‰j³j°jéjæj{jxj«j¨j„j�uŒ nametypes”}”(jŒ‰j³‰jé‰j{‰j«‰j„‰uh}”(j‰h·j°jjæj¶jxjìj¨j~j�j®uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.