VirtualBox

source: vbox/trunk/src/recompiler/ioport.h@ 74062

Last change on this file since 74062 was 37829, checked in by vboxsync, 13 years ago

header fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
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, see <http://www.gnu.org/licenses/>.
18 */
19
20/*
21 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
22 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
23 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
24 * a choice of LGPL license versions is made available with the language indicating
25 * that LGPLv2 or any later version may be used, or where a choice of which version
26 * of the LGPL is applied is otherwise unspecified.
27 */
28
29/**************************************************************************
30 * IO ports API
31 */
32
33#ifndef IOPORT_H
34#define IOPORT_H
35
36#include "qemu-common.h"
37
38typedef uint32_t pio_addr_t;
39#define FMT_pioaddr PRIx32
40
41#define MAX_IOPORTS (64 * 1024)
42#define IOPORTS_MASK (MAX_IOPORTS - 1)
43
44/* These should really be in isa.h, but are here to make pc.h happy. */
45typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
46typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
47
48int register_ioport_read(pio_addr_t start, int length, int size,
49 IOPortReadFunc *func, void *opaque);
50int register_ioport_write(pio_addr_t start, int length, int size,
51 IOPortWriteFunc *func, void *opaque);
52void isa_unassign_ioport(pio_addr_t start, int length);
53
54
55#ifndef VBOX
56void cpu_outb(pio_addr_t addr, uint8_t val);
57void cpu_outw(pio_addr_t addr, uint16_t val);
58void cpu_outl(pio_addr_t addr, uint32_t val);
59uint8_t cpu_inb(pio_addr_t addr);
60uint16_t cpu_inw(pio_addr_t addr);
61uint32_t cpu_inl(pio_addr_t addr);
62#else
63void cpu_outb(CPUX86State *env, pio_addr_t addr, uint8_t val);
64void cpu_outw(CPUX86State *env, pio_addr_t addr, uint16_t val);
65void cpu_outl(CPUX86State *env, pio_addr_t addr, uint32_t val);
66uint8_t cpu_inb(CPUX86State *env, pio_addr_t addr);
67uint16_t cpu_inw(CPUX86State *env, pio_addr_t addr);
68uint32_t cpu_inl(CPUX86State *env, pio_addr_t addr);
69#endif
70
71#endif /* IOPORT_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette