Welcome, Guest. Please login or register.

Author Topic: double INTREQ write?  (Read 965 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline darkcoderTopic starter

  • Full Member
  • ***
  • Join Date: Sep 2002
  • Posts: 164
    • Show only replies by darkcoder
double INTREQ write?
« on: June 11, 2004, 03:14:15 PM »
Hello

 From time to time I see someone reporting that the interrupt handler routines, before exiting,
 should write TWICE the register INTREQ to clear the interrupt request. Otherwise with 040/060 system
 interrupts are executed twice.

Example

InterruptLevel3

  move.l xxx,BPL1PT

  ...

  move #$0020,INTREQ
  move #$0020,INTREQ
  rte

 This solution of does work, but on my 040 other, more elegant solutions work too: for example it is enough
to execute a NOP before the RTE, since the NOP force the CPU to actually perform the write to the register
before executing the RTE (040 and 060 can defer the actual write to memory after performing other instructions
in the pipeline). Onother solution that work is to simply read a value from memory after the write to INTREQ.

So, in my programs I always use:

InterruptLevel3

  move.l xxx,BPL1PT

  ...

  move #$0020,INTREQ
  NOP
  rte

However recently I saw the source code for "The Player" P6.1.3 use BOTH the double write to INTENA AND the NOP.

So I wonder, is there some strange configuration where the double INTENA write is really needed?
And if yes, can you explain me why?

The Dark Coder
The Dark Coder / Trinity
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: double INTREQ write?
« Reply #1 on: June 11, 2004, 03:48:28 PM »
Quote
So I wonder, is there some strange configuration where the double INTENA write is really needed?

I would say no.

Probably this is just coder paranoia, to make absolutely sure it works. :-)
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: double INTREQ write?
« Reply #2 on: June 11, 2004, 03:53:02 PM »
Didn't Dave Haynie say something about the 040 holds the bus longer than it says it does and so weird things happen... Ok my mind is fuzzy... Please ignore me :-(

Offline xeron

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2533
    • Show only replies by xeron
    • http://www.petergordon.org.uk
Re: double INTREQ write?
« Reply #3 on: June 11, 2004, 06:34:15 PM »
Writing it twice is a proven, definate, 100% working solution. Why change something that works?
Playstation Network ID: xeron6
 

Offline darkcoderTopic starter

  • Full Member
  • ***
  • Join Date: Sep 2002
  • Posts: 164
    • Show only replies by darkcoder
Re: double INTREQ write?
« Reply #4 on: June 14, 2004, 04:23:21 PM »
because the aim is the knowledge and to have fun developing!
;-)

Please don't accept the evil (M$) logic to care only about being productive: that's a philosophy that brings you to the Gates!!
:-)

The Dark Coder
The Dark Coder / Trinity
 

Offline JKD

  • Sr. Member
  • ****
  • Join Date: Aug 2002
  • Posts: 287
    • Show only replies by JKD
Re: double INTREQ write?
« Reply #5 on: June 14, 2004, 05:23:54 PM »
Because it's entirely bizarre behaviour.

An Interrupt register should generate an interrupt every time it's written no? (Well, according to the pattern of bits of course..)

Very odd, sounds like a bug to me :D