Changeset 3dea17f in mainline


Ignore:
Timestamp:
2006-10-19T17:33:08Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f0450658
Parents:
80ca47e
Message:

Add mutual exclusion to keyboard grab and release
functions on sparc64, ppc32, mips32 and ia64.

Location:
kernel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/ski/ski.c

    r80ca47e r3dea17f  
    242242void ski_kbd_grab(void)
    243243{
     244        ipl_t ipl = interrupts_disable();
     245        spinlock_lock(&ski_kbd_irq.lock);
    244246        ski_kbd_irq.notif_cfg.notify = false;
     247        spinlock_unlock(&ski_kbd_irq.lock);
     248        interrupts_restore(ipl);
    245249}
    246250
    247251void ski_kbd_release(void)
    248252{
     253        ipl_t ipl = interrupts_disable();
     254        spinlock_lock(&ski_kbd_irq.lock);
    249255        if (ski_kbd_irq.notif_cfg.answerbox)
    250256                ski_kbd_irq.notif_cfg.notify = true;
     257        spinlock_unlock(&ski_kbd_irq.lock);
     258        interrupts_restore(ipl);
    251259}
    252260
  • kernel/arch/mips32/src/drivers/msim.c

    r80ca47e r3dea17f  
    121121void msim_kbd_grab(void)
    122122{
     123        ipl_t ipl = interrupts_disable();
     124        spinlock_lock(&msim_irq.lock);
    123125        msim_irq.notif_cfg.notify = false;
     126        spinlock_unlock(&msim_irq.lock);
     127        interrupts_restore(ipl);
    124128}
    125129
    126130void msim_kbd_release(void)
    127131{
     132        ipl_t ipl = interrupts_disable();
     133        spinlock_lock(&msim_irq.lock);
    128134        if (msim_irq.notif_cfg.answerbox)
    129135                msim_irq.notif_cfg.notify = true;
     136        spinlock_unlock(&msim_irq.lock);
     137        interrupts_restore(ipl);
    130138}
    131139
  • kernel/arch/ppc32/src/drivers/cuda.c

    r80ca47e r3dea17f  
    274274void cuda_grab(void)
    275275{
     276        ipl_t ipl = interrupts_disable();
     277        spinlock_lock(&cuda_irq.lock);
    276278        cuda_irq.notif_cfg.notify = false;
     279        spinlock_unlock(&cuda_irq.lock);
     280        interrupts_restore(ipl);
    277281}
    278282
     
    281285void cuda_release(void)
    282286{
     287        ipl_t ipl = interrupts_disable();
     288        spinlock_lock(&cuda_irq.lock);
    283289        if (cuda_irq.notif_cfg.answerbox)
    284290                cuda_irq.notif_cfg.notify = true;
     291        spinlock_unlock(&cuda_irq.unlock);
     292        interrupts_restore(ipl);
    285293}
    286294
  • kernel/arch/ppc32/src/drivers/pic.c

    r80ca47e r3dea17f  
    4646}
    4747
    48 
    49 
    5048void pic_enable_interrupt(int intnum)
    5149{
  • kernel/genarch/src/kbd/ns16550.c

    r80ca47e r3dea17f  
    8181void ns16550_grab(void)
    8282{
     83        ipl_t ipl = interrupts_disable();
     84
    8385        ns16550_ier_write(&ns16550, IER_ERBFI);         /* enable receiver interrupt */
    8486       
     
    8688                (void) ns16550_rbr_read(&ns16550);
    8789
     90        spinlock_lock(&ns16550_irq.lock);
    8891        ns16550_irq.notif_cfg.notify = false;
     92        spinlock_unlock(&ns16550_irq.lock);
     93        interrupts_restore(ipl);
    8994}
    9095
     
    9297void ns16550_release(void)
    9398{
     99        ipl_t ipl = interrupts_disable();
     100        spinlock_lock(&ns16550_irq.lock);
    94101        if (ns16550_irq.notif_cfg.answerbox)
    95102                ns16550_irq.notif_cfg.notify = true;
     103        spinlock_unlock(&ns16550_irq.lock);
     104        interrupts_restore(ipl);
    96105}
    97106
  • kernel/genarch/src/kbd/z8530.c

    r80ca47e r3dea17f  
    7575void z8530_grab(void)
    7676{
     77        ipl_t ipl = interrupts_disable();
     78
    7779        (void) z8530_read_a(&z8530, RR8);
    7880
     
    9092        z8530_write_a(&z8530, WR9, WR9_MIE);            /* Master Interrupt Enable. */
    9193       
     94        spinlock_lock(&z8530_irq.lock);
    9295        z8530_irq.notif_cfg.notify = false;
     96        spinlock_unlock(&z8530_irq.lock);
     97        interrupts_restore(ipl);
    9398}
    9499
     
    96101void z8530_release(void)
    97102{
     103        ipl_t ipl = interrupts_disable();
     104        spinlock_lock(&z8530_irq.lock);
    98105        if (z8530_irq.notif_cfg.answerbox)
    99106                z8530_irq.notif_cfg.notify = true;
     107        spinlock_unlock(&z8530_irq.lock);
     108        interrupts_restore(ipl);
    100109}
    101110
Note: See TracChangeset for help on using the changeset viewer.