VirtualBox

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


Ignore:
Timestamp:
Feb 24, 2015 3:26:17 AM (10 years ago)
Author:
vboxsync
Message:

IPRT/r0drv/mp: Added RTMpCurSetIndex and RTMpCurSetIndexAndId.

Location:
trunk/src/VBox/Runtime/r0drv
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp

    r52618 r54415  
    7575{
    7676    return cpu_number();
     77}
     78
     79
     80RTDECL(int) RTMpCurSetIndex(void)
     81{
     82    return cpu_number();
     83}
     84
     85
     86RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     87{
     88    return *pidCpu = cpu_number();
    7789}
    7890
  • trunk/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c

    r52618 r54415  
    4141{
    4242    return curcpu;
     43}
     44
     45
     46RTDECL(int) RTMpCurSetIndex(void)
     47{
     48    return curcpu;
     49}
     50
     51
     52RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     53{
     54    return *pidCpu = curcpu;
    4355}
    4456
  • trunk/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c

    r52618 r54415  
    55
    66/*
    7  * Copyright (C) 2012-2014 Oracle Corporation
     7 * Copyright (C) 2012-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4141{
    4242    return smp_get_current_cpu();
     43}
     44
     45
     46RTDECL(int) RTMpCurSetIndex(void)
     47{
     48    return smp_get_current_cpu();
     49}
     50
     51
     52RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     53{
     54    return *pidCpu = smp_get_current_cpu();
    4355}
    4456
  • trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c

    r52618 r54415  
    4545}
    4646RT_EXPORT_SYMBOL(RTMpCpuId);
     47
     48
     49RTDECL(int) RTMpCurSetIndex(void)
     50{
     51    return smp_processor_id();
     52}
     53RT_EXPORT_SYMBOL(RTMpCurSetIndex);
     54
     55
     56RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     57{
     58    return *pidCpu = smp_processor_id();
     59}
     60RT_EXPORT_SYMBOL(RTMpCurSetIndexAndId);
    4761
    4862
  • trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp

    r54414 r54415  
    9292    /* WDK upgrade warning: PCR->Number changed from BYTE to WORD. */
    9393    return KeGetCurrentProcessorNumber();
     94}
     95
     96
     97RTDECL(int) RTMpCurSetIndex(void)
     98{
     99    /* WDK upgrade warning: PCR->Number changed from BYTE to WORD. */
     100    return KeGetCurrentProcessorNumber();
     101}
     102
     103
     104RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     105{
     106    return *pidCpu = KeGetCurrentProcessorNumber();
    94107}
    95108
  • trunk/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c

    r52618 r54415  
    5555{
    5656    return CPU->cpu_id;
     57}
     58
     59
     60RTDECL(int) RTMpCurSetIndex(void)
     61{
     62    return CPU->cpu_id;
     63}
     64
     65
     66RTDECL(int) RTMpCurSetIndexAndId(PRTCPUID pidCpu)
     67{
     68    return *pidCpu = CPU->cpu_id;
    5769}
    5870
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