1 | ; $Id: timesupA.asm 5463 2007-10-24 03:11:06Z vboxsync $%ifndef IN_GUEST
|
---|
2 | ;; @file
|
---|
3 | ; innotek Portable Runtime - Time using SUPLib, the Assembly Implementation.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2007 InnoTek Systemberatung GmbH
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
11 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | ; General Public License as published by the Free Software Foundation,
|
---|
13 | ; in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | ; distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | ; be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | ;
|
---|
17 | ;
|
---|
18 |
|
---|
19 | %ifndef IN_GUEST
|
---|
20 |
|
---|
21 | %include "iprt/asmdefs.mac"
|
---|
22 | %include "VBox/sup.mac"
|
---|
23 |
|
---|
24 |
|
---|
25 | ;; Keep this in sync with iprt/time.h.
|
---|
26 | struc RTTIMENANOTSDATA
|
---|
27 | .pu64Prev RTCCPTR_RES 1
|
---|
28 | .pfnBad RTCCPTR_RES 1
|
---|
29 | .pfnRediscover RTCCPTR_RES 1
|
---|
30 | .pvDummy RTCCPTR_RES 1
|
---|
31 | .c1nsSteps resd 1
|
---|
32 | .cExpired resd 1
|
---|
33 | .cBadPrev resd 1
|
---|
34 | .cUpdateRaces resd 1
|
---|
35 | endstruc
|
---|
36 |
|
---|
37 |
|
---|
38 | BEGINDATA
|
---|
39 | extern NAME(g_pSUPGlobalInfoPage)
|
---|
40 |
|
---|
41 | BEGINCODE
|
---|
42 |
|
---|
43 | ;
|
---|
44 | ; The default stuff that works everywhere.
|
---|
45 | ; Uses cpuid for serializing.
|
---|
46 | ;
|
---|
47 | %undef ASYNC_GIP
|
---|
48 | %undef USE_LFENCE
|
---|
49 | %define NEED_TRANSACTION_ID
|
---|
50 | %define NEED_TO_SAVE_REGS
|
---|
51 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLegacySync
|
---|
52 | %include "timesupA.mac"
|
---|
53 |
|
---|
54 | %define ASYNC_GIP
|
---|
55 | %ifdef IN_GC
|
---|
56 | %undef NEED_TRANSACTION_ID
|
---|
57 | %endif
|
---|
58 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLegacyAsync
|
---|
59 | %include "timesupA.mac"
|
---|
60 |
|
---|
61 | ;
|
---|
62 | ; Alternative implementation that employs lfence instead of cpuid.
|
---|
63 | ;
|
---|
64 | %undef ASYNC_GIP
|
---|
65 | %define USE_LFENCE
|
---|
66 | %define NEED_TRANSACTION_ID
|
---|
67 | %undef NEED_TO_SAVE_REGS
|
---|
68 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLFenceSync
|
---|
69 | %include "timesupA.mac"
|
---|
70 |
|
---|
71 | %define ASYNC_GIP
|
---|
72 | %ifdef IN_GC
|
---|
73 | %undef NEED_TRANSACTION_ID
|
---|
74 | %endif
|
---|
75 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLFenceAsync
|
---|
76 | %include "timesupA.mac"
|
---|
77 |
|
---|
78 |
|
---|
79 | %endif ; !IN_GUEST
|
---|