VirtualBox

Changeset 10418 in vbox


Ignore:
Timestamp:
Jul 9, 2008 1:45:07 PM (17 years ago)
Author:
vboxsync
Message:

New runtime functions fopr getting cpu frequency. Stubs only to far.

Location:
trunk
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mp.h

    r9611 r10418  
    5656 * Converts a CPU identifier to a CPU set index.
    5757 *
    58  * This may or may not validate the precense of the CPU.
     58 * This may or may not validate the presence of the CPU.
    5959 *
    6060 * @returns The CPU set index on success, -1 on failure.
     
    6666 * Converts a CPU set index to a a CPU identifier.
    6767 *
    68  * This may or may not validate the precense of the CPU, so, use
     68 * This may or may not validate the presence of the CPU, so, use
    6969 * RTMpIsCpuPossible for that.
    7070 *
     
    131131 */
    132132RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu);
     133
     134/**
     135 * Get the current CPU speed (in Mhz) of a CPU which is currently online.
     136 *
     137 * @returns CPU speed if CPU id is valid, 0 otherwise.
     138 */
     139RTDECL(uint32_t) RTMpGetCurFrequency(RTCPUID idCpu);
     140
     141
     142/**
     143 * Get the maximum CPU speed (in Mhz) of a CPU which is currently online.
     144 *
     145 * @returns CPU speed if CPU id is valid, 0 otherwise.
     146 */
     147RTDECL(uint32_t) RTMpGetMaxFrequency(RTCPUID idCpu);
    133148
    134149
  • trunk/src/VBox/Runtime/Makefile.kmk

    r10237 r10418  
    278278        generic/semnoint-generic.cpp \
    279279        generic/semsrw-generic.cpp \
     280        generic/RTMpGetCurFrequency-generic.cpp \
     281        generic/RTMpGetMaxFrequency-generic.cpp \
    280282        nt/RTErrConvertFromNtStatus.cpp \
    281283        r3/posix/env-posix.cpp \
     
    317319        generic/utf16locale-generic.cpp \
    318320        generic/uuid-generic.cpp \
     321        generic/RTMpGetCurFrequency-generic.cpp \
     322        generic/RTMpGetMaxFrequency-generic.cpp \
    319323        r3/linux/sched-linux.cpp \
    320324        r3/linux/time-linux.cpp \
     
    368372        generic/utf16locale-generic.cpp \
    369373        generic/uuid-generic.cpp \
     374        generic/RTMpGetCurFrequency-generic.cpp \
     375        generic/RTMpGetMaxFrequency-generic.cpp \
    370376        os2/RTErrConvertFromOS2.cpp \
    371377        r3/os2/filelock-os2.cpp \
     
    405411        generic/utf16locale-generic.cpp \
    406412        generic/uuid-generic.cpp\
     413        generic/RTMpGetCurFrequency-generic.cpp \
     414        generic/RTMpGetMaxFrequency-generic.cpp \
    407415        r3/darwin/alloc-darwin.cpp \
    408416        r3/darwin/filelock-darwin.cpp \
     
    440448        generic/utf16locale-generic.cpp \
    441449        generic/uuid-generic.cpp \
     450        generic/RTMpGetCurFrequency-generic.cpp \
     451        generic/RTMpGetMaxFrequency-generic.cpp \
    442452        r3/freebsd/alloc-freebsd.cpp \
    443453        r3/posix/dir-posix.cpp \
     
    476486        generic/utf16locale-generic.cpp \
    477487        generic/uuid-generic.cpp \
     488        generic/RTMpGetCurFrequency-generic.cpp \
     489        generic/RTMpGetMaxFrequency-generic.cpp \
    478490        r3/posix/dir-posix.cpp \
    479491        r3/posix/env-posix.cpp \
  • trunk/src/VBox/Runtime/generic/RTMpGetCurFrequency-generic.cpp

    r10409 r10418  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Multiprocessor, Generic RTMpGetOnlineCount.
     3 * IPRT - Multiprocessor, Generic RTMpGetCurFrequency.
    44 */
    55
     
    3737
    3838
    39 RTDECL(RTCPUID) RTMpGetOnlineCount(void)
     39RTDECL(RTCPUID) RTMpGetCurFrequency(void)
    4040{
    41     RTCPUSET Set;
    42     RTMpGetOnlineSet(&Set);
    43     return RTCpuSetCount(&Set);
     41    /** @note this is a generic stub which returns "unknown". */
     42    return 0;
    4443}
    4544
  • trunk/src/VBox/Runtime/generic/RTMpGetMaxFrequency-generic.cpp

    r10409 r10418  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Multiprocessor, Generic RTMpGetOnlineCount.
     3 * IPRT - Multiprocessor, Generic RTMpGetMaxFrequency.
    44 */
    55
     
    3737
    3838
    39 RTDECL(RTCPUID) RTMpGetOnlineCount(void)
     39RTDECL(RTCPUID) RTMpGetMaxFrequency(void)
    4040{
    41     RTCPUSET Set;
    42     RTMpGetOnlineSet(&Set);
    43     return RTCpuSetCount(&Set);
     41    /** @note this is a generic stub which returns "unknown". */
     42    return 0;
    4443}
    4544
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