VirtualBox

儲存庫 vbox 的更動 37297


忽略:
時間撮記:
2011-6-1 下午04:18:21 (13 年 以前)
作者:
vboxsync
訊息:

Runtime/r0drv/linux: mpnotification, filter off unwanted events.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c

    r37294 r37297  
    8585    AssertRelease(idCpu == RTMpCpuId());   /* ASSUMES iCpu == RTCPUID */
    8686
     87    switch (ulNativeEvent)
     88    {
     89# ifdef CPU_DOWN_FAILED
     90        case CPU_DOWN_FAILED:
     91#  if defined(CPU_TASKS_FROZEN) && defined(CPU_DOWN_FAILED_FROZEN)
     92        case CPU_DOWN_FAILED_FROZEN:
     93#  endif
     94# endif
     95        case CPU_ONLINE:
     96# if defined(CPU_TASKS_FROZEN) && defined(CPU_ONLINE_FROZEN)
     97        case CPU_ONLINE_FROZEN:
     98# endif
     99            rtMpNotificationDoCallbacks(RTMPEVENT_ONLINE, idCpu);
     100            break;
     101
     102# ifdef CPU_DOWN_PREPARE
     103        case CPU_DOWN_PREPARE:
     104#  if defined(CPU_TASKS_FROZEN) && defined(CPU_DOWN_PREPARE_FROZEN)
     105        case CPU_DOWN_PREPARE_FROZEN:
     106#  endif
     107            rtMpNotificationDoCallbacks(RTMPEVENT_OFFLINE, idCpu);
     108            break;
     109# endif
     110    }
     111}
     112
     113
     114/**
     115 * The native callback.
     116 *
     117 * @returns NOTIFY_DONE.
     118 * @param   pNotifierBlock  Pointer to g_NotifierBlock.
     119 * @param   ulNativeEvent   The native event.
     120 * @param   pvCpu           The cpu id cast into a pointer value.
     121 * @remarks This can fire with preemption enabled and on any CPU.
     122 */
     123static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu)
     124{
     125    int rc;
     126    bool fProcessEvent = false;
     127    RTCPUID idCpu      = (uintptr_t)pvCpu;
     128    NOREF(pNotifierBlock);
     129
    87130    /*
    88131     * Note that redhat/CentOS ported _some_ of the FROZEN macros
     
    91134     * the individual event variants.
    92135     */
    93 
    94     /* ASSUMES iCpu == RTCPUID */
    95136    switch (ulNativeEvent)
    96137    {
     
    105146#  endif
    106147            if (!RTCpuSetIsMember(&g_MpPendingOfflineSet, idCpu))
    107                 return;
     148                break;      /* fProcessEvents = false */
    108149        /* fall thru */
    109150# endif
     
    115156            RTCpuSetDel(&g_MpPendingOfflineSet, idCpu);
    116157# endif
    117             rtMpNotificationDoCallbacks(RTMPEVENT_ONLINE, idCpu);
     158            fProcessEvent = true;
    118159            break;
    119160
     
    128169        case CPU_DOWN_PREPARE_FROZEN:
    129170#  endif
     171            fProcessEvent = true;
    130172# else
    131173        case CPU_DEAD:
     
    133175        case CPU_DEAD_FROZEN:
    134176#  endif
    135 # endif
    136             rtMpNotificationDoCallbacks(RTMPEVENT_OFFLINE, idCpu);
     177            /* Don't process CPU_DEAD notifications. */
     178# endif
    137179# ifdef CPU_DOWN_FAILED
    138180            RTCpuSetAdd(&g_MpPendingOfflineSet, idCpu);
     
    140182            break;
    141183    }
    142 }
    143 
    144 
    145 /**
    146  * The native callback.
    147  *
    148  * @returns NOTIFY_DONE.
    149  * @param   pNotifierBlock  Pointer to g_NotifierBlock.
    150  * @param   ulNativeEvent   The native event.
    151  * @param   pvCpu           The cpu id cast into a pointer value.
    152  * @remarks This can fire with preemption enabled and on any CPU.
    153  */
    154 static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu)
    155 {
    156     int rc;
    157     RTCPUID idCpu = (uintptr_t)pvCpu;
    158     NOREF(pNotifierBlock);
     184
     185    if (!fProcessEvent)
     186        return NOTIFY_DONE;
    159187
    160188    /*
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette