win-pvdrivers

changeset 480:dd2fefa6b374

renamed suspend_evtchn to something more general. Tidied up some stale code.
author James Harper <james.harper@bendigoit.com.au>
date Sat Dec 06 16:20:45 2008 +1100 (2008-12-06)
parents 525a6f4ca9a1
children 2a18182e3090
files xenpci/evtchn.c xenpci/xenpci.h xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/evtchn.c	Tue Dec 02 21:00:51 2008 +1100
     1.2 +++ b/xenpci/evtchn.c	Sat Dec 06 16:20:45 2008 +1100
     1.3 @@ -372,11 +372,11 @@ EvtChn_Init(PXENPCI_DEVICE_DATA xpdd)
     1.4    xpdd->interrupts_masked = FALSE;
     1.5    KeMemoryBarrier();
     1.6  
     1.7 -  xpdd->suspend_evtchn = EvtChn_AllocIpi(xpdd, 0);
     1.8 -  xpdd->ev_actions[xpdd->suspend_evtchn].type = EVT_ACTION_TYPE_SUSPEND;
     1.9 -  EvtChn_Unmask(xpdd, xpdd->suspend_evtchn);
    1.10 +  xpdd->pdo_event_channel = EvtChn_AllocIpi(xpdd, 0);
    1.11 +  xpdd->ev_actions[xpdd->pdo_event_channel].type = EVT_ACTION_TYPE_SUSPEND;
    1.12 +  EvtChn_Unmask(xpdd, xpdd->pdo_event_channel);
    1.13    
    1.14 -  KdPrint((__DRIVER_NAME "     suspend_evtchn = %d\n", xpdd->suspend_evtchn));
    1.15 +  KdPrint((__DRIVER_NAME "     pdo_event_channel = %d\n", xpdd->pdo_event_channel));
    1.16  
    1.17    FUNCTION_EXIT();
    1.18    
     2.1 --- a/xenpci/xenpci.h	Tue Dec 02 21:00:51 2008 +1100
     2.2 +++ b/xenpci/xenpci.h	Sat Dec 06 16:20:45 2008 +1100
     2.3 @@ -181,7 +181,7 @@ typedef struct {
     2.4    shared_info_t *shared_info_area;
     2.5    xen_ulong_t evtchn_pending_pvt[sizeof(xen_ulong_t) * 8];
     2.6    xen_ulong_t evtchn_pending_suspend[sizeof(xen_ulong_t) * 8];
     2.7 -  evtchn_port_t suspend_evtchn;
     2.8 +  evtchn_port_t pdo_event_channel;
     2.9    BOOLEAN interrupts_masked;
    2.10  
    2.11    PHYSICAL_ADDRESS platform_mmio_addr;
    2.12 @@ -281,64 +281,6 @@ typedef struct
    2.13    PXENPCI_PDO_DEVICE_DATA context;
    2.14  } XEN_CHILD, *PXEN_CHILD;
    2.15  
    2.16 -#ifdef __GNUC__
    2.17 -#define SWINT(x) if (intno == x) { asm ("int $"#x";"); return;}
    2.18 -#else
    2.19 -#define SWINT(x) if (intno == x) { __asm { int x } return; }
    2.20 -#endif
    2.21 -
    2.22 -#if 0
    2.23 -#if defined(_X86_)
    2.24 -static __inline VOID
    2.25 -sw_interrupt(UCHAR intno)
    2.26 -{
    2.27 -  //KdPrint((__DRIVER_NAME "     Calling interrupt %02X\n", intno));
    2.28 -  SWINT(0x10) SWINT(0x11) SWINT(0x12) SWINT(0x13) SWINT(0x14) SWINT(0x15) SWINT(0x16) SWINT(0x17)
    2.29 -  SWINT(0x18) SWINT(0x19) SWINT(0x1A) SWINT(0x1B) SWINT(0x1C) SWINT(0x1D) SWINT(0x1E) SWINT(0x1F)
    2.30 -  SWINT(0x20) SWINT(0x21) SWINT(0x22) SWINT(0x23) SWINT(0x24) SWINT(0x25) SWINT(0x26) SWINT(0x27)
    2.31 -  SWINT(0x28) SWINT(0x29) SWINT(0x2A) SWINT(0x2B) SWINT(0x2C) SWINT(0x2D) SWINT(0x2E) SWINT(0x2F)
    2.32 -  SWINT(0x30) SWINT(0x31) SWINT(0x32) SWINT(0x33) SWINT(0x34) SWINT(0x35) SWINT(0x36) SWINT(0x37)
    2.33 -  SWINT(0x38) SWINT(0x39) SWINT(0x3A) SWINT(0x3B) SWINT(0x3C) SWINT(0x3D) SWINT(0x3E) SWINT(0x3F)
    2.34 -  SWINT(0x40) SWINT(0x41) SWINT(0x42) SWINT(0x43) SWINT(0x44) SWINT(0x45) SWINT(0x46) SWINT(0x47)
    2.35 -  SWINT(0x48) SWINT(0x49) SWINT(0x4A) SWINT(0x4B) SWINT(0x4C) SWINT(0x4D) SWINT(0x4E) SWINT(0x4F)
    2.36 -  SWINT(0x50) SWINT(0x51) SWINT(0x52) SWINT(0x53) SWINT(0x54) SWINT(0x55) SWINT(0x56) SWINT(0x57)
    2.37 -  SWINT(0x58) SWINT(0x59) SWINT(0x5A) SWINT(0x5B) SWINT(0x5C) SWINT(0x5D) SWINT(0x5E) SWINT(0x5F)
    2.38 -  SWINT(0x60) SWINT(0x61) SWINT(0x62) SWINT(0x63) SWINT(0x64) SWINT(0x65) SWINT(0x66) SWINT(0x67)
    2.39 -  SWINT(0x68) SWINT(0x69) SWINT(0x6A) SWINT(0x6B) SWINT(0x6C) SWINT(0x6D) SWINT(0x6E) SWINT(0x6F)
    2.40 -  SWINT(0x70) SWINT(0x71) SWINT(0x72) SWINT(0x73) SWINT(0x74) SWINT(0x75) SWINT(0x76) SWINT(0x77)
    2.41 -  SWINT(0x78) SWINT(0x79) SWINT(0x7A) SWINT(0x7B) SWINT(0x7C) SWINT(0x7D) SWINT(0x7E) SWINT(0x7F)
    2.42 -  SWINT(0x80) SWINT(0x81) SWINT(0x82) SWINT(0x83) SWINT(0x84) SWINT(0x85) SWINT(0x86) SWINT(0x87)
    2.43 -  SWINT(0x88) SWINT(0x89) SWINT(0x8A) SWINT(0x8B) SWINT(0x8C) SWINT(0x8D) SWINT(0x8E) SWINT(0x8F)
    2.44 -  SWINT(0x90) SWINT(0x91) SWINT(0x92) SWINT(0x93) SWINT(0x94) SWINT(0x95) SWINT(0x96) SWINT(0x97)
    2.45 -  SWINT(0x98) SWINT(0x99) SWINT(0x9A) SWINT(0x9B) SWINT(0x9C) SWINT(0x9D) SWINT(0x9E) SWINT(0x9F)
    2.46 -  SWINT(0xA0) SWINT(0xA1) SWINT(0xA2) SWINT(0xA3) SWINT(0xA4) SWINT(0xA5) SWINT(0xA6) SWINT(0xA7)
    2.47 -  SWINT(0xA8) SWINT(0xA9) SWINT(0xAA) SWINT(0xAB) SWINT(0xAC) SWINT(0xAD) SWINT(0xAE) SWINT(0xAF)
    2.48 -  SWINT(0xB0) SWINT(0xB1) SWINT(0xB2) SWINT(0xB3) SWINT(0xB4) SWINT(0xB5) SWINT(0xB6) SWINT(0xB7)
    2.49 -  SWINT(0xB8) SWINT(0xB9) SWINT(0xBA) SWINT(0xBB) SWINT(0xBC) SWINT(0xBD) SWINT(0xBE) SWINT(0xBF)
    2.50 -  SWINT(0xC0) SWINT(0xC1) SWINT(0xC2) SWINT(0xC3) SWINT(0xC4) SWINT(0xC5) SWINT(0xC6) SWINT(0xC7)
    2.51 -  SWINT(0xC8) SWINT(0xC9) SWINT(0xCA) SWINT(0xCB) SWINT(0xCC) SWINT(0xCD) SWINT(0xCE) SWINT(0xCF)
    2.52 -  SWINT(0xD0) SWINT(0xD1) SWINT(0xD2) SWINT(0xD3) SWINT(0xD4) SWINT(0xD5) SWINT(0xD6) SWINT(0xD7)
    2.53 -  SWINT(0xD8) SWINT(0xD9) SWINT(0xDA) SWINT(0xDB) SWINT(0xDC) SWINT(0xDD) SWINT(0xDE) SWINT(0xDF)
    2.54 -  SWINT(0xE0) SWINT(0xE1) SWINT(0xE2) SWINT(0xE3) SWINT(0xE4) SWINT(0xE5) SWINT(0xE6) SWINT(0xE7)
    2.55 -  SWINT(0xE8) SWINT(0xE9) SWINT(0xEA) SWINT(0xEB) SWINT(0xEC) SWINT(0xED) SWINT(0xEE) SWINT(0xEF)
    2.56 -  SWINT(0xF0) SWINT(0xF1) SWINT(0xF2) SWINT(0xF3) SWINT(0xF4) SWINT(0xF5) SWINT(0xF6) SWINT(0xF7)
    2.57 -  SWINT(0xF8) SWINT(0xF9) SWINT(0xFA) SWINT(0xFB) SWINT(0xFC) SWINT(0xFD) SWINT(0xFE) SWINT(0xFF)
    2.58 -
    2.59 -  /* not found */
    2.60 -  KdPrint((__DRIVER_NAME "     interrupt %02X not set up. Blame James.\n", intno));
    2.61 -  KeBugCheckEx(('X' << 16)|('E' << 8)|('N'), 0x00000002, (ULONG)intno, 0x00000000, 0x00000000);
    2.62 -}
    2.63 -#else
    2.64 -VOID _sw_interrupt(UCHAR);
    2.65 -
    2.66 -static __inline VOID
    2.67 -sw_interrupt(UCHAR intno)
    2.68 -{
    2.69 -  _sw_interrupt(intno);
    2.70 -}
    2.71 -#endif
    2.72 -#endif
    2.73 -  
    2.74  #include "hypercall.h"
    2.75  
    2.76  #define XBT_NIL ((xenbus_transaction_t)0)
     3.1 --- a/xenpci/xenpci_pdo.c	Tue Dec 02 21:00:51 2008 +1100
     3.2 +++ b/xenpci/xenpci_pdo.c	Sat Dec 06 16:20:45 2008 +1100
     3.3 @@ -586,6 +586,7 @@ XenPci_XenConfigDeviceSpecifyBuffers(PVO
     3.4    vectors.XenPci_XenShutdownDevice = XenPci_XenShutdownDevice;
     3.5    strncpy(vectors.path, xppdd->path, 128);
     3.6    strncpy(vectors.backend_path, xppdd->backend_path, 128);
     3.7 +  vectors.pdo_event_channel = xpdd->pdo_event_channel;
     3.8    vectors.XenBus_Read = XenPci_XenBus_Read;
     3.9    vectors.XenBus_Write = XenPci_XenBus_Write;
    3.10    vectors.XenBus_Printf = XenPci_XenBus_Printf;
    3.11 @@ -856,7 +857,7 @@ XenPci_Pdo_Resume(PDEVICE_OBJECT device_
    3.12    KeMemoryBarrier();
    3.13    xppdd->device_state.resume_state = RESUME_STATE_FRONTEND_RESUME;
    3.14    KeMemoryBarrier();
    3.15 -  EvtChn_Notify(xpdd, xpdd->suspend_evtchn);  
    3.16 +  EvtChn_Notify(xpdd, xpdd->pdo_event_channel);  
    3.17  
    3.18    FUNCTION_EXIT();
    3.19  
    3.20 @@ -886,7 +887,7 @@ XenPci_Pdo_Suspend(PDEVICE_OBJECT device
    3.21      KeMemoryBarrier();
    3.22      xppdd->device_state.resume_state = RESUME_STATE_SUSPENDING;
    3.23      KeMemoryBarrier();
    3.24 -    EvtChn_Notify(xpdd, xpdd->suspend_evtchn);    
    3.25 +    EvtChn_Notify(xpdd, xpdd->pdo_event_channel);    
    3.26      while(xppdd->device_state.resume_state_ack != RESUME_STATE_SUSPENDING)
    3.27      {
    3.28        KdPrint((__DRIVER_NAME "     Starting delay - resume_state = %d, resume_state_ack = %d\n", xppdd->device_state.resume_state, xppdd->device_state.resume_state_ack));