VirtualBox

Ignore:
Timestamp:
Feb 12, 2015 8:58:24 PM (10 years ago)
Author:
vboxsync
Message:

uint8_t isn't enough for a cpu index any more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c

    r54183 r54184  
    4646#include "internal/magics.h"
    4747
    48 #define SOL_TIMER_ANY_CPU       (-1)
    4948
    5049/*******************************************************************************
     
    6968    uint8_t                 fSpecificCpu;
    7069    /** The CPU it must run on if fSpecificCpu is set. */
    71     uint8_t                 iCpu;
     70    uint32_t                iCpu;
    7271    /** The nano second interval for repeating timers. */
    7372    uint64_t                cNsInterval;
     
    323322        pTimer->fAllCpus = true;
    324323        pTimer->fSpecificCpu = false;
    325         pTimer->iCpu = 255;
     324        pTimer->iCpu = UINT32_MAX;
    326325    }
    327326    else if (fFlags & RTTIMER_FLAGS_CPU_SPECIFIC)
     
    335334        pTimer->fAllCpus = false;
    336335        pTimer->fSpecificCpu = false;
    337         pTimer->iCpu = 255;
     336        pTimer->iCpu = UINT32_MAX;
    338337    }
    339338    pTimer->cNsInterval = u64NanoInterval;
     
    393392    else
    394393    {
    395         int iCpu = SOL_TIMER_ANY_CPU;
    396         if (pTimer->fSpecificCpu)
    397         {
    398             iCpu = pTimer->iCpu;
    399             if (!RTMpIsCpuOnline(iCpu))    /* ASSUMES: index == cpuid */
    400                 return VERR_CPU_OFFLINE;
    401         }
     394        if (pTimer->fSpecificCpu && !RTMpIsCpuOnline(pTimer->iCpu)) /* ASSUMES: index == cpuid */
     395            return VERR_CPU_OFFLINE;
    402396
    403397        pTimer->u.Single.hHandler.cyh_func  = (cyc_func_t)rtTimerSolSingleCallbackWrapper;
     
    406400
    407401        mutex_enter(&cpu_lock);
    408         if (RT_UNLIKELY(   iCpu != SOL_TIMER_ANY_CPU
    409                         && !cpu_is_online(cpu[iCpu])))
     402        if (RT_UNLIKELY(   pTimer->fSpecificCpu
     403                        && !cpu_is_online(cpu[pTimer->iCpu])))
    410404        {
    411405            mutex_exit(&cpu_lock);
     
    427421
    428422        pTimer->hCyclicId = cyclic_add(&pTimer->u.Single.hHandler, &pTimer->u.Single.hFireTime);
    429         if (iCpu != SOL_TIMER_ANY_CPU)
    430             cyclic_bind(pTimer->hCyclicId, cpu[iCpu], NULL /* cpupart */);
     423        if (pTimer->fSpecificCpu)
     424            cyclic_bind(pTimer->hCyclicId, cpu[pTimer->iCpu], NULL /* cpupart */);
    431425
    432426        mutex_exit(&cpu_lock);
Note: See TracChangeset for help on using the changeset viewer.

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