Statistics
| Branch: | Revision:

root / ioport.h @ d56dd6cf

History | View | Annotate | Download (2 kB)

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