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