Skip to contentSkip to conversation

disable interrput under ppc?

DISCUSSION Scott Wood 3 participants 4 messages Sep 4, 2007 – Sep 5, 2007 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Scott Wood

author
#1 lore raw
Quoted 3 lines · Baojun

hi, list

How can I disable interrput like `cli' in x86?

local_irq_disable().

Quoted 3 lines

I want the following code freeze the box but it doesn't, $MSR is altered however the box is still alive, how can I freeze the box like `cli' in x86? Thanks very much!

Disabling interrupts doesn't freeze the machine by itself -- it depends on what you do afterwards, which you didn't show.

-Scott

#2 lore raw
Quoted 5 lines · On Tue, 4 Sep 2007 13:24:33 -0500 Scott Wood <[email protected]> wrote:
Quoted 3 lines · Baojun

hi, list

How can I disable interrput like `cli' in x86?

Quoted 8 lines

local_irq_disable().

Quoted 3 lines

I want the following code freeze the box but it doesn't, $MSR is altered however the box is still alive, how can I freeze the box like `cli' in x86? Thanks very much!

Disabling interrupts doesn't freeze the machine by itself -- it depends on what you do afterwards, which you didn't show.

If you're using a BOOKE variant, there is a way to use the DBCR0 register to set debug wait enable or something to basically hang the CPU until something external clears that bit. But why you would want to do that, I have no idea.

josh

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 16 lines · you

On Tue, 4 Sep 2007 13:24:33 -0500

Quoted 13 lines · Scott Wood
Quoted 3 lines · Baojun

hi, list

How can I disable interrput like `cli' in x86?

local_irq_disable().

Quoted 3 lines

I want the following code freeze the box but it doesn't, $MSR is altered however the box is still alive, how can I freeze the box like `cli' in x86? Thanks very much!

Disabling interrupts doesn't freeze the machine by itself -- it depends on what you do afterwards, which you didn't show.

I need to check whether the interrupt have been disabled already, so I'm expected after local_irq_disable() ( __asm__ __volatile__ ("wrteei 0": : :"memory) ), the machine is dead but it doesn't.

Quoted 4 lines

If you're using a BOOKE variant, there is a way to use the DBCR0 register to set debug wait enable or something to basically hang the CPU until something external clears that bit. But why you would want to do that, I have no idea.

Sorry, I just want to check whether disable_irq/enable_irq is functioning.

Quoted 1 line

josh

I'm not really getting confused about the following code:

// Executing all pending events
while ((event = get_next_set_bit_and_clear

          (pending, xm_root_domain -> events -> masked_events)) != -1) {
    // An event  pending when there  is not any  handler installed
    // catching it??? it must be an error
    //assert (xm_root_domain -> event_handler [event]);
    if (!xm_root_domain -> events -> event_handler [event]) continue;
      // Before executing an event handler, events' flag is disabled
      // and the event is masked

    printk(KERN_EMERG"sync_root_events: looping!\n");

    set_bit (xm_root_domain -> events -> masked_events, event);
    printk(KERN_EMERG"sync_root_events: looping 2!\n");
    disable_events_flag (xm_root_domain);
    printk(KERN_EMERG"sync_root_events: looping 3!\n");
    printk(KERN_EMERG"hw_irq_disabled?: %d\n", hw_irq_disabled());
    hw_enable_irq ();
    printk(KERN_EMERG"sync_root_events: looping 4!\n");
    // Here, the event handler is executed always
    // with the same conditions, that is, event flag disabled
    // and the executed event masked as well
    (*xm_root_domain -> events -> event_handler[event])
      (event, regs);
    printk(KERN_EMERG"sync_root_events: looping 5!\n");
    hw_disable_irq();
    printk(KERN_EMERG"sync_root_events: looping 6!\n");
    // Events flag is automatically enabled (iret emulation)
    enable_events_flag (xm_root_domain);

}

hw_enable_irq() and hw_disable_irq() is exactly the same as local_irq_enable()/local_irq_disable(), but the output shows while running hw_eable_irq() (at that point irq is disabled), the rest of the code is blocked, and I don't know why:

output:

[  172.049381] sync_root_events: looping!
[  172.053159] sync_root_events: looping 2!
[  172.057094] sync_root_events: looping 3!
[  172.061027] hw_irq_disabled?: 1
[  172.997338] sync_root_events: looping!
[  173.001095] sync_root_events: looping 2!
[  173.005028] sync_root_events: looping 3!
[  173.008961] hw_irq_disabled?: 1

I'm sorry If I'm asking a bad question, I'm not familiar with ppc/kernel programming at this moment. Great thanks to Scott and josh for your reply.

Regards,
Wang

Signature · 5 lines
Wang, Baojun                                        Lanzhou University
Distributed & Embedded System Lab              http://dslab.lzu.edu.cn
School of Information Science and Engeneering        [email protected]
Tianshui South Road 222. Lanzhou 730000                     .P.R.China
Tel:+86-931-8912025                                Fax:+86-931-8912022

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw
Quoted 6 lines · Baojun

hw_enable_irq() and hw_disable_irq() is exactly the same as local_irq_enable()/local_irq_disable(), but the output shows while running hw_eable_irq() (at that point irq is disabled), the rest of the code is blocked, and I don't know why:

output:

Quoted 8 lines
[  172.049381] sync_root_events: looping!
[  172.053159] sync_root_events: looping 2!
[  172.057094] sync_root_events: looping 3!
[  172.061027] hw_irq_disabled?: 1
[  172.997338] sync_root_events: looping!
[  173.001095] sync_root_events: looping 2!
[  173.005028] sync_root_events: looping 3!
[  173.008961] hw_irq_disabled?: 1

What did you expect the output to be? I assume that you're taking an interrupt after you enable interrupts?

-Scott