qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Zhi Yong Wu <zwu.kernel@gmail.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	陳韋任 <chenwj@iis.sinica.edu.tw>
Subject: Re: [Qemu-devel] IRQ number, interrupt number, interrupt line & GPIO[in/out]
Date: Sat, 3 Mar 2012 17:12:28 +0000	[thread overview]
Message-ID: <CAFEAcA8eGCK0iqpHVzRRsOBkNMBSzJeCgnBZw=g_rYRUfTUe_g@mail.gmail.com> (raw)
In-Reply-To: <CAEH94LiuSO6qgZVfqaF2B35NcH5SN2KPKe87Oqn+K9hskvcBYg@mail.gmail.com>

2012/3/3 Zhi Yong Wu <zwu.kernel@gmail.com>:
> thanks a lot for your help, they are very in theory.:). actually these
> concepts all exist in QEMU. I would like to know how they work
> together.

It's a mess. qemu_irq is the most fundamental data type we
use to model a general 'pin' or 'signal' line; despite the name
it can be used for other things besides interrupt lines, like
general purpose I/O. This is used by basically all devices.

The base class Device for all devices implemented using the
QEMU Object Model provides a number of qdev_* functions for
registering and manipulating input and output I/O lines,
eg qdev_get_gpio_in and qdev_connect_gpio_out. These are
written in terms of the basic qemu_irq type. Despite the
'gpio' name, you can use these for interrupt lines if you want.

The SysBus class (used for a lot of devices which are really
just trying to provide memory-mapped I/O and some interrupt
or signal lines) also provides an abstraction of qemu_irq
(functions sysbus_connect_irq(), sysbus_init_irq(), etc).
Again, there's no reason you can't use these for other
purposes than interrupts, although since every SysBus device
is also a Device, mostly by convention the sysbus abstraction
is used for the real outbound interrupt lines and the Device
gpio abstraction for everything else.

My opinion is that we should clean this up as part of properly
converting to the new object model. In particular SysBus should
just disappear and all Devices should be able to export named
input and output signals, which can be used for interrupts
or general I/O or whatever. Unfortunately we're probably
stuck with the incredibly badly named 'qemu_irq' type for the
rest of eternity...

-- PMM

  reply	other threads:[~2012-03-03 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 12:38 [Qemu-devel] IRQ number, interrupt number, interrupt line & GPIO[in/out] Zhi Yong Wu
2012-03-02 15:12 ` 陳韋任
2012-03-03  2:10   ` Zhi Yong Wu
2012-03-03 17:12     ` Peter Maydell [this message]
2012-03-04  3:30       ` Zhi Yong Wu
2012-03-02 16:01 ` Anthony Liguori
2012-03-02 16:41   ` Peter Maydell
2012-03-03  2:19     ` Zhi Yong Wu
2012-03-03  2:06   ` Zhi Yong Wu
2012-03-11 15:04 ` Shu Ming

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='CAFEAcA8eGCK0iqpHVzRRsOBkNMBSzJeCgnBZw=g_rYRUfTUe_g@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=chenwj@iis.sinica.edu.tw \
    --cc=qemu-devel@nongnu.org \
    --cc=zwu.kernel@gmail.com \
    /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).