1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * User memory copy functions for kernel
5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
9 * The right way to do this involves valignb
10 * The easy way to do this is only speed up src/dest similar alignment.
14 * Copy to/from user are the same, except that for packets with a load and
15 * a store, I don't know how to tell which kind of exception we got.
16 * Therefore, we duplicate the function, and handle faulting addresses
17 * differently for each function
21 * copy from user: loads can fault
25 #define src_dst_sav r13:12
34 #define FUNCNAME raw_copy_from_user
35 #include "copy_user_template.S"
37 /* LOAD FAULTS from COPY_FROM_USER */
39 /* Alignment loop. r2 has been updated. Return it. */
48 /* Normal copy loops. Do epilog. Use src-src_sav to compute distance */
49 /* X - (A - B) == X + B - A */
54 r2 += sub(src_sav,src)
64 r2 += sub(src_sav,src)
74 r2 += sub(src_sav,src)
84 r2 += sub(src_sav,src)
91 /* COPY FROM USER: only loads can fail */
93 .section __ex_table,"a"