2 * User memory copy functions for kernel
4 * Copyright (c) 2010-2011, The Linux Foundation. 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
22 * The right way to do this involves valignb
23 * The easy way to do this is only speed up src/dest similar alignment.
27 * Copy to/from user are the same, except that for packets with a load and
28 * a store, I don't know how to tell which kind of exception we got.
29 * Therefore, we duplicate the function, and handle faulting addresses
30 * differently for each function
34 * copy from user: loads can fault
38 #define src_dst_sav r13:12
47 #define FUNCNAME __copy_from_user_hexagon
48 #include "copy_user_template.S"
50 /* LOAD FAULTS from COPY_FROM_USER */
52 /* Alignment loop. r2 has been updated. Return it. */
61 /* Normal copy loops. Do epilog. Use src-src_sav to compute distance */
62 /* X - (A - B) == X + B - A */
67 r2 += sub(src_sav,src)
77 r2 += sub(src_sav,src)
87 r2 += sub(src_sav,src)
97 r2 += sub(src_sav,src)
104 /* COPY FROM USER: only loads can fail */
106 .section __ex_table,"a"