From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5898] ETRAX-FS: Simplify the DMA blocks address registration and decoding.
Date: Sun, 07 Dec 2008 00:14:22 +0000 [thread overview]
Message-ID: <E1L97Hy-0007WV-Hv@cvs.savannah.gnu.org> (raw)
Revision: 5898
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5898
Author: edgar_igl
Date: 2008-12-07 00:14:21 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
ETRAX-FS: Simplify the DMA blocks address registration and decoding.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Modified Paths:
--------------
trunk/hw/etraxfs_dma.c
Modified: trunk/hw/etraxfs_dma.c
===================================================================
--- trunk/hw/etraxfs_dma.c 2008-12-06 23:19:03 UTC (rev 5897)
+++ trunk/hw/etraxfs_dma.c 2008-12-07 00:14:21 UTC (rev 5898)
@@ -165,11 +165,9 @@
struct fs_dma_channel
{
- int regmap;
qemu_irq *irq;
struct etraxfs_dma_client *client;
-
/* Internal status. */
int stream_cmd_src;
enum dma_ch_state state;
@@ -187,6 +185,7 @@
struct fs_dma_ctrl
{
+ int map;
CPUState *env;
int nr_channels;
@@ -570,9 +569,9 @@
int c;
uint32_t r = 0;
- /* Make addr relative to this instances base. */
+ /* Make addr relative to this channel and bounded to nr regs. */
c = fs_channel(addr);
- addr &= 0x1fff;
+ addr &= 0xff;
switch (addr)
{
case RW_STAT:
@@ -616,9 +615,9 @@
struct fs_dma_ctrl *ctrl = opaque;
int c;
- /* Make addr relative to this instances base. */
+ /* Make addr relative to this channel and bounded to nr regs. */
c = fs_channel(addr);
- addr &= 0x1fff;
+ addr &= 0xff;
switch (addr)
{
case RW_DATA:
@@ -744,7 +743,6 @@
target_phys_addr_t base, int nr_channels)
{
struct fs_dma_ctrl *ctrl = NULL;
- int i;
ctrl = qemu_mallocz(sizeof *ctrl);
if (!ctrl)
@@ -758,17 +756,8 @@
if (!ctrl->channels)
goto err;
- for (i = 0; i < nr_channels; i++)
- {
- ctrl->channels[i].regmap = cpu_register_io_memory(0,
- dma_read,
- dma_write,
- ctrl);
- cpu_register_physical_memory_offset (base + i * 0x2000,
- sizeof ctrl->channels[i].regs, ctrl->channels[i].regmap,
- i * 0x2000);
- }
-
+ ctrl->map = cpu_register_io_memory(0, dma_read, dma_write, ctrl);
+ cpu_register_physical_memory(base, nr_channels * 0x2000, ctrl->map);
return ctrl;
err:
qemu_free(ctrl->channels);
reply other threads:[~2008-12-07 0:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1L97Hy-0007WV-Hv@cvs.savannah.gnu.org \
--to=edgar.iglesias@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).