direct-io.hg

view xen/include/asm-powerpc/io.h @ 11487:4fdf5151b187

[POWERPC] merge with xen-unstable.hg
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author hollisb@localhost
date Mon Sep 18 12:48:56 2006 -0500 (2006-09-18)
parents 050de6b53961
children
line source
1 /*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * Copyright (C) IBM Corp. 2005
17 *
18 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 */
21 #ifndef _ASM_IO_H_
22 #define _ASM_IO_H_
24 #include <xen/types.h>
25 #include <asm/processor.h>
27 #define IO_SPACE_LIMIT 0xffff
29 extern unsigned int watchdog_on;
30 extern ulong isa_io_base;
32 #define inb(port) in_8((void *)((ulong)(port) + isa_io_base))
33 #define outb(val, port) out_8((void *)((ulong)(port) + isa_io_base), val)
34 #define inw(port) in_le16((void *)((ulong)(port) + isa_io_base))
35 #define outw(val, port) out_le16((void *)((ulong)(port) + isa_io_base), val)
36 #define inl(port) in_le32((void *)((ulong)(port) + isa_io_base))
37 #define outl(val, port) out_le32((void *)((ulong)(port) + isa_io_base), val)
39 #define ioremap(x,l) (void __iomem *)(x)
40 #define readb(port) in_8((void *)(port))
41 #define writeb(val, port) out_8((void *)(port), val)
43 extern char *vgabase;
44 #define vga_writeb(val, port) out_8((void *)((ulong)(port) + vgabase), val)
46 extern u8 in_8(const volatile u8 *addr);
47 extern void out_8(volatile u8 *addr, int val);
48 extern u32 in_32(const volatile u32 *addr);
49 extern void out_32(volatile u32 *addr, int val);
50 extern int in_le16(const volatile unsigned short *addr);
51 extern void out_le16(volatile unsigned short *addr, int val);
52 extern unsigned in_le32(const volatile unsigned *addr);
53 extern void out_le32(volatile unsigned *addr, int val);
55 #define in_be8 in_8
56 #define in_be16 in_16
57 #define in_be32 in_32
58 #define out_be8 out_8
59 #define out_be16 out_16
60 #define out_be32 out_32
62 #define readw(port) in_le16((void *)(port))
63 #define readl(port) in_le32((void *)(port))
64 #define writew(val, port) out_le16((void *)(port), val)
65 #define writel(val, port) out_le32((void *)(port), val)
67 #define barrier() __asm__ __volatile__("": : :"memory")
69 #endif