aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/lib/io-readsb.S
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2006-10-24 04:12:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-25 23:26:33 -0400
commitd68041cc9fde550fe6b6a6de1d7a110daff3cb60 (patch)
tree1b712054a6466b7901339ebaba37ce27c7f2b1a0 /arch/avr32/lib/io-readsb.S
parent065834ab3988fece5608088e83724891c8190a2f (diff)
[PATCH] AVR32: Implement and export __raw_{read,write}s[bwl]
Implement __raw_readsb and __raw_writesb. Export __raw_reads[bwl] and __raw_writes[bwl] for use by modules. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/avr32/lib/io-readsb.S')
-rw-r--r--arch/avr32/lib/io-readsb.S47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/avr32/lib/io-readsb.S b/arch/avr32/lib/io-readsb.S
new file mode 100644
index 000000000000..b319d5e71749
--- /dev/null
+++ b/arch/avr32/lib/io-readsb.S
@@ -0,0 +1,47 @@
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 .text
10.Lnot_word_aligned:
111: ld.ub r8, r12[0]
12 sub r10, 1
13 st.b r11++, r8
14 reteq r12
15 tst r11, r9
16 brne 1b
17
18 /* fall through */
19
20 .global __raw_readsb
21 .type __raw_readsb,@function
22__raw_readsb:
23 cp.w r10, 0
24 mov r9, 3
25 reteq r12
26
27 tst r11, r9
28 brne .Lnot_word_aligned
29
30 sub r10, 4
31 brlt 2f
32
331: ldins.b r8:t, r12[0]
34 ldins.b r8:u, r12[0]
35 ldins.b r8:l, r12[0]
36 ldins.b r8:b, r12[0]
37 st.w r11++, r8
38 sub r10, 4
39 brge 1b
40
412: sub r10, -4
42 reteq r12
43
443: ld.uh r8, r12[0]
45 sub r10, 1
46 st.b r11++, r8
47 brne 3b