public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Robert Shideleff <bigbob@shideleff.com>
To: sid@sources.redhat.com
Subject: Re: Level sensitive ARM interrupts
Date: Fri, 02 Jul 2004 18:39:00 -0000	[thread overview]
Message-ID: <200407021439.08654.bigbob@shideleff.com> (raw)
In-Reply-To: <200407021437.35768.bigbob@shideleff.com>

[-- Attachment #1: Type: Text/Plain, Size: 831 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Forgot the attachment. (as usual)

On Friday 02 July 2004 02:37 pm, Robert Shideleff wrote:
> This patch makes arm interrupts level sensitive, as they are in hardware.
> The nirq and nfiq pins are no longer callbacks, but rather simple input
> pins. They are 'pulled' to high at processor invocation and reset. Their
> level is 'sense()-ed' at the beginning of each step.
>
> The patch file was taken from within the sid/component/cgen-cpu/arm7t
> directory.
>
> This is necessary for proper operation of eCos, and for the ability to
> model interrupts as they occur in actual hardware.
>
> Bob
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA5avL8XjOGQDr37YRAjdcAKCBC6DmWAQ3ImhwCbFvc+Aj/vPAdgCfe19r
TTOx2egnP+V7AyeCGB90/U0=
=SlWB
-----END PGP SIGNATURE-----

[-- Attachment #2: sid-arm7t.diff --]
[-- Type: text/x-diff, Size: 5193 bytes --]

Index: arm7f.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/arm7f.cxx,v
retrieving revision 1.3
diff -u -r1.3 arm7f.cxx
--- arm7f.cxx	28 Jun 2001 21:52:56 -0000	1.3
+++ arm7f.cxx	2 Jul 2004 18:34:26 -0000
@@ -17,8 +17,6 @@
 arm7f_cpu::arm7f_cpu ():
   arm_engine (32768),   // XXX: tune size
   thumb_engine (32768), // XXX: tune size
-  nfiq_pin (this, & arm7f_cpu::do_nfiq_pin),
-  nirq_pin (this, & arm7f_cpu::do_nirq_pin),
   initialized_p (false)
 {
   // ??? One might want to quibble over the case of these pins (nFIQ?).
@@ -87,6 +85,10 @@
 
   // Add register access for debugger
   this->create_gdb_register_attrs (26, "7;11;13;14;15;25", & this->hardware.h_pc);
+
+  // These need to be 'pulled' high if they are not connected.
+  nirq_pin.driven(1);
+  nfiq_pin.driven(1);
 }
 
 string
@@ -168,6 +170,10 @@
   this->initialized_p = true;
 
   this->triggerpoint_manager.check_and_dispatch ();
+
+  // These need to be 'pulled' high if they are not connected.
+  nirq_pin.driven(1);
+  nfiq_pin.driven(1);
 }
 
 
@@ -182,6 +188,18 @@
       return;
     }
 
+  // Check for currently asserted interrupt pins. Interrupts are only checked for at each
+  // step size block of instructions.
+  if(!this->h_fbit_get() && !nfiq_pin.sense())
+    queue_eit (EIT_FIQ);
+ 
+  if(!this->h_ibit_get() && !nirq_pin.sense())
+    queue_eit (EIT_IRQ);
+
+  // If an eit is queued, process it now.
+  if (this->pending_eit != EIT_NONE)
+    this->process_eit (this->pending_eit);
+
   if (this->engine_type == ENGINE_PBB)
     {
       if (this->h_tbit_get ())
@@ -412,10 +430,6 @@
 {
   assert (! this->h_tbit_get ());
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   while (true)
     {
       // Fetch/decode the instruction  ------------------------------
@@ -482,10 +496,6 @@
 {
   assert (this->h_tbit_get ());
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   while (true)
     {
       // Fetch/decode the instruction  ------------------------------
@@ -553,10 +563,6 @@
       || this->enable_step_trap_p)
     return this->step_arm ();
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   try
     {
       // This function takes care of step_insn_count.
@@ -583,10 +589,6 @@
       || this->enable_step_trap_p)
     return this->step_thumb ();
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   try
     {
       // This function takes care of step_insn_count.
@@ -961,46 +963,6 @@
 \f
 // EIT (exception, interrupt, and trap) pins.
 
-void
-arm7f_cpu::do_nfiq_pin (host_int_4 value)
-{
-  // FIXME: Should be able to catch high-low transition but can't do
-  // that with callback_pin.
-  //if (nfiq_pin.sense () == value)
-  //  return;
-  if (value)
-    return;
-
-  // nFIQ has been driven low.
-
-  // Are FIQ interrupts disabled?
-  if (this->h_fbit_get ())
-    return;
-
-  // Queue the interrupt.
-  this->queue_eit (EIT_FIQ);
-}
-
-void
-arm7f_cpu::do_nirq_pin (host_int_4 value)
-{
-  // FIXME: Should be able to catch high-low transition but can't do
-  // that with callback_pin.
-  //if (nirq_pin.sense () == value)
-  //  return;
-  if (value)
-    return;
-
-  // nIRQ has been driven low.
-
-  // Are IRQ interrupts disabled?
-  if (this->h_ibit_get ())
-    return;
-
-  // Queue the interrupt.
-  this->queue_eit (EIT_IRQ);
-}
-
 \f
 // Miscellaneous pins.
 
Index: arm7f.h
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/arm7f.h,v
retrieving revision 1.3
diff -u -r1.3 arm7f.h
--- arm7f.h	8 Jan 2003 03:17:27 -0000	1.3
+++ arm7f.h	2 Jul 2004 18:34:26 -0000
@@ -158,10 +158,8 @@
   // FIQ/IRQ are generated by driving these pins (low).
   // It is synchronous if ISYNC is high, asynchronous if ISYNC is low.
   // If asynchronous, a cycle delay for synchronization is incurred.
-  callback_pin<arm7f_cpu> nfiq_pin;
-  void do_nfiq_pin (host_int_4 value);
-  callback_pin<arm7f_cpu> nirq_pin;
-  void do_nirq_pin (host_int_4 value);
+  input_pin nfiq_pin;
+  input_pin nirq_pin;
 
   // cpu is reset by driving this pin low
 #if 0
Index: hw-cpu-arm7t.xml
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/hw-cpu-arm7t.xml,v
retrieving revision 1.1
diff -u -r1.1 hw-cpu-arm7t.xml
--- hw-cpu-arm7t.xml	3 Aug 2001 01:47:52 -0000	1.1
+++ hw-cpu-arm7t.xml	2 Jul 2004 18:34:26 -0000
@@ -56,7 +56,9 @@
       <pin>step!</pin> pin is next invoked.  Note that this may not be
       the next instruction if the
       <attribute>step-insn-count</attribute> attribute is greater than
-      one.</p>
+      one. Also note that these pins are level sensitive, so interrupts
+      will occur repeatedly until the pin is driven non-zero. They are
+      'pulled' to one (high) at processor invocation and reset.</p>
     </behavior>
 
 

  reply	other threads:[~2004-07-02 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-02 18:37 Robert Shideleff
2004-07-02 18:39 ` Robert Shideleff [this message]
2004-07-05  0:27   ` Ben Elliston
     [not found] ` <200407141850.05451.bigbob@shideleff.com>
     [not found]   ` <20040804023021.GA16871@redhat.com>
     [not found]     ` <200408041117.50677.bigbob@shideleff.com>
2004-08-04 15:43       ` Frank Ch. Eigler

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=200407021439.08654.bigbob@shideleff.com \
    --to=bigbob@shideleff.com \
    --cc=sid@sources.redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).