Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2455 → Rev 2456

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