]> git.proxmox.com Git - qemu.git/blob - ioport.h
split out ioport related stuffs from vl.c into ioport.c.
[qemu.git] / ioport.h
1 /*
2 * defines ioport related functions
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
19 */
20
21 /**************************************************************************
22 * IO ports API
23 */
24
25 #ifndef IOPORT_H
26 #define IOPORT_H
27
28 #include "qemu-common.h"
29
30 #define MAX_IOPORTS (64 * 1024)
31
32 /* These should really be in isa.h, but are here to make pc.h happy. */
33 typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
34 typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
35
36 int register_ioport_read(int start, int length, int size,
37 IOPortReadFunc *func, void *opaque);
38 int register_ioport_write(int start, int length, int size,
39 IOPortWriteFunc *func, void *opaque);
40 void isa_unassign_ioport(int start, int length);
41
42
43 /* NOTE: as these functions may be even used when there is an isa
44 brige on non x86 targets, we always defined them */
45 #if !defined(NO_CPU_IO_DEFS) && defined(NEED_CPU_H)
46 void cpu_outb(CPUState *env, int addr, int val);
47 void cpu_outw(CPUState *env, int addr, int val);
48 void cpu_outl(CPUState *env, int addr, int val);
49 int cpu_inb(CPUState *env, int addr);
50 int cpu_inw(CPUState *env, int addr);
51 int cpu_inl(CPUState *env, int addr);
52 #endif
53
54 #endif /* IOPORT_H */