public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Lanttor <lanttor.guo@freescale.com>
To: Roman Hodek <roman@hodek.net>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	linux-m68k@vger.kernel.org, uclinux-dev@uclinux.org
Subject: Re: Interrupt issue on m68k platform and some fix
Date: Fri, 03 Jul 2009 11:18:37 +0800	[thread overview]
Message-ID: <4A4D788D.6010007@freescale.com> (raw)
In-Reply-To: <20090702202532.DFD1A7BF89@ridcully.hodek.net>

>
> and 1<<16 == 0x00010000, so correct would be
>
>   addl #0x00010000,%curptr@(TASK_INFO+TINFO_PREEMPT)
>
> And this can be optimized to add 1 to the high word:
>
>   addqw #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2)
I checked the "Coldfire family programmer's Reference" and find that it
indeed does not support addqw and addqb instruction, it only support
addql instruction. And addl instruction can not be used for immediate data.

I guess coldfire instruction are not compatible m68k instruction.

So I need implement the function you mentioned above like this:

        movel   %curptr@(TASK_INFO+TINFO_PREEMPT),%d3
        addil   #0x10000,%d3
        movel   %d3,%curptr@(TASK_INFO+TINFO_PREEMPT)

I test it and it could work.

The other way to replace it is what I mentioned before: use irq_enter()
and irq_exit(), they take the same function.

> Really? The addq instructions are contained in all kind of code, I
> guess...
coldfire instruction are not compatible m68k instruction, so some m68k
kernel assembly code can not be used in coldfire platform directly.

Thanks,

Best Regards,
Lanttor




------------------------------------------------------------------------
*From:* roman@hodek.net (Roman Hodek)
*Sent:* 07/03/2009 4:25:32 AM +0800
*To:* Andreas Schwab <schwab@linux-m68k.org>
*CC:* lanttor.guo@freescale.com, linux-m68k@vger.kernel.org,
uclinux-dev@uclinux.org
*Subject:* Interrupt issue on m68k platform and some fix

>>> So this code sets value 1 to the second byte of preempt_count field.
>>>       
>> No.  Byte would be addqb.
>>     
>
> Yep ;) But that's also not what's intended, I think.
>
> Lanttor says he wants to add HARDIRQ_OFFSET:
>
>   
>> HARDIRQ_OFFSET equals (1 << HARDIRQ_SHIT) , and HARDIRQ_SHIFT value is
>> 16, so I think this code equals
>>     
>
> and 1<<16 == 0x00010000, so correct would be
>
>   addl #0x00010000,%curptr@(TASK_INFO+TINFO_PREEMPT)
>
> And this can be optimized to add 1 to the high word:
>
>   addqw #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2)
>
> As 1 is small enough, you can use an addq statement, and the offset to
> the memory location is 2.
>
> The originally proposed "addlq #1, %curptr@(TASK_INFO+TINFO_PREEMPT+1)"
> is misaligned and would case an exception. And "addlb #1,
> %curptr@(TASK_INFO+TINFO_PREEMPT+1)" wouldn't yield the correct value
> as long if the byte overflows ;)
>
>   
>> addqb instruction is not supported on coldfire platform.
>>     
>
> Really? The addq instructions are contained in all kind of code, I
> guess...
>
> Roman
>
> PS: Hi Andreas! It's quite some years ago, isn't it? ;)
>
>   

      reply	other threads:[~2009-07-03  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02  4:07 Interrupt issue on m68k platform and some fix Lanttor
2009-07-02  8:24 ` Andreas Schwab
2009-07-02  8:58   ` Lanttor
2009-07-02  9:05     ` Andreas Schwab
2009-07-02 10:06       ` Lanttor
2009-07-02 20:25       ` Roman Hodek
2009-07-03  3:18         ` Lanttor [this message]

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=4A4D788D.6010007@freescale.com \
    --to=lanttor.guo@freescale.com \
    --cc=linux-m68k@vger.kernel.org \
    --cc=roman@hodek.net \
    --cc=schwab@linux-m68k.org \
    --cc=uclinux-dev@uclinux.org \
    /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