ia64/xen-unstable

changeset 646:6650ca532761

bitkeeper revision 1.363 (3f171a51lxF2ZLdi2G16l31zvS1aNQ)

xen_kbd.c, schedule.c, network.c:
More cleanups.
author kaf24@scramble.cl.cam.ac.uk
date Thu Jul 17 21:51:13 2003 +0000 (2003-07-17)
parents 3212022b1d8d
children e5b8391908e2
files xen/common/network.c xen/common/schedule.c xen/drivers/char/xen_kbd.c
line diff
     1.1 --- a/xen/common/network.c	Thu Jul 17 20:49:37 2003 +0000
     1.2 +++ b/xen/common/network.c	Thu Jul 17 21:51:13 2003 +0000
     1.3 @@ -259,8 +259,11 @@ int vif_getinfo(vif_getinfo_t *info)
     1.4  
     1.5      vif = p->net_vif_list[info->vif];
     1.6  
     1.7 -    if(vif == NULL)
     1.8 +    if ( vif == NULL )
     1.9 +    {
    1.10 +        put_task_struct(p);
    1.11          return -ENOSYS;
    1.12 +    }
    1.13  
    1.14      info->total_bytes_sent              = vif->total_bytes_sent;
    1.15      info->total_bytes_received          = vif->total_bytes_received;
     2.1 --- a/xen/common/schedule.c	Thu Jul 17 20:49:37 2003 +0000
     2.2 +++ b/xen/common/schedule.c	Thu Jul 17 21:51:13 2003 +0000
     2.3 @@ -225,13 +225,14 @@ long sched_adjdom(int dom, unsigned long
     2.4             dom, mcu_adv, warp, warpl, warpu);
     2.5  
     2.6      p = find_domain_by_id(dom);
     2.7 -    if ( p == NULL ) return -ESRCH;
     2.8 +    if ( p == NULL ) 
     2.9 +        return -ESRCH;
    2.10  
    2.11      spin_lock_irq(&schedule_data[p->processor].lock);   
    2.12 +    p->mcu_advance = mcu_adv;
    2.13 +    spin_unlock_irq(&schedule_data[p->processor].lock); 
    2.14  
    2.15 -    p->mcu_advance = mcu_adv;
    2.16 -
    2.17 -    spin_unlock_irq(&schedule_data[p->processor].lock); 
    2.18 +    put_task_struct(p);
    2.19  
    2.20      return 0;
    2.21  }
    2.22 @@ -569,11 +570,9 @@ void __init scheduler_init(void)
    2.23  void schedulers_start(void) 
    2.24  {   
    2.25      printk("Start schedulers\n");
    2.26 -    __cli();
    2.27      sched_timer(0);
    2.28      virt_timer(0);
    2.29      smp_call_function((void *)sched_timer, NULL, 1, 1);
    2.30 -    __sti();
    2.31  }
    2.32  
    2.33  
     3.1 --- a/xen/drivers/char/xen_kbd.c	Thu Jul 17 20:49:37 2003 +0000
     3.2 +++ b/xen/drivers/char/xen_kbd.c	Thu Jul 17 21:51:13 2003 +0000
     3.3 @@ -185,12 +185,13 @@ static void keyboard_interrupt(int irq, 
     3.4  {
     3.5      unsigned char status, scancode;
     3.6      unsigned int work = 1000;
     3.7 -    unsigned long cpu_mask, flags;
     3.8 +    unsigned long cpu_mask = 0, flags;
     3.9 +    struct task_struct *p = CONSOLE_OWNER;
    3.10  
    3.11      spin_lock_irqsave(&kbd_lock, flags);
    3.12  
    3.13      while ( (--work > 0) && ((status = kbd_read_status()) & KBD_STAT_OBF) )
    3.14 -    {      
    3.15 +    {
    3.16          scancode = kbd_read_input();
    3.17        
    3.18  #ifdef CONFIG_XEN_ATTENTION_KEY
    3.19 @@ -214,15 +215,23 @@ static void keyboard_interrupt(int irq, 
    3.20          }
    3.21  #endif
    3.22        
    3.23 -        kbd_ring_push(status, scancode);
    3.24 -        cpu_mask = mark_guest_event(CONSOLE_OWNER, _EVENT_KBD);
    3.25 -        guest_event_notify(cpu_mask);
    3.26 +        if ( p != NULL )
    3.27 +        {
    3.28 +            kbd_ring_push(status, scancode);
    3.29 +            cpu_mask |= mark_guest_event(CONSOLE_OWNER, _EVENT_KBD);
    3.30 +        }
    3.31      }
    3.32      
    3.33      if ( !work )
    3.34          printk(KERN_ERR "xen_keyb: controller jammed (0x%02X).\n", status);
    3.35  
    3.36      spin_unlock_irqrestore(&kbd_lock, flags);
    3.37 +
    3.38 +    if ( p != NULL )
    3.39 +    {
    3.40 +        put_task_struct(p);
    3.41 +        guest_event_notify(cpu_mask);
    3.42 +    }    
    3.43  }
    3.44      
    3.45