2 * User memory copying routines for the Hexagon Kernel
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 /* The right way to do this involves valignb
22 * The easy way to do this is only speed up src/dest similar alignment.
26 * Copy to/from user are the same, except that for packets with a load and
27 * a store, I don't know how to tell which kind of exception we got.
28 * Therefore, we duplicate the function, and handle faulting addresses
29 * differently for each function
33 * copy to user: stores can fault
37 #define src_dst_sav r13:12
46 #define FUNCNAME __copy_to_user_hexagon
47 #include "copy_user_template.S"
49 /* STORE FAULTS from COPY_TO_USER */
54 /* Alignment loop. r2 has been updated. Return it. */
59 /* Normal copy loops. Use dst-dst_sav to compute distance */
60 /* dst holds best write, no need to unwind any loops */
61 /* X - (A - B) == X + B - A */
72 r2 += sub(dst_sav,dst)
79 /* COPY TO USER: only stores can fail */
80 .section __ex_table,"a"