Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2456 → Rev 2307

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