[Top] [All Lists]

Re: power management status for au1100

To: Dan Malek <>
Subject: Re: power management status for au1100
From: Rodolfo Giometti <>
Date: Sat, 16 Jul 2005 17:19:50 +0200
In-reply-to: <>
Organization: Programmi e soluzioni GNU/Linux
Original-recipient: rfc822;
References: <> <> <>
User-agent: Mutt/1.5.6+20040722i
Looking function mips_timer_interrupt() (which is the normal timer
interrupt when PM is not enabled) I noticed that it has called from
file «arch/mips/au1000/common/int-handler.S» as follow:

        .set    macro
        .set    noat
        .align  5

NESTED(au1000_IRQ, PT_SIZE, sp)
        CLI                             # Important: mark KERNEL mode !

        mfc0    t0,CP0_CAUSE            # get pending interrupts
        mfc0    t1,CP0_STATUS           # get enabled interrupts
        and     t0,t1                   # isolate allowed ones

        andi    t0,0xff00               # isolate pending bits
        beqz    t0, 3f                  # spurious interrupt

        andi    a0, t0, CAUSEF_IP7
        beq     a0, zero, 1f
        move    a0, sp
        jal     mips_timer_interrupt
        j       ret_from_irq

Looking at «CLI» implementation into «include/asm/stackframe.h»:

    * Move to kernel mode and disable interrupts.
    * Set cp0 enable bit as sign that we're running on the kernel stack
                   .macro  CLI
                   mfc0    t0, CP0_STATUS
                   li      t1, ST0_CU0 | 0x1f
                   or      t0, t1
                   xori    t0, 0x1f
                   mtc0    t0, CP0_STATUS

I see that the CLI macro ensures that mips_timer_interrupt() will be
executed into «kernel mode».

What do you think about that? Can it cause the error «Break
instruction in kernel code in arch/mips/kernel/traps.c::do_bp, line

If so, can someone help me in fixing such bug? I'm not a MIPS assembly
master! ;-p




GNU/Linux Solutions                  e-mail:
Linux Device Driver                   
Embedded Systems                     home page:
UNIX programming                     phone:     +39 349 2432127

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>