Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2307 → Rev 2456

/branches/rcu/kernel/arch/mips32/src/drivers/serial.c
38,6 → 38,7
#include <arch/drivers/serial.h>
#include <console/chardev.h>
#include <console/console.h>
#include <synch/rcu.h>
 
#define SERIAL_IRQ 2
 
112,7 → 113,7
/** Process keyboard interrupt. Does not work in simics? */
static void serial_irq_handler(irq_t *irq, void *arg, ...)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox))
if ((rcu_dereference_pointer(irq->notif_cfg).notify) && (rcu_dereference_pointer(irq->notif_cfg).answerbox))
ipc_irq_send_notif(irq);
else
serial_handler();
/branches/rcu/kernel/arch/mips32/src/drivers/msim.c
39,6 → 39,7
#include <arch/cp0.h>
#include <console/console.h>
#include <sysinfo/sysinfo.h>
#include <synch/rcu.h>
 
/** Address of devices. */
#define MSIM_VIDEORAM 0xB0000000
99,7 → 100,7
/** Process keyboard interrupt. */
static void msim_irq_handler(irq_t *irq, void *arg, ...)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox))
if ((rcu_dereference_pointer(irq->notif_cfg).notify) && (rcu_dereference_pointer(irq->notif_cfg).answerbox))
ipc_irq_send_notif(irq);
else {
char ch = 0;
121,9 → 122,9
void msim_kbd_grab(void)
{
ipl_t ipl = interrupts_disable();
spinlock_lock(&msim_irq.lock);
msim_irq.notif_cfg.notify = false;
spinlock_unlock(&msim_irq.lock);
//rcu_read_lock() is not needed, ints are disabled
//rcu: atomic update doesn't need reallocation
rcu_dereference_pointer(msim_irq.notif_cfg).notify = false;
interrupts_restore(ipl);
}
 
130,9 → 131,10
void msim_kbd_release(void)
{
ipl_t ipl = interrupts_disable();
//rcu: atomic update doesn't need reallocation
spinlock_lock(&msim_irq.lock);
if (msim_irq.notif_cfg.answerbox)
msim_irq.notif_cfg.notify = true;
if (rcu_dereference_pointer(msim_irq.notif_cfg).answerbox)
rcu_dereference_pointer(msim_irq.notif_cfg).notify = true;
spinlock_unlock(&msim_irq.lock);
interrupts_restore(ipl);
}