[patch 08/18] PS3: Kexec support

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Jun 7 12:54:06 EST 2007


On Thu, 2007-06-07 at 12:31 +1000, Michael Ellerman wrote:
> > >> +  pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__,
> pd->cpu, virq);
> > >> +
> > >> +  local_irq_save(flags);
> > >> +  asm volatile(
> > >> +               "1:        ldarx %0,0,%3\n"
> > >> +               "andc      %0,%0,%2\n"
> > >> +               "stdcx.    %0,0,%3\n"
> > >> +               "bne-      1b"
> > >> +               : "=&r" (old), "+m" (*p)
> > >> +               : "r" (bit), "r" (p)
> > >> +               : "cc" );
> > >> +
> > >> +  lv1_did_update_interrupt_mask(pd->node, pd->cpu);
> > >> +  local_irq_restore(flags);
> > > 
> > > How is this different from set_bit() ?  (asm-powerpc/bitops.h)
> > > 
> > > ps. now that I see you're just moving this code around someone's
> > > probably already asked that question. 

Actually the above is clear_bit :-)

That would thus be something around the lines of:

 clear_bit(&pd->bmp.mask, 63 - virq);

Geoff, feel free to replace it with the clear_bit if you think it's
nicer that way :-) (and double check I didn't smoke crack when doing
the above conversion).

The other one in unmask would be set_bit() of course.

Ben.




More information about the Linuxppc-dev mailing list