ia64/xen-unstable

diff xen/common/event_channel.c @ 2919:fe5933507ca5

bitkeeper revision 1.1159.1.393 (4190a145cbZFKzGdkH5xPlOlxNNPnw)

Split struct exec_domain out of struct domain.
author cl349@freefall.cl.cam.ac.uk
date Tue Nov 09 10:51:49 2004 +0000 (2004-11-09)
parents 3f929065a1d1
children 7ed93ab784b6
line diff
     1.1 --- a/xen/common/event_channel.c	Mon Nov 08 15:29:51 2004 +0000
     1.2 +++ b/xen/common/event_channel.c	Tue Nov 09 10:51:49 2004 +0000
     1.3 @@ -71,7 +71,7 @@ static int get_free_port(struct domain *
     1.4  
     1.5  static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     1.6  {
     1.7 -    struct domain *d = current;
     1.8 +    struct domain *d = current->domain;
     1.9      int            port;
    1.10  
    1.11      spin_lock(&d->event_channel_lock);
    1.12 @@ -100,16 +100,16 @@ static long evtchn_bind_interdomain(evtc
    1.13      domid_t        dom1 = bind->dom1, dom2 = bind->dom2;
    1.14      long           rc = 0;
    1.15  
    1.16 -    if ( !IS_PRIV(current) && (dom1 != DOMID_SELF) )
    1.17 +    if ( !IS_PRIV(current->domain) && (dom1 != DOMID_SELF) )
    1.18          return -EPERM;
    1.19  
    1.20      if ( (port1 < 0) || (port2 < 0) )
    1.21          return -EINVAL;
    1.22  
    1.23      if ( dom1 == DOMID_SELF )
    1.24 -        dom1 = current->id;
    1.25 +        dom1 = current->domain->id;
    1.26      if ( dom2 == DOMID_SELF )
    1.27 -        dom2 = current->id;
    1.28 +        dom2 = current->domain->id;
    1.29  
    1.30      if ( ((d1 = find_domain_by_id(dom1)) == NULL) ||
    1.31           ((d2 = find_domain_by_id(dom2)) == NULL) )
    1.32 @@ -183,7 +183,7 @@ static long evtchn_bind_interdomain(evtc
    1.33      switch ( d2->event_channel[port2].state )
    1.34      {
    1.35      case ECS_FREE:
    1.36 -        if ( !IS_PRIV(current) && (dom2 != DOMID_SELF) )
    1.37 +        if ( !IS_PRIV(current->domain) && (dom2 != DOMID_SELF) )
    1.38              ERROR_EXIT(-EPERM);
    1.39          break;
    1.40  
    1.41 @@ -235,7 +235,7 @@ static long evtchn_bind_interdomain(evtc
    1.42  
    1.43  static long evtchn_bind_virq(evtchn_bind_virq_t *bind)
    1.44  {
    1.45 -    struct domain *d = current;
    1.46 +    struct domain *d = current->domain;
    1.47      int            port, virq = bind->virq;
    1.48  
    1.49      if ( virq >= ARRAY_SIZE(d->virq_to_evtchn) )
    1.50 @@ -271,7 +271,7 @@ static long evtchn_bind_virq(evtchn_bind
    1.51  
    1.52  static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
    1.53  {
    1.54 -    struct domain *d = current;
    1.55 +    struct domain *d = current->domain;
    1.56      int            port, rc, pirq = bind->pirq;
    1.57  
    1.58      if ( pirq >= ARRAY_SIZE(d->pirq_to_evtchn) )
    1.59 @@ -417,8 +417,8 @@ static long evtchn_close(evtchn_close_t 
    1.60      domid_t        dom = close->dom;
    1.61  
    1.62      if ( dom == DOMID_SELF )
    1.63 -        dom = current->id;
    1.64 -    else if ( !IS_PRIV(current) )
    1.65 +        dom = current->domain->id;
    1.66 +    else if ( !IS_PRIV(current->domain) )
    1.67          return -EPERM;
    1.68  
    1.69      if ( (d = find_domain_by_id(dom)) == NULL )
    1.70 @@ -433,7 +433,7 @@ static long evtchn_close(evtchn_close_t 
    1.71  
    1.72  static long evtchn_send(int lport)
    1.73  {
    1.74 -    struct domain *ld = current, *rd;
    1.75 +    struct domain *ld = current->domain, *rd;
    1.76      int            rport;
    1.77  
    1.78      spin_lock(&ld->event_channel_lock);
    1.79 @@ -466,8 +466,8 @@ static long evtchn_status(evtchn_status_
    1.80      long             rc = 0;
    1.81  
    1.82      if ( dom == DOMID_SELF )
    1.83 -        dom = current->id;
    1.84 -    else if ( !IS_PRIV(current) )
    1.85 +        dom = current->domain->id;
    1.86 +    else if ( !IS_PRIV(current->domain) )
    1.87          return -EPERM;
    1.88  
    1.89      if ( (d = find_domain_by_id(dom)) == NULL )