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@xxxxxxxxx (Roman Hodek)
*Sent:* 07/03/2009 4:25:32 AM +0800
*To:* Andreas Schwab <schwab@xxxxxxxxxxxxxx>
*CC:* lanttor.guo@xxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx,
uclinux-dev@xxxxxxxxxxx
*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? ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html