Re: Interrupt issue on m68k platform and some fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




No, it isn't.  It is equivalent to
*(long *)((char *)&current_thread_info()->preempt_count + 1) += 1
which is of course completely bogus.
Sorry, I think I paste the redundant character for the codes (no '*'
char at front or end of addql and subql instruction)
I paste it again:

ENTRY(inthandler)
SAVE_ALL_INT
GET_CURRENT(%d0)
addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
/* put exception # in d0 */
movel %sp@(PT_VECTOR),%d0
swap %d0 /* extract bits 25:18 */
lsrl #2,%d0
andl #0x0ff,%d0

movel %sp,%sp@-
movel %d0,%sp@- /* put vector # on stack */
auto_irqhandler_fixup = . + 2
jbsr process_int /* process the IRQ */
addql #8,%sp /* pop parameters off stack */
ret_from_interrupt:

subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
jeq ret_from_last_interrupt
2: RESTORE_ALL

ALIGN
ret_from_last_interrupt:
moveb %sp@(PT_SR),%d0
andl #(~ALLOWINT>>8)&0xff,%d0
jne 2b

/* check if we need to do software interrupts */
tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING
jeq .Lret_from_exception
pea ret_from_exception
jra do_softirq

For code "addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)",
My understanding is that
%curptr@(TASK_INFO+TINFO_PREEMPT) is the address of
current_thread_info()->preempt_count, and
%curptr@(TASK_INFO+TINFO_PREEMPT+1) point to the second byte of
preempt_count field (preempt_count field is 4 bytes).

So this code sets value 1 to the second byte of preempt_count field.

HARDIRQ_OFFSET equals (1 << HARDIRQ_SHIT) , and HARDIRQ_SHIFT value is
16, so I think this code equals
current_thread_info()->preempt_count += HARDIRQ_OFFSET

Am I wrong?

Regards,
Lanttor




------------------------------------------------------------------------
*From:* Andreas Schwab <schwab@xxxxxxxxxxxxxx>
*Sent:* 07/02/2009 4:24:35 PM +0800
*To:* Lanttor <lanttor.guo@xxxxxxxxxxxxx>
*CC:* linux-m68k@xxxxxxxxxxxxxxx, uClinux development list
<uclinux-dev@xxxxxxxxxxx>
*Subject:* Interrupt issue on m68k platform and some fix

Lanttor <lanttor.guo@xxxxxxxxxxxxx> writes:

  
My understanding of "*addql   #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)*"
is that its meaning is equal to
"current_thread_info()->preempt_count += HARDIRQ_OFFSET",
    

No, it isn't.  It is equivalent to
*(long *)((char *)&current_thread_info()->preempt_count + 1) += 1
which is of course completely bogus.

Andreas.

  
--
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

[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux