]> git.proxmox.com Git - qemu.git/blame - vl.h
first multi target test (lauches 'ls')
[qemu.git] / vl.h
CommitLineData
fc01f7e7
FB
1/*
2 * QEMU System Emulator header
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24#ifndef VL_H
25#define VL_H
26
33e3963e 27/* vl.c */
313aa567
FB
28struct CPUX86State;
29extern int reset_requested;
27503323 30extern int64_t ticks_per_sec;
313aa567
FB
31
32typedef void (IOPortWriteFunc)(struct CPUX86State *env, uint32_t address, uint32_t data);
33typedef uint32_t (IOPortReadFunc)(struct CPUX86State *env, uint32_t address);
34
33e3963e 35void *get_mmap_addr(unsigned long size);
313aa567
FB
36int register_ioport_read(int start, int length, IOPortReadFunc *func, int size);
37int register_ioport_write(int start, int length, IOPortWriteFunc *func, int size);
5391d806 38void pic_set_irq(int irq, int level);
27503323 39int64_t cpu_get_ticks(void);
313aa567
FB
40
41void kbd_put_keycode(int keycode);
42
43#define MOUSE_EVENT_LBUTTON 0x01
44#define MOUSE_EVENT_RBUTTON 0x02
45#define MOUSE_EVENT_MBUTTON 0x04
46void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
33e3963e 47
fc01f7e7
FB
48/* block.c */
49typedef struct BlockDriverState BlockDriverState;
50
33e3963e 51BlockDriverState *bdrv_open(const char *filename, int snapshot);
fc01f7e7
FB
52void bdrv_close(BlockDriverState *bs);
53int bdrv_read(BlockDriverState *bs, int64_t sector_num,
54 uint8_t *buf, int nb_sectors);
55int bdrv_write(BlockDriverState *bs, int64_t sector_num,
56 const uint8_t *buf, int nb_sectors);
57void bdrv_get_geometry(BlockDriverState *bs, int64_t *nb_sectors_ptr);
33e3963e
FB
58int bdrv_commit(BlockDriverState *bs);
59
60/* user mode linux compatible COW file */
61#define COW_MAGIC 0x4f4f4f4d /* MOOO */
62#define COW_VERSION 2
fc01f7e7 63
33e3963e
FB
64struct cow_header_v2 {
65 uint32_t magic;
9dfa5b42 66 uint32_t version;
33e3963e
FB
67 char backing_file[1024];
68 int32_t mtime;
69 uint64_t size;
70 uint32_t sectorsize;
71};
fc01f7e7 72
313aa567
FB
73/* vga.c */
74
75#define VGA_RAM_SIZE (8192 * 1024)
76
77typedef struct DisplayState {
78 uint8_t *data;
79 int linesize;
80 int depth;
81 void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h);
82 void (*dpy_resize)(struct DisplayState *s, int w, int h);
83 void (*dpy_refresh)(struct DisplayState *s);
84} DisplayState;
85
86static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
87{
88 s->dpy_update(s, x, y, w, h);
89}
90
91static inline void dpy_resize(DisplayState *s, int w, int h)
92{
93 s->dpy_resize(s, w, h);
94}
95
96int vga_init(DisplayState *ds, uint8_t *vga_ram_base,
97 unsigned long vga_ram_offset, int vga_ram_size);
98void vga_update_display(void);
99
100/* sdl.c */
101void sdl_display_init(DisplayState *ds);
102
5391d806
FB
103/* ide.c */
104#define MAX_DISKS 4
105
106extern BlockDriverState *bs_table[MAX_DISKS];
107
108void ide_init(void);
109void ide_set_geometry(int n, int cyls, int heads, int secs);
110void ide_set_cdrom(int n, int is_cdrom);
111
27503323
FB
112/* oss.c */
113typedef enum {
114 AUD_FMT_U8,
115 AUD_FMT_S8,
116 AUD_FMT_U16,
117 AUD_FMT_S16
118} audfmt_e;
119
120void AUD_open (int rfreq, int rnchannels, audfmt_e rfmt);
121void AUD_reset (int rfreq, int rnchannels, audfmt_e rfmt);
122int AUD_write (void *in_buf, int size);
123void AUD_run (void);
124void AUD_adjust_estimate (int _leftover);
125int AUD_get_free (void);
126int AUD_get_live (void);
127int AUD_get_buffer_size (void);
128void AUD_init (void);
129
130/* dma.c */
131typedef int (*DMA_read_handler) (uint32_t addr, int size, int *irq);
132typedef int (*DMA_misc_handler) (int);
133
134int DMA_get_channel_mode (int nchan);
135void DMA_hold_DREQ (int nchan);
136void DMA_release_DREQ (int nchan);
137void DMA_run (void);
138void DMA_init (void);
139void DMA_register_channel (int nchan,
140 DMA_read_handler read_handler,
141 DMA_misc_handler misc_handler);
142
143/* sb16.c */
144void SB16_run (void);
145void SB16_init (void);
146
fc01f7e7 147#endif /* VL_H */