Merge branches 'sched/devel', 'sched/cpu-hotplug', 'sched/cpusets' and 'sched/urgent...
[linux-2.6] / arch / avr32 / lib / io-writesw.S
1 /*
2  * Copyright (C) 2004-2006 Atmel Corporation
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 .Lnot_word_aligned:
10         ld.uh   r8, r11++
11         sub     r10, 1
12         st.h    r12[0], r8
13
14         .global __raw_writesw
15         .type   __raw_writesw,@function
16 __raw_writesw:
17         cp.w    r10, 0
18         mov     r9, 3
19         reteq   r12
20         tst     r11, r9
21         brne    .Lnot_word_aligned
22
23         sub     r10, 2
24         brlt    2f
25
26 1:      ld.w    r8, r11++
27         bfextu  r9, r8, 16, 16
28         st.h    r12[0], r9
29         st.h    r12[0], r8
30         sub     r10, 2
31         brge    1b
32
33 2:      sub     r10, -2
34         reteq   r12
35
36         ld.uh   r8, r11++
37         st.h    r12[0], r8
38         retal   r12