Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
782cf01e
Commit
782cf01e
authored
Apr 12, 2004
by
Geert Uytterhoeven
Committed by
Linus Torvalds
Apr 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] m68k I/O
m68k: Use explicit-sized types for I/O accesses
parent
a6f199d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
43 deletions
+42
-43
include/asm-m68k/io.h
include/asm-m68k/io.h
+17
-17
include/asm-m68k/raw_io.h
include/asm-m68k/raw_io.h
+25
-26
No files found.
include/asm-m68k/io.h
View file @
782cf01e
...
...
@@ -120,66 +120,66 @@ extern int isa_sex;
* be compiled in so the case statement will be optimised away
*/
static
inline
u
nsigned
char
*
isa_itb
(
long
addr
)
static
inline
u
8
*
isa_itb
(
long
addr
)
{
switch
(
ISA_TYPE
)
{
#ifdef CONFIG_Q40
case
Q40_ISA
:
return
(
u
nsigned
char
*
)
Q40_ISA_IO_B
(
addr
);
case
Q40_ISA
:
return
(
u
8
*
)
Q40_ISA_IO_B
(
addr
);
#endif
#ifdef CONFIG_GG2
case
GG2_ISA
:
return
(
u
nsigned
char
*
)
GG2_ISA_IO_B
(
addr
);
case
GG2_ISA
:
return
(
u
8
*
)
GG2_ISA_IO_B
(
addr
);
#endif
#ifdef CONFIG_AMIGA_PCMCIA
case
AG_ISA
:
return
(
u
nsigned
char
*
)
AG_ISA_IO_B
(
addr
);
case
AG_ISA
:
return
(
u
8
*
)
AG_ISA_IO_B
(
addr
);
#endif
default:
return
0
;
/* avoid warnings, just in case */
}
}
static
inline
u
nsigned
short
*
isa_itw
(
long
addr
)
static
inline
u
16
*
isa_itw
(
long
addr
)
{
switch
(
ISA_TYPE
)
{
#ifdef CONFIG_Q40
case
Q40_ISA
:
return
(
u
nsigned
short
*
)
Q40_ISA_IO_W
(
addr
);
case
Q40_ISA
:
return
(
u
16
*
)
Q40_ISA_IO_W
(
addr
);
#endif
#ifdef CONFIG_GG2
case
GG2_ISA
:
return
(
u
nsigned
short
*
)
GG2_ISA_IO_W
(
addr
);
case
GG2_ISA
:
return
(
u
16
*
)
GG2_ISA_IO_W
(
addr
);
#endif
#ifdef CONFIG_AMIGA_PCMCIA
case
AG_ISA
:
return
(
u
nsigned
short
*
)
AG_ISA_IO_W
(
addr
);
case
AG_ISA
:
return
(
u
16
*
)
AG_ISA_IO_W
(
addr
);
#endif
default:
return
0
;
/* avoid warnings, just in case */
}
}
static
inline
u
nsigned
char
*
isa_mtb
(
long
addr
)
static
inline
u
8
*
isa_mtb
(
long
addr
)
{
switch
(
ISA_TYPE
)
{
#ifdef CONFIG_Q40
case
Q40_ISA
:
return
(
u
nsigned
char
*
)
Q40_ISA_MEM_B
(
addr
);
case
Q40_ISA
:
return
(
u
8
*
)
Q40_ISA_MEM_B
(
addr
);
#endif
#ifdef CONFIG_GG2
case
GG2_ISA
:
return
(
u
nsigned
char
*
)
GG2_ISA_MEM_B
(
addr
);
case
GG2_ISA
:
return
(
u
8
*
)
GG2_ISA_MEM_B
(
addr
);
#endif
#ifdef CONFIG_AMIGA_PCMCIA
case
AG_ISA
:
return
(
u
nsigned
char
*
)
addr
;
case
AG_ISA
:
return
(
u
8
*
)
addr
;
#endif
default:
return
0
;
/* avoid warnings, just in case */
}
}
static
inline
u
nsigned
short
*
isa_mtw
(
long
addr
)
static
inline
u
16
*
isa_mtw
(
long
addr
)
{
switch
(
ISA_TYPE
)
{
#ifdef CONFIG_Q40
case
Q40_ISA
:
return
(
u
nsigned
short
*
)
Q40_ISA_MEM_W
(
addr
);
case
Q40_ISA
:
return
(
u
16
*
)
Q40_ISA_MEM_W
(
addr
);
#endif
#ifdef CONFIG_GG2
case
GG2_ISA
:
return
(
u
nsigned
short
*
)
GG2_ISA_MEM_W
(
addr
);
case
GG2_ISA
:
return
(
u
16
*
)
GG2_ISA_MEM_W
(
addr
);
#endif
#ifdef CONFIG_AMIGA_PCMCIA
case
AG_ISA
:
return
(
u
nsigned
short
*
)
addr
;
case
AG_ISA
:
return
(
u
16
*
)
addr
;
#endif
default:
return
0
;
/* avoid warnings, just in case */
}
...
...
@@ -213,7 +213,7 @@ static inline void isa_delay(void)
}
}
#define isa_inb_p(p) ({u
nsigned char
v=isa_inb(p);isa_delay();v;})
#define isa_inb_p(p) ({u
8
v=isa_inb(p);isa_delay();v;})
#define isa_outb_p(v,p) ({isa_outb((v),(p));isa_delay();})
#define isa_insb(port, buf, nr) raw_insb(isa_itb(port), (buf), (nr))
...
...
include/asm-m68k/raw_io.h
View file @
782cf01e
...
...
@@ -10,6 +10,8 @@
#ifdef __KERNEL__
#include <asm/types.h>
/* Values for nocacheflag and cmode */
#define IOMAP_FULL_CACHING 0
...
...
@@ -28,21 +30,21 @@ extern void __iounmap(void *addr, unsigned long size);
* two accesses to memory, which may be undesirable for some devices.
*/
#define in_8(addr) \
({ u
nsigned char __v = (*(volatile unsigned char
*) (addr)); __v; })
({ u
8 __v = (*(volatile u8
*) (addr)); __v; })
#define in_be16(addr) \
({ u
nsigned short __v = (*(volatile unsigned short
*) (addr)); __v; })
({ u
16 __v = (*(volatile u16
*) (addr)); __v; })
#define in_be32(addr) \
({ u
nsigned int __v = (*(volatile unsigned int
*) (addr)); __v; })
({ u
32 __v = (*(volatile u32
*) (addr)); __v; })
#define in_le16(addr) \
({ u
nsigned short __v = le16_to_cpu(*(volatile unsigned short
*) (addr)); __v; })
({ u
16 __v = le16_to_cpu(*(volatile u16
*) (addr)); __v; })
#define in_le32(addr) \
({ u
nsigned int __v = le32_to_cpu(*(volatile unsigned int
*) (addr)); __v; })
({ u
32 __v = le32_to_cpu(*(volatile u32
*) (addr)); __v; })
#define out_8(addr,b) (void)((*(volatile u
nsigned char
*) (addr)) = (b))
#define out_be16(addr,w) (void)((*(volatile u
nsigned short
*) (addr)) = (w))
#define out_be32(addr,l) (void)((*(volatile u
nsigned int
*) (addr)) = (l))
#define out_le16(addr,w) (void)((*(volatile u
nsigned short
*) (addr)) = cpu_to_le16(w))
#define out_le32(addr,l) (void)((*(volatile u
nsigned int
*) (addr)) = cpu_to_le32(l))
#define out_8(addr,b) (void)((*(volatile u
8
*) (addr)) = (b))
#define out_be16(addr,w) (void)((*(volatile u
16
*) (addr)) = (w))
#define out_be32(addr,l) (void)((*(volatile u
32
*) (addr)) = (l))
#define out_le16(addr,w) (void)((*(volatile u
16
*) (addr)) = cpu_to_le16(w))
#define out_le32(addr,l) (void)((*(volatile u
32
*) (addr)) = cpu_to_le32(l))
#define raw_inb in_8
#define raw_inw in_be16
...
...
@@ -52,8 +54,7 @@ extern void __iounmap(void *addr, unsigned long size);
#define raw_outw(val,port) out_be16((port),(val))
#define raw_outl(val,port) out_be32((port),(val))
static
inline
void
raw_insb
(
volatile
unsigned
char
*
port
,
unsigned
char
*
buf
,
unsigned
int
len
)
static
inline
void
raw_insb
(
volatile
u8
*
port
,
u8
*
buf
,
unsigned
int
len
)
{
unsigned
int
i
;
...
...
@@ -61,8 +62,8 @@ static inline void raw_insb(volatile unsigned char *port, unsigned char *buf,
*
buf
++
=
in_8
(
port
);
}
static
inline
void
raw_outsb
(
volatile
u
nsigned
char
*
port
,
const
unsigned
char
*
buf
,
unsigned
int
len
)
static
inline
void
raw_outsb
(
volatile
u
8
*
port
,
const
u8
*
buf
,
unsigned
int
len
)
{
unsigned
int
i
;
...
...
@@ -70,8 +71,7 @@ static inline void raw_outsb(volatile unsigned char *port,
out_8
(
port
,
*
buf
++
);
}
static
inline
void
raw_insw
(
volatile
unsigned
short
*
port
,
unsigned
short
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_insw
(
volatile
u16
*
port
,
u16
*
buf
,
unsigned
int
nr
)
{
unsigned
int
tmp
;
...
...
@@ -110,8 +110,8 @@ static inline void raw_insw(volatile unsigned short *port, unsigned short *buf,
}
}
static
inline
void
raw_outsw
(
volatile
u
nsigned
short
*
port
,
const
unsigned
short
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_outsw
(
volatile
u
16
*
port
,
const
u16
*
buf
,
unsigned
int
nr
)
{
unsigned
int
tmp
;
...
...
@@ -150,8 +150,7 @@ static inline void raw_outsw(volatile unsigned short *port,
}
}
static
inline
void
raw_insl
(
volatile
unsigned
int
*
port
,
unsigned
int
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_insl
(
volatile
u32
*
port
,
u32
*
buf
,
unsigned
int
nr
)
{
unsigned
int
tmp
;
...
...
@@ -190,8 +189,8 @@ static inline void raw_insl(volatile unsigned int *port, unsigned int *buf,
}
}
static
inline
void
raw_outsl
(
volatile
u
nsigned
int
*
port
,
const
unsigned
int
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_outsl
(
volatile
u
32
*
port
,
const
u32
*
buf
,
unsigned
int
nr
)
{
unsigned
int
tmp
;
...
...
@@ -231,8 +230,8 @@ static inline void raw_outsl(volatile unsigned int *port,
}
static
inline
void
raw_insw_swapw
(
volatile
u
nsigned
short
*
port
,
unsigned
short
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_insw_swapw
(
volatile
u
16
*
port
,
u16
*
buf
,
unsigned
int
nr
)
{
if
((
nr
)
%
8
)
__asm__
__volatile__
...
...
@@ -284,8 +283,8 @@ static inline void raw_insw_swapw(volatile unsigned short *port,
:
"d0"
,
"a0"
,
"a1"
,
"d6"
);
}
static
inline
void
raw_outsw_swapw
(
volatile
u
nsigned
short
*
port
,
const
unsigned
short
*
buf
,
unsigned
int
nr
)
static
inline
void
raw_outsw_swapw
(
volatile
u
16
*
port
,
const
u16
*
buf
,
unsigned
int
nr
)
{
if
((
nr
)
%
8
)
__asm__
__volatile__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment