1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * User memory copying routines for the Hexagon Kernel
5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
8 /* The right way to do this involves valignb
9 * The easy way to do this is only speed up src/dest similar alignment.
13 * Copy to/from user are the same, except that for packets with a load and
14 * a store, I don't know how to tell which kind of exception we got.
15 * Therefore, we duplicate the function, and handle faulting addresses
16 * differently for each function
20 * copy to user: stores can fault
24 #define src_dst_sav r13:12
33 #define FUNCNAME raw_copy_to_user
34 #include "copy_user_template.S"
36 /* STORE FAULTS from COPY_TO_USER */
41 /* Alignment loop. r2 has been updated. Return it. */
46 /* Normal copy loops. Use dst-dst_sav to compute distance */
47 /* dst holds best write, no need to unwind any loops */
48 /* X - (A - B) == X + B - A */
59 r2 += sub(dst_sav,dst)
66 /* COPY TO USER: only stores can fail */
67 .section __ex_table,"a"