VirtualBox

Ignore:
Timestamp:
Jul 30, 2020 9:06:35 AM (5 years ago)
Author:
vboxsync
Message:

reverted r139610

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c

    r85542 r85543  
    383383#ifdef CONFIG_SMP
    384384    IPRT_LINUX_SAVE_EFL_AC();
    385     int                     rc;
    386     RTTHREADPREEMPTSTATE    PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
    387 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) /* 2.6.28 introduces CONFIG_CPUMASK_OFFSTACK */
    388     cpumask_var_t           DstCpuMask;
    389 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    390     cpumask_t               DstCpuMask;
    391 # endif
     385    int rc;
     386    RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
    392387
    393388    AssertReturn(idCpu1 != idCpu2, VERR_INVALID_PARAMETER);
    394389    AssertReturn(!(fFlags & RTMPON_F_VALID_MASK), VERR_INVALID_FLAGS);
    395 
    396     /*
    397      * Prepare the CPU mask before we disable preemption.
    398      */
    399 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
    400     if (!zalloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
    401         return VERR_NO_MEMORY;
    402     cpumask_set_cpu(idCpu1, DstCpuMask);
    403     cpumask_set_cpu(idCpu2, DstCpuMask);
    404 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
    405     if (!alloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
    406         return VERR_NO_MEMORY;
    407     cpumask_clear(DstCpuMask);
    408     cpumask_set_cpu(idCpu1, DstCpuMask);
    409     cpumask_set_cpu(idCpu2, DstCpuMask);
    410 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    411     cpus_clear(DstCpuMask);
    412     cpu_set(idCpu1, DstCpuMask);
    413     cpu_set(idCpu2, DstCpuMask);
    414 # endif
    415390
    416391    /*
     
    427402         * call wait ourselves.
    428403         */
     404# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     405        /* 2.6.28 introduces CONFIG_CPUMASK_OFFSTACK */
     406        cpumask_var_t DstCpuMask;
     407# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     408        cpumask_t   DstCpuMask;
     409# endif
    429410        RTCPUID     idCpuSelf = RTMpCpuId();
    430411        bool const  fCallSelf = idCpuSelf == idCpu1 || idCpuSelf == idCpu2;
     
    436417        Args.idCpu2  = idCpu2;
    437418        Args.cHits   = 0;
     419
     420# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     421        if (!zalloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
     422            return VERR_NO_MEMORY;
     423        cpumask_set_cpu(idCpu1, DstCpuMask);
     424        cpumask_set_cpu(idCpu2, DstCpuMask);
     425# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     426        if (!alloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
     427            return VERR_NO_MEMORY;
     428        cpumask_clear(DstCpuMask);
     429        cpumask_set_cpu(idCpu1, DstCpuMask);
     430        cpumask_set_cpu(idCpu2, DstCpuMask);
     431# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     432        cpus_clear(DstCpuMask);
     433        cpu_set(idCpu1, DstCpuMask);
     434        cpu_set(idCpu2, DstCpuMask);
     435# endif
    438436
    439437# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     
    470468        else
    471469            rc = VERR_CPU_IPE_1;
     470
     471# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     472        free_cpumask_var(DstCpuMask);
     473# endif
    472474    }
    473475    /*
     
    479481    else
    480482        rc = VERR_CPU_NOT_FOUND;
    481 
    482483    RTThreadPreemptRestore(&PreemptState);;
    483 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
    484     free_cpumask_var(DstCpuMask);
    485 # endif
    486484    IPRT_LINUX_RESTORE_EFL_AC();
    487485    return rc;
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