qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: takasi-y@ops.dti.ne.jp
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] SH: Improve the interrupt controller
Date: Thu, 12 Feb 2009 14:05:33 +0300	[thread overview]
Message-ID: <200902121405.34112.vladimir@codesourcery.com> (raw)
In-Reply-To: <200902081857.n18IvPqn004534@smtp09.dti.ne.jp>

On Sunday 08 February 2009 21:57:25 takasi-y@ops.dti.ne.jp wrote:
> Hi, Vladimir.
> 
> I managed to make the code working.
> r2d boot, SCI and CF working, and /proc/interrupts increases.
> 
> Essential points modified are below.
> 1. sh_intc_init() caller/callee mismatch.
> 2. nobody calls sh_intc_set_irl_priorities()
> 3. INTC_MODE_DUAL_SET/CLR swapped
> I'm not sure 3 in your patch is on purpose or not.
> 
> Attached patch is a diff against rev#6563.
> This is yours + my small fixes, which are..
> - Above three
> - sh_intc_set_irl_priorities() has switched to sh_intc_init_irl_priorities().
> - sh_intc_set_irl()'s enable hack removed.
> - indent,tab/space,brace changed (to what looks like code around)
> - reduce INTC_A7() usage
> - some others.

Hi Yoshii,
I have replaced my original patch with your patch in my patch set, and adjusted
sh7785 emulation for your changes. It works, but only after I re-do the
INTC_MODE_DUAL_SET/CLR swap form my original patch. I think that's about right.
Suppose you set a bit in SET register, the interrupt then should be masked out.
Here's the relevant code:

	 case INTC_MODE_DUAL_SET: value = *valuep & ~value; break;

This clears the relevant bit in 'value', and then:

	sh_intc_toggle_mask(desc, enum_ids[k], value & mask, priority, 0);

this passes '0' for 'enable' parameter to sh_intc_toggle_mask, like it should.

However, unless I miss something, it seems like the value read from a register
is actually inverted. When reading from a set register we should get 1 for each
masked register, and we seem to get 1 for each enabled register. If you agree
with this analysis, I can adjust the read function.

But probably, it's best if your combined patch is checked in -- as I've said
I get a working sh4a emulation based on your patch, and it's problematic
to keep such big patches outside the official tree.

- Volodya

  reply	other threads:[~2009-02-12 11:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 19:52 [Qemu-devel] SH: Improve the interrupt controller Vladimir Prus
2008-12-11 21:16 ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-12  5:48   ` [Qemu-devel] " Vladimir Prus
2008-12-14 16:46 ` [Qemu-devel] " takasi-y
2008-12-14 16:57   ` Vladimir Prus
2009-01-26 13:32     ` Vladimir Prus
2009-01-26 23:51       ` Shin-ichiro KAWASAKI
2009-02-04 16:40       ` takasi-y
2009-02-08 18:57         ` takasi-y
2009-02-12 11:05           ` Vladimir Prus [this message]
2009-02-17 18:32             ` takasi-y
2009-02-19 19:57               ` Vladimir Prus
2009-03-13 17:50                 ` takasi-y
2009-03-13 18:32                   ` Vladimir Prus
2009-03-19 17:17                     ` takasi-y
2009-03-19 17:31                       ` Vladimir Prus
2009-02-20  3:06             ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-20  5:16               ` Vladimir Prus
2009-02-20  5:32                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-20  5:58                   ` Vladimir Prus
2009-02-20  5:59                     ` Jean-Christophe PLAGNIOL-VILLARD

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=200902121405.34112.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=takasi-y@ops.dti.ne.jp \
    /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).