OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [ppc/] [kernel/] [port_io.c] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1624 jcastillo
/*
2
 * I/O 'port' access routines
3
 */
4
 
5
/* This is really only correct for the MVME16xx (PreP)? */
6
 
7
#define _IO_BASE ((unsigned long)0x80000000)
8
 
9
unsigned char
10
inb(int port)
11
{
12
        return (*((unsigned  char *)(_IO_BASE+port)));
13
}
14
 
15
unsigned short
16
inw(int port)
17
{
18
        return (_LE_to_BE_short(*((unsigned short *)(_IO_BASE+port))));
19
}
20
 
21
unsigned long
22
inl(int port)
23
{
24
        return (_LE_to_BE_long(*((unsigned  long *)(_IO_BASE+port))));
25
}
26
 
27
void insb(int port, char *ptr, int len)
28
{
29
        unsigned char *io_ptr = (unsigned char *)(_IO_BASE+port);
30
        while (len-- > 0)
31
        {
32
                *ptr++ = *io_ptr;
33
        }
34
}
35
 
36
#if 0
37
void insw(int port, short *ptr, int len)
38
{
39
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
40
        while (len-- > 0)
41
        {
42
                *ptr++ = _LE_to_BE_short(*io_ptr);
43
        }
44
}
45
#else
46
void insw(int port, short *ptr, int len)
47
{
48
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
49
        _insw(io_ptr, ptr, len);
50
}
51
#endif
52
 
53
void insw_unswapped(int port, short *ptr, int len)
54
{
55
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
56
        while (len-- > 0)
57
        {
58
                *ptr++ = *io_ptr;
59
        }
60
}
61
 
62
void insl(int port, long *ptr, int len)
63
{
64
        unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
65
        while (len-- > 0)
66
        {
67
                *ptr++ = _LE_to_BE_long(*io_ptr);
68
        }
69
}
70
 
71
unsigned char  inb_p(int port) {return (inb(port)); }
72
unsigned short inw_p(int port) {return (inw(port)); }
73
unsigned long  inl_p(int port) {return (inl(port)); }
74
 
75
unsigned char
76
outb(unsigned char val,int port)
77
{
78
        *((unsigned  char *)(_IO_BASE+port)) = (val);
79
        return (val);
80
}
81
 
82
unsigned short
83
outw(unsigned short val,int port)
84
{
85
        *((unsigned  short *)(_IO_BASE+port)) = _LE_to_BE_short(val);
86
        return (val);
87
}
88
 
89
unsigned long
90
outl(unsigned long val,int port)
91
{
92
        *((unsigned  long *)(_IO_BASE+port)) = _LE_to_BE_long(val);
93
        return (val);
94
}
95
 
96
void outsb(int port, char *ptr, int len)
97
{
98
        unsigned char *io_ptr = (unsigned char *)(_IO_BASE+port);
99
        while (len-- > 0)
100
        {
101
                *io_ptr = *ptr++;
102
        }
103
}
104
 
105
#if 0
106
void outsw(int port, short *ptr, int len)
107
{
108
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
109
        while (len-- > 0)
110
        {
111
                *io_ptr = _LE_to_BE_short(*ptr++);
112
        }
113
}
114
#else
115
void outsw(int port, short *ptr, int len)
116
{
117
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
118
        _outsw(io_ptr, ptr, len);
119
}
120
#endif
121
 
122
void outsw_unswapped(int port, short *ptr, int len)
123
{
124
        unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port);
125
        while (len-- > 0)
126
        {
127
                *io_ptr = *ptr++;
128
        }
129
}
130
 
131
void outsl(int port, long *ptr, int len)
132
{
133
        unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
134
        while (len-- > 0)
135
        {
136
                *io_ptr = _LE_to_BE_long(*ptr++);
137
        }
138
}
139
 
140
unsigned char  outb_p(unsigned char val,int port) { return (outb(val,port)); }
141
unsigned short outw_p(unsigned short val,int port) { return (outw(val,port)); }
142
unsigned long  outl_p(unsigned long val,int port) { return (outl(val,port)); }
143
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.