Fix non-ACPI Timer Interrupt Routing - v3
[qemu.git] / ioport.h
blob4cb59e951f3cd3027086cfe6c8ea6ad06418e6a4
1 /*
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, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
21 /**************************************************************************
22 * IO ports API
25 #ifndef IOPORT_H
26 #define IOPORT_H
28 #include "qemu-common.h"
30 #define MAX_IOPORTS (64 * 1024)
31 #define IOPORTS_MASK (MAX_IOPORTS - 1)
33 /* These should really be in isa.h, but are here to make pc.h happy. */
34 typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
35 typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
37 int register_ioport_read(int start, int length, int size,
38 IOPortReadFunc *func, void *opaque);
39 int register_ioport_write(int start, int length, int size,
40 IOPortWriteFunc *func, void *opaque);
41 void isa_unassign_ioport(int start, int length);
44 /* NOTE: as these functions may be even used when there is an isa
45 brige on non x86 targets, we always defined them */
46 #if !defined(NO_CPU_IO_DEFS) && defined(NEED_CPU_H)
47 void cpu_outb(CPUState *env, int addr, int val);
48 void cpu_outw(CPUState *env, int addr, int val);
49 void cpu_outl(CPUState *env, int addr, int val);
50 int cpu_inb(CPUState *env, int addr);
51 int cpu_inw(CPUState *env, int addr);
52 int cpu_inl(CPUState *env, int addr);
53 #endif
55 #endif /* IOPORT_H */