]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/plat-omap/dsp/uaccess_dsp.S
Merge with /home/tmlind/src/kernel/linux-2.6
[linux-2.6-omap-h63xx.git] / arch / arm / plat-omap / dsp / uaccess_dsp.S
1 /*
2  * linux/arch/arm/mach-omap/dsp/uaccess_dsp.S
3  *
4  * user memory access functions for DSP driver
5  *
6  * Copyright (C) 2004,2005 Nokia Corporation
7  *
8  * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  * 2004/06/29:  DSP Gateway version 3.3
25  */
26
27 #include <linux/linkage.h>
28 #include <asm/assembler.h>
29
30                 .text
31
32 /* Prototype: int __arch_copy_to_user_dsp_2b(void *to, const char *from)
33  * Purpose  : copy 2 bytes to user memory from kernel(DSP) memory
34  *            escaping from unexpected byte swap using __arch_copy_to_user()
35  *            in OMAP architecture.
36  * Params   : to   - user memory
37  *          : from - kernel(DSP) memory
38  * Returns  : success = 0, failure = 2
39  */
40
41 ENTRY(__arch_copy_to_user_dsp_2b)
42                 stmfd   sp!, {r4, lr}
43                 ldrb    r3, [r1], #1
44                 ldrb    r4, [r1], #1
45 USER(           strbt   r4, [r0], #1)                   @ May fault
46 USER(           strbt   r3, [r0], #1)                   @ May fault
47                 mov     r0, #0
48                 LOADREGS(fd,sp!,{r4, pc})
49
50                 .section .fixup,"ax"
51                 .align  0
52 9001:           mov     r0, #2
53                 LOADREGS(fd,sp!, {r4, pc})
54                 .previous
55
56 /* Prototype: unsigned long __arch_copy_from_user_dsp_2b(void *to, const void *from);
57  * Purpose  : copy 2 bytes from user memory to kernel(DSP) memory
58  *            escaping from unexpected byte swap using __arch_copy_to_user()
59  *            in OMAP architecture.
60  * Params   : to   - kernel (DSP) memory
61  *          : from - user memory
62  * Returns  : success = 0, failure = 2
63  */
64
65 ENTRY(__arch_copy_from_user_dsp_2b)
66                 stmfd   sp!, {r4, lr}
67 USER(           ldrbt   r3, [r1], #1)                   @ May fault
68 USER(           ldrbt   r4, [r1], #1)                   @ May fault
69                 strb    r4, [r0], #1
70                 strb    r3, [r0], #1
71                 mov     r0, #0
72                 LOADREGS(fd,sp!,{r4, pc})
73
74                 .section .fixup,"ax"
75                 .align  0
76 9001:           mov     r3, #0
77                 strh    r3, [r0], #2
78                 mov     r0, #2
79                 LOADREGS(fd,sp!, {r4, pc})
80                 .previous