1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <asm/io.h>
22
23
24
25
26
27
28
29
30
31void __raw_readsw(const void __iomem *addr, void *data, int len)
32{
33 const volatile short int *src = (short int *) addr;
34 short int *dst = (short int *) data;
35
36 if ((u32)data & 0x1)
37 panic("unaligned pointer to readsw");
38
39 while (len-- > 0)
40 *dst++ = *src;
41
42}
43
44
45
46
47
48
49
50void __raw_writesw(void __iomem *addr, const void *data, int len)
51{
52 const short int *src = (short int *)data;
53 volatile short int *dst = (short int *)addr;
54
55 if ((u32)data & 0x1)
56 panic("unaligned pointer to writesw");
57
58 while (len-- > 0)
59 *dst = *src++;
60
61
62}
63
64
65void __raw_readsl(const void __iomem *addr, void *data, int len)
66{
67 const volatile long *src = (long *) addr;
68 long *dst = (long *) data;
69
70 if ((u32)data & 0x3)
71 panic("unaligned pointer to readsl");
72
73 while (len-- > 0)
74 *dst++ = *src;
75
76
77}
78
79void __raw_writesl(void __iomem *addr, const void *data, int len)
80{
81 const long *src = (long *)data;
82 volatile long *dst = (long *)addr;
83
84 if ((u32)data & 0x3)
85 panic("unaligned pointer to writesl");
86
87 while (len-- > 0)
88 *dst = *src++;
89
90
91}
92