diff options
| -rw-r--r-- | arch/avr32/kernel/avr32_ksyms.c | 9 | ||||
| -rw-r--r-- | arch/avr32/lib/Makefile | 1 | ||||
| -rw-r--r-- | arch/avr32/lib/io-readsb.S | 47 | ||||
| -rw-r--r-- | arch/avr32/lib/io-writesb.S | 52 |
4 files changed, 109 insertions, 0 deletions
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c index 04f767a272b7..372e3f8b2417 100644 --- a/arch/avr32/kernel/avr32_ksyms.c +++ b/arch/avr32/kernel/avr32_ksyms.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #include <linux/io.h> | ||
| 10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 11 | 12 | ||
| 12 | #include <asm/checksum.h> | 13 | #include <asm/checksum.h> |
| @@ -53,3 +54,11 @@ EXPORT_SYMBOL(find_next_zero_bit); | |||
| 53 | EXPORT_SYMBOL(find_first_bit); | 54 | EXPORT_SYMBOL(find_first_bit); |
| 54 | EXPORT_SYMBOL(find_next_bit); | 55 | EXPORT_SYMBOL(find_next_bit); |
| 55 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); | 56 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); |
| 57 | |||
| 58 | /* I/O primitives (lib/io-*.S) */ | ||
| 59 | EXPORT_SYMBOL(__raw_readsb); | ||
| 60 | EXPORT_SYMBOL(__raw_readsw); | ||
| 61 | EXPORT_SYMBOL(__raw_readsl); | ||
| 62 | EXPORT_SYMBOL(__raw_writesb); | ||
| 63 | EXPORT_SYMBOL(__raw_writesw); | ||
| 64 | EXPORT_SYMBOL(__raw_writesl); | ||
diff --git a/arch/avr32/lib/Makefile b/arch/avr32/lib/Makefile index 09ac43e40522..084d95bac5e7 100644 --- a/arch/avr32/lib/Makefile +++ b/arch/avr32/lib/Makefile | |||
| @@ -7,4 +7,5 @@ lib-y += strncpy_from_user.o strnlen_user.o | |||
| 7 | lib-y += delay.o memset.o memcpy.o findbit.o | 7 | lib-y += delay.o memset.o memcpy.o findbit.o |
| 8 | lib-y += csum_partial.o csum_partial_copy_generic.o | 8 | lib-y += csum_partial.o csum_partial_copy_generic.o |
| 9 | lib-y += io-readsw.o io-readsl.o io-writesw.o io-writesl.o | 9 | lib-y += io-readsw.o io-readsl.o io-writesw.o io-writesl.o |
| 10 | lib-y += io-readsb.o io-writesb.o | ||
| 10 | lib-y += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o | 11 | lib-y += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o |
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: | ||
| 11 | 1: 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 | |||
| 33 | 1: 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 | |||
| 41 | 2: sub r10, -4 | ||
| 42 | reteq r12 | ||
| 43 | |||
| 44 | 3: ld.uh r8, r12[0] | ||
| 45 | sub r10, 1 | ||
| 46 | st.b r11++, r8 | ||
| 47 | brne 3b | ||
diff --git a/arch/avr32/lib/io-writesb.S b/arch/avr32/lib/io-writesb.S new file mode 100644 index 000000000000..b4ebaacccf68 --- /dev/null +++ b/arch/avr32/lib/io-writesb.S | |||
| @@ -0,0 +1,52 @@ | |||
| 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: | ||
| 11 | 1: ld.ub r8, r11++ | ||
| 12 | sub r10, 1 | ||
| 13 | st.b r12[0], r8 | ||
| 14 | reteq r12 | ||
| 15 | tst r11, r9 | ||
| 16 | brne 1b | ||
| 17 | |||
| 18 | /* fall through */ | ||
| 19 | |||
| 20 | .global __raw_writesb | ||
| 21 | .type __raw_writesb,@function | ||
| 22 | __raw_writesb: | ||
| 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 | |||
| 33 | 1: ld.w r8, r11++ | ||
| 34 | bfextu r9, r8, 24, 8 | ||
| 35 | st.b r12[0], r9 | ||
| 36 | bfextu r9, r8, 16, 8 | ||
| 37 | st.b r12[0], r9 | ||
| 38 | bfextu r9, r8, 8, 8 | ||
| 39 | st.b r12[0], r9 | ||
| 40 | st.b r12[0], r8 | ||
| 41 | sub r10, 4 | ||
| 42 | brge 1b | ||
| 43 | |||
| 44 | 2: sub r10, -4 | ||
| 45 | reteq r12 | ||
| 46 | |||
| 47 | 3: ld.ub r8, r11++ | ||
| 48 | sub r10, 1 | ||
| 49 | st.b r12[0], r8 | ||
| 50 | brne 3b | ||
| 51 | |||
| 52 | retal r12 | ||
