2 * defines ioport related functions
4 * Copyright (c) 2003 Fabrice Bellard
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.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 /**************************************************************************
27 #include "qemu-common.h"
29 #define MAX_IOPORTS (64 * 1024)
30 #define IOPORTS_MASK (MAX_IOPORTS - 1)
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
);
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
);
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
);