Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3808 → Rev 2307

/branches/rcu/kernel/arch/ia64/src/ski/ski.c
44,7 → 44,6
#include <proc/thread.h>
#include <synch/spinlock.h>
#include <arch/asm.h>
#include <synch/rcu.h>
 
#define SKI_KBD_INR 0
 
143,7 → 142,7
if(ch == '\r')
ch = '\n';
if (ch) {
if (rcu_dereference_pointer(ski_kbd_irq.notif_cfg).notify && rcu_dereference_pointer(ski_kbd_irq.notif_cfg).answerbox) {
if (ski_kbd_irq.notif_cfg.notify && ski_kbd_irq.notif_cfg.answerbox) {
chardev_push_character(&ski_uconsole, ch);
ipc_irq_send_notif(&ski_kbd_irq);
} else {
156,7 → 155,7
}
 
if (last) {
if (rcu_dereference_pointer(ski_kbd_irq.notif_cfg).notify && rcu_dereference_pointer(ski_kbd_irq.notif_cfg).answerbox) {
if (ski_kbd_irq.notif_cfg.notify && ski_kbd_irq.notif_cfg.answerbox) {
chardev_push_character(&ski_uconsole, 0);
ipc_irq_send_notif(&ski_kbd_irq);
}
233,9 → 232,9
void ski_kbd_grab(void)
{
ipl_t ipl = interrupts_disable();
//rcu_read_lock() is not needed, ints are disabled
//rcu: atomic update doesn't need reallocation
rcu_dereference_pointer(ski_kbd_irq.notif_cfg).notify = false;
spinlock_lock(&ski_kbd_irq.lock);
ski_kbd_irq.notif_cfg.notify = false;
spinlock_unlock(&ski_kbd_irq.lock);
interrupts_restore(ipl);
}
 
242,10 → 241,9
void ski_kbd_release(void)
{
ipl_t ipl = interrupts_disable();
//rcu: atomic update doesn't need reallocation
spinlock_lock(&ski_kbd_irq.lock);
if (rcu_dereference_pointer(ski_kbd_irq.notif_cfg).answerbox)
rcu_dereference_pointer(ski_kbd_irq.notif_cfg).notify = true;
if (ski_kbd_irq.notif_cfg.answerbox)
ski_kbd_irq.notif_cfg.notify = true;
spinlock_unlock(&ski_kbd_irq.lock);
interrupts_restore(ipl);
}