win-pvdrivers

changeset 968:1ad5f1d3a664

Fix a bug affecting suspend events when the highest event is >32 (or >64 for 64 bit systems)
author James Harper <james.harper@bendigoit.com.au>
date Sat Jan 14 23:19:33 2012 +1100 (2012-01-14)
parents a8273b48cd4f
children 1306945ecc59
files xenpci/evtchn.c xenpci/xenpci.h
line diff
     1.1 --- a/xenpci/evtchn.c	Sat Jan 14 23:03:24 2012 +1100
     1.2 +++ b/xenpci/evtchn.c	Sat Jan 14 23:19:33 2012 +1100
     1.3 @@ -73,7 +73,7 @@ EvtChn_AckEvent(PVOID context, evtchn_po
     1.4  
     1.5    val = synch_clear_bit(evt_bit, (volatile xen_long_t *)&xpdd->evtchn_pending_pvt[pcpu][evt_word]);
     1.6    *last_interrupt = TRUE;
     1.7 -  for (i = 0; i < sizeof(xen_ulong_t) * 8; i++)
     1.8 +  for (i = 0; i < ARRAY_SIZE(xpdd->evtchn_pending_pvt[pcpu]); i++)
     1.9    {
    1.10      if (xpdd->evtchn_pending_pvt[pcpu][i])
    1.11      {
    1.12 @@ -168,7 +168,7 @@ to CPU != 0, but we should always use vc
    1.13          break;
    1.14        case EVT_ACTION_TYPE_SUSPEND:
    1.15          KdPrint((__DRIVER_NAME "     EVT_ACTION_TYPE_SUSPEND\n"));
    1.16 -        for (i = 0; i < ARRAY_SIZE(xpdd->evtchn_pending_pvt[pcpu]); i++)
    1.17 +        for (i = 0; i < NR_EVENTS; i++)
    1.18          {
    1.19            if (!(xpdd->ev_actions[i].flags & EVT_ACTION_FLAGS_NO_SUSPEND))
    1.20            {
     2.1 --- a/xenpci/xenpci.h	Sat Jan 14 23:03:24 2012 +1100
     2.2 +++ b/xenpci/xenpci.h	Sat Jan 14 23:19:33 2012 +1100
     2.3 @@ -114,7 +114,8 @@ typedef struct _XENBUS_WATCH_ENTRY {
     2.4    int Active;
     2.5  } XENBUS_WATCH_ENTRY, *PXENBUS_WATCH_ENTRY;
     2.6  
     2.7 -#define NR_EVENTS 1024
     2.8 +/* number of events is 1024 on 32 bits and 4096 on 64 bits */
     2.9 +#define NR_EVENTS (sizeof(xen_ulong_t) * 8 * sizeof(xen_ulong_t) * 8)
    2.10  #define WATCH_RING_SIZE 128
    2.11  #define NR_XB_REQS 32
    2.12  #define MAX_WATCH_ENTRIES 128