VirtualBox

Changeset 67665 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Jun 28, 2017 3:10:11 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116471
Message:

Runtime/r0drv/linux: adapted to CONFIG_CPUMASK_OFFSTACK=y

File:
1 edited

Legend:

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

    r64785 r67665  
    385385         * call wait ourselves.
    386386         */
    387 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     387#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     388        /* 2.6.28 introduces CONFIG_CPUMASK_OFFSTACK */
     389        cpumask_var_t DstCpuMask;
     390#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    388391        cpumask_t   DstCpuMask;
    389392#endif
     
    398401        Args.cHits   = 0;
    399402
    400 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
    401         cpumask_clear(&DstCpuMask);
    402         cpumask_set_cpu(idCpu1, &DstCpuMask);
    403         cpumask_set_cpu(idCpu2, &DstCpuMask);
     403#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
     404        if (!zalloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
     405            return VERR_NO_MEMORY;
     406        cpumask_set_cpu(idCpu1, DstCpuMask);
     407        cpumask_set_cpu(idCpu2, DstCpuMask);
     408#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     409        if (!alloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
     410            return VERR_NO_MEMORY;
     411        cpumask_clear(DstCpuMask);
     412        cpumask_set_cpu(idCpu1, DstCpuMask);
     413        cpumask_set_cpu(idCpu2, DstCpuMask);
    404414#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    405415        cpus_clear(DstCpuMask);
     
    409419
    410420#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
    411         smp_call_function_many(&DstCpuMask, rtmpLinuxWrapperPostInc, &Args, !fCallSelf /* wait */);
     421        smp_call_function_many(DstCpuMask, rtmpLinuxWrapperPostInc, &Args, !fCallSelf /* wait */);
    412422        rc = 0;
    413423#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     
    441451        else
    442452            rc = VERR_CPU_IPE_1;
     453
     454#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
     455        free_cpumask_var(DstCpuMask);
     456#endif
    443457    }
    444458    /*
Note: See TracChangeset for help on using the changeset viewer.

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