VirtualBox

Ignore:
Timestamp:
Feb 13, 2015 5:13:44 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98264
Message:

IPRT,TM: Implemented GIP TSC delta processing in the RTTimeNanoTS code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/time/timesupref.cpp

    r48935 r54202  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4040
    4141
     42#define GIP_MODE_SYNC_NO_DELTA          1
     43#define GIP_MODE_SYNC_WITH_DELTA        2
     44#define GIP_MODE_ASYNC                  3
     45#define GIP_MODE_INVARIANT_NO_DELTA     4
     46#define GIP_MODE_INVARIANT_WITH_DELTA   5
     47#define IS_GIP_MODE_WITH_DELTA(a_enmMode) \
     48    ((a_enmMode) == GIP_MODE_SYNC_WITH_DELTA || (a_enmMode) == GIP_MODE_INVARIANT_WITH_DELTA)
     49
     50
    4251/*
    4352 * Use the CPUID instruction for some kind of serialization.
    4453 */
    45 #undef  ASYNC_GIP
     54#define GIP_MODE GIP_MODE_SYNC_NO_DELTA
    4655#undef  USE_LFENCE
    4756#define NEED_TRANSACTION_ID
    48 #define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySync
     57#define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncNoDelta
    4958#include "timesupref.h"
    50 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySync);
     59RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncNoDelta);
    5160
    52 #define ASYNC_GIP
     61#undef  GIP_MODE
     62#define GIP_MODE  GIP_MODE_SYNC_NO_DELTA
     63#undef  rtTimeNanoTSInternalRef
     64#define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncWithDelta
     65#include "timesupref.h"
     66RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncWithDelta);
     67
     68#undef  GIP_MODE
     69#define GIP_MODE GIP_MODE_ASYNC
    5370#ifdef IN_RC
    5471# undef NEED_TRANSACTION_ID
     
    5976RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsync);
    6077
     78#undef  GIP_MODE
     79#define GIP_MODE GIP_MODE_INVARIANT_NO_DELTA
     80#undef  NEED_TRANSACTION_ID
     81#define NEED_TRANSACTION_ID
     82#undef  rtTimeNanoTSInternalRef
     83#define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyInvariantNoDelta
     84#include "timesupref.h"
     85RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyInvariantNoDelta);
     86
     87#undef  GIP_MODE
     88#define GIP_MODE GIP_MODE_INVARIANT_WITH_DELTA
     89#undef  rtTimeNanoTSInternalRef
     90#define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyInvariantWithDelta
     91#include "timesupref.h"
     92RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyInvariantWithDelta);
     93
    6194
    6295/*
    6396 * Use LFENCE for load serialization.
    6497 */
    65 #undef  ASYNC_GIP
     98#undef  GIP_MODE
     99#define GIP_MODE GIP_MODE_SYNC_NO_DELTA
    66100#define USE_LFENCE
    67101#undef  NEED_TRANSACTION_ID
    68102#define NEED_TRANSACTION_ID
    69103#undef  rtTimeNanoTSInternalRef
    70 #define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSync
     104#define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncNoDelta
    71105#include "timesupref.h"
    72 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSync);
     106RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncNoDelta);
    73107
    74 #define ASYNC_GIP
     108#undef  GIP_MODE
     109#define GIP_MODE GIP_MODE_SYNC_WITH_DELTA
     110#undef  rtTimeNanoTSInternalRef
     111#define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncWithDelta
     112#include "timesupref.h"
     113RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncWithDelta);
     114
     115#undef  GIP_MODE
     116#define GIP_MODE GIP_MODE_ASYNC
    75117#ifdef IN_RC
    76118# undef NEED_TRANSACTION_ID
     
    81123RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsync);
    82124
     125#undef  GIP_MODE
     126#define GIP_MODE GIP_MODE_INVARIANT_NO_DELTA
     127#undef  NEED_TRANSACTION_ID
     128#define NEED_TRANSACTION_ID
     129#undef  rtTimeNanoTSInternalRef
     130#define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceInvariantNoDelta
     131#include "timesupref.h"
     132RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceInvariantNoDelta);
     133
     134#undef  GIP_MODE
     135#define GIP_MODE GIP_MODE_INVARIANT_WITH_DELTA
     136#undef  rtTimeNanoTSInternalRef
     137#define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceInvariantWithDelta
     138#include "timesupref.h"
     139RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceInvariantWithDelta);
     140
    83141
    84142#endif /* !IN_GUEST && !RT_NO_GIP */
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