All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Joshua Juran <jjuran@gmail.com>,
	Matthias Reis <matthias.reis@physik.tu-berlin.de>,
	linux-m68k@vger.kernel.org
Subject: Re: Autovector exceptions on Atari ST
Date: Thu, 25 Aug 2011 21:38:11 +1000	[thread overview]
Message-ID: <4E563423.8090003@snapgear.com> (raw)
In-Reply-To: <CAMuHMdWOD_CC7RC5ByJB9k9qGueMS+c2CQZn-Tr+nPsrM+-+-w@mail.gmail.com>

On 25/08/11 18:13, Geert Uytterhoeven wrote:
> On Thu, Aug 25, 2011 at 03:51, Joshua Juran<jjuran@gmail.com>  wrote:
>> On Aug 24, 2011, at 12:47 PM, Matthias Reis wrote:
>>
>>>> On Sun, Aug 7, 2011 at 23:09, Geert Uytterhoeven<geert@linux-m68k.org>
>>>> wrote:
>>>>
>>>> MFP interrupts are not autovector interrupts, but user vector interrupts.
>>>>
>>>> Sorry, I forgot about this: it may be a stack frame format issue,
>>>> which causes the kernel to
>>>> incorrectly identify the interrupt number.
>>>>
>>>> user_inthandler() in arch/m68k/kernel/entry_mm.S looks at the
>>>> PT_OFF_FORMATVEC
>>>> field in the stack frame to identify the interrupt source. I don't
>>>> know from memory
>>>> if the plain 68000 stores it there. For autovector interrupts, it
>>>> doesn't, that's why
>>>> I created inidividual auto*_inthandler() functions that put an hardcoded
>>>> number
>>>> on the stack instead of looking at the stack frame.
>>>
>>> thanks for your kind reply. As far as I understand the 68000 manual
>>> (http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf,
>>> section b.2), the CPU does not store the vector number on the exception
>>> stack. This is also what I've seen in the debugger: some seemingly bogus
>>> irq number is passed to m68k_handle_int. Any suggestions how to solve
>>> this? I guess it is not a good idea to write an individual
>>> user*_inthandler for each of the 255-64=191 possible user interrupts.
>>
>> It's not out of the question. áAlthough you wouldn't write 192 little
>> functions by hand -- just have stubs that push the vector number or offset
>> onto the stack and branch to another function, and generate the stub code at
>> runtime.
>
> And you only have to do it for the user interrupts you actually need/use.

That is pretty much what the code for the 68328 does.

   arch/m68k/platform/68328/entry.S

It has 8 handlers for the 8 real interrupts it can handle.

Regards
Greg


> I.e. m68k_setup_user_interrupt() could allocate the needed memory and fill
> it with the generated interrupt handlers.
> For Atari that's doable, for VME it would still generate all 192 of them.
> Alternatively, let m68k_irq_startup() handle it when it's called the
> first time for
> that specific interrupt.

  reply	other threads:[~2011-08-25 11:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 19:25 Support for MMU-less Atari ST Matthias Reis
2011-06-03  7:04 ` Greg Ungerer
2011-06-03  7:43   ` Geert Uytterhoeven
2011-06-04  9:14     ` Geert Uytterhoeven
2011-06-04 12:23       ` Matthias Reis
2011-08-07 20:57         ` Autovector exceptions on " Matthias Reis
2011-08-07 21:09           ` Geert Uytterhoeven
2011-08-23 18:22             ` Geert Uytterhoeven
2011-08-24 19:47               ` Matthias Reis
2011-08-25  1:51                 ` Joshua Juran
2011-08-25  8:13                   ` Geert Uytterhoeven
2011-08-25 11:38                     ` Greg Ungerer [this message]
2011-06-03 10:54   ` Support for MMU-less " Finn Thain

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=4E563423.8090003@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=geert@linux-m68k.org \
    --cc=jjuran@gmail.com \
    --cc=linux-m68k@vger.kernel.org \
    --cc=matthias.reis@physik.tu-berlin.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.