From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] sh4: mmio based CF support on r2d board.
Date: Sun, 26 Oct 2008 17:54:08 +0200 [thread overview]
Message-ID: <f43fc5580810260854q41264525xdaf9199686d9dcb8@mail.gmail.com> (raw)
In-Reply-To: <200810261517.m9QFHUR4026096@smtp12.dti.ne.jp>
On 10/26/08, takasi-y@ops.dti.ne.jp <takasi-y@ops.dti.ne.jp> wrote:
> This patch adds emulation for a CompactFlash on sh4/r2d board.
> The device is CF, but wired to be worked as True-IDE mode, and connected
> directly to SH bus. So, this code is to supports generally mmio based IDEs
> which are supported by "pata_platform" driver in linux kernel.
+ if(addr & 7)
I'd add a space between if and (.
+static uint32_t mmio_ide_status_read (void *opaque,target_phys_addr_t addr)
Please add a space between the comma after opaque and target_phys_addr_t.
> +void mmio_ide_init (int *mmio, BlockDriverState *hd0, BlockDriverState *hd1,
> + qemu_irq irq, int shift)
> +{
> + MMIOState *s = qemu_mallocz(sizeof(MMIOState));
> + IDEState *ide = qemu_mallocz(sizeof(IDEState) * 2);
> + int *io;
> +
> + ide_init2(ide, hd0, hd1, irq);
> +
> + s->dev = ide;
> + s->shift = shift;
> +
> + mmio[0] = cpu_register_io_memory(0, mmio_ide_reads, mmio_ide_writes, s);
> + mmio[1] = cpu_register_io_memory(0, mmio_ide_status, mmio_ide_cmd, s);
> +}
It would be better to make the init function take instead of mmio
pointer, two target_phys_addr_t parameters and do the physical memory
registration there.
> + extern void mmio_ide_init (int*, BlockDriverState*, BlockDriverState*,
> + qemu_irq, int);
This should be in a .h file (maybe pc.h), without "extern" and the
parameter names should be included.
Otherwise, the whole patch looks OK.
next prev parent reply other threads:[~2008-10-26 15:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 16:31 [Qemu-devel] [PATCH] sh4: mmio based CF support on r2d board yoshii.takashi
2008-09-22 19:00 ` takasi-y
2008-09-23 8:55 ` Paul Mundt
2008-10-08 15:20 ` pmac kernel & disk image wanted (was Re: [Qemu-devel] [PATCH] sh4: mmio based CF support on r2d board.) Shin-ichiro KAWASAKI
2008-10-26 15:35 ` Andreas Färber
2008-10-26 15:17 ` [Qemu-devel] [PATCH 1/3] sh4: mmio based CF support on r2d board takasi-y
2008-10-26 15:54 ` Blue Swirl [this message]
2008-10-27 1:29 ` andrzej zaborowski
2008-10-27 17:10 ` Blue Swirl
2008-10-29 14:22 ` andrzej zaborowski
2008-10-29 18:37 ` Blue Swirl
2008-10-27 18:57 ` takasi-y
2008-10-27 19:12 ` Blue Swirl
2008-10-28 20:58 ` [Qemu-devel] [PATCH 1/3] take3 " takasi-y
2008-10-26 15:17 ` [Qemu-devel] [PATCH 0/3] take 2. " takasi-y
2008-10-26 15:17 ` [Qemu-devel] [PATCH 2/3] sh4: Add IRL(4bit encoded interrupt input) support takasi-y
2008-10-26 16:09 ` Blue Swirl
2008-10-28 20:58 ` [Qemu-devel] [PATCH 2/3] take3 " takasi-y
2008-10-29 18:09 ` [Qemu-devel] " Blue Swirl
2008-10-30 17:28 ` takasi-y
2008-10-26 15:17 ` [Qemu-devel] [PATCH 3/3] sh4: Add r2d onboard FPGA IRQ controller takasi-y
2008-10-28 20:58 ` [Qemu-devel] [PATCH 3/3] take3 " takasi-y
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f43fc5580810260854q41264525xdaf9199686d9dcb8@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).