提交 7d977de7 编写于 作者: B bellard

io port API change


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@661 c046a42c-6fe2-441c-8c8c-71466251a162
上级 07d89866
...@@ -78,7 +78,7 @@ enum { ...@@ -78,7 +78,7 @@ enum {
}; };
static void write_page (CPUState *env, uint32_t nport, uint32_t data) static void write_page (void *opaque, uint32_t nport, uint32_t data)
{ {
int ichan; int ichan;
int ncont; int ncont;
...@@ -113,7 +113,7 @@ static inline int getff (int ncont) ...@@ -113,7 +113,7 @@ static inline int getff (int ncont)
return ff; return ff;
} }
static uint32_t read_chan (CPUState *env, uint32_t nport) static uint32_t read_chan (void *opaque, uint32_t nport)
{ {
int ff; int ff;
int ncont, ichan, nreg; int ncont, ichan, nreg;
...@@ -135,7 +135,7 @@ static uint32_t read_chan (CPUState *env, uint32_t nport) ...@@ -135,7 +135,7 @@ static uint32_t read_chan (CPUState *env, uint32_t nport)
return (val >> (ncont + (ff << 3))) & 0xff; return (val >> (ncont + (ff << 3))) & 0xff;
} }
static void write_chan (CPUState *env, uint32_t nport, uint32_t data) static void write_chan (void *opaque, uint32_t nport, uint32_t data)
{ {
int ncont, ichan, nreg; int ncont, ichan, nreg;
struct dma_regs *r; struct dma_regs *r;
...@@ -153,7 +153,7 @@ static void write_chan (CPUState *env, uint32_t nport, uint32_t data) ...@@ -153,7 +153,7 @@ static void write_chan (CPUState *env, uint32_t nport, uint32_t data)
} }
} }
static void write_cont (CPUState *env, uint32_t nport, uint32_t data) static void write_cont (void *opaque, uint32_t nport, uint32_t data)
{ {
int iport, ichan, ncont; int iport, ichan, ncont;
struct dma_cont *d; struct dma_cont *d;
...@@ -345,22 +345,22 @@ void DMA_init (void) ...@@ -345,22 +345,22 @@ void DMA_init (void)
int page_port_list[] = { 0x1, 0x2, 0x3, 0x7 }; int page_port_list[] = { 0x1, 0x2, 0x3, 0x7 };
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
register_ioport_write (i, 1, write_chan, 1); register_ioport_write (i, 1, 1, write_chan, NULL);
register_ioport_write (0xc0 + (i << 1), 1, write_chan, 1); register_ioport_write (0xc0 + (i << 1), 1, 1, write_chan, NULL);
register_ioport_read (i, 1, read_chan, 1); register_ioport_read (i, 1, 1, read_chan, NULL);
register_ioport_read (0xc0 + (i << 1), 1, read_chan, 1); register_ioport_read (0xc0 + (i << 1), 1, 1, read_chan, NULL);
} }
for (i = 0; i < LENOFA (page_port_list); i++) { for (i = 0; i < LENOFA (page_port_list); i++) {
register_ioport_write (page_port_list[i] + 0x80, 1, write_page, 1); register_ioport_write (page_port_list[i] + 0x80, 1, 1, write_page, NULL);
register_ioport_write (page_port_list[i] + 0x88, 1, write_page, 1); register_ioport_write (page_port_list[i] + 0x88, 1, 1, write_page, NULL);
} }
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
register_ioport_write (i + 8, 1, write_cont, 1); register_ioport_write (i + 8, 1, 1, write_cont, NULL);
register_ioport_write (0xd0 + (i << 1), 1, write_cont, 1); register_ioport_write (0xd0 + (i << 1), 1, 1, write_cont, NULL);
} }
write_cont (NULL, 0x0d, 0); write_cont (NULL, 0x0d, 0);
......
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
#endif #endif
#define IO_READ_PROTO(name) \ #define IO_READ_PROTO(name) \
uint32_t name (struct CPUState *env, uint32_t nport) uint32_t name (void *opaque, uint32_t nport)
#define IO_WRITE_PROTO(name) \ #define IO_WRITE_PROTO(name) \
void name (struct CPUState *env, uint32_t nport, uint32_t val) void name (void *opaque, uint32_t nport, uint32_t val)
static struct { static struct {
int ver_lo; int ver_lo;
...@@ -550,8 +550,8 @@ static IO_WRITE_PROTO(mixer_write_datab) ...@@ -550,8 +550,8 @@ static IO_WRITE_PROTO(mixer_write_datab)
static IO_WRITE_PROTO(mixer_write_indexw) static IO_WRITE_PROTO(mixer_write_indexw)
{ {
mixer_write_indexb (env, nport, val & 0xff); mixer_write_indexb (opaque, nport, val & 0xff);
mixer_write_datab (env, nport, (val >> 8) & 0xff); mixer_write_datab (opaque, nport, (val >> 8) & 0xff);
} }
static IO_READ_PROTO(mixer_read) static IO_READ_PROTO(mixer_read)
...@@ -718,17 +718,17 @@ void SB16_init (void) ...@@ -718,17 +718,17 @@ void SB16_init (void)
} }
for (i = 0; i < LENOFA (dsp_write_ports); i++) { for (i = 0; i < LENOFA (dsp_write_ports); i++) {
register_ioport_write (sb.port + dsp_write_ports[i], 1, dsp_write, 1); register_ioport_write (sb.port + dsp_write_ports[i], 1, 1, dsp_write, NULL);
} }
for (i = 0; i < LENOFA (dsp_read_ports); i++) { for (i = 0; i < LENOFA (dsp_read_ports); i++) {
register_ioport_read (sb.port + dsp_read_ports[i], 1, dsp_read, 1); register_ioport_read (sb.port + dsp_read_ports[i], 1, 1, dsp_read, NULL);
} }
register_ioport_write (sb.port + 0x4, 1, mixer_write_indexb, 1); register_ioport_write (sb.port + 0x4, 1, 1, mixer_write_indexb, NULL);
register_ioport_write (sb.port + 0x4, 1, mixer_write_indexw, 2); register_ioport_write (sb.port + 0x4, 1, 2, mixer_write_indexw, NULL);
register_ioport_read (sb.port + 0x5, 1, mixer_read, 1); register_ioport_read (sb.port + 0x5, 1, 1, mixer_read, NULL);
register_ioport_write (sb.port + 0x5, 1, mixer_write_datab, 1); register_ioport_write (sb.port + 0x5, 1, 1, mixer_write_datab, NULL);
DMA_register_channel (sb.hdma, SB_read_DMA, NULL); DMA_register_channel (sb.hdma, SB_read_DMA, NULL);
DMA_register_channel (sb.dma, SB_read_DMA, NULL); DMA_register_channel (sb.dma, SB_read_DMA, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册