1 | ; $Id: timesupA.asm 13832 2008-11-05 02:01:12Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; IPRT - Time using SUPLib, the Assembly Implementation.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 (GPL) as published by the Free Software
|
---|
13 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | ;
|
---|
17 | ; The contents of this file may alternatively be used under the terms
|
---|
18 | ; of the Common Development and Distribution License Version 1.0
|
---|
19 | ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | ; VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | ; CDDL are applicable instead of those of the GPL.
|
---|
22 | ;
|
---|
23 | ; You may elect to license modified versions of this file under the
|
---|
24 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | ;
|
---|
26 | ; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
27 | ; Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
28 | ; additional information or have any questions.
|
---|
29 | ;
|
---|
30 |
|
---|
31 | %ifndef IN_GUEST
|
---|
32 |
|
---|
33 | %include "iprt/asmdefs.mac"
|
---|
34 | %include "VBox/sup.mac"
|
---|
35 |
|
---|
36 |
|
---|
37 | ;; Keep this in sync with iprt/time.h.
|
---|
38 | struc RTTIMENANOTSDATA
|
---|
39 | .pu64Prev RTCCPTR_RES 1
|
---|
40 | .pfnBad RTCCPTR_RES 1
|
---|
41 | .pfnRediscover RTCCPTR_RES 1
|
---|
42 | .pvDummy RTCCPTR_RES 1
|
---|
43 | .c1nsSteps resd 1
|
---|
44 | .cExpired resd 1
|
---|
45 | .cBadPrev resd 1
|
---|
46 | .cUpdateRaces resd 1
|
---|
47 | endstruc
|
---|
48 |
|
---|
49 |
|
---|
50 | BEGINDATA
|
---|
51 | %undef IN_SUPLIB
|
---|
52 | %undef IMPORTED_SUPLIB
|
---|
53 | %ifdef IN_SUP_R0
|
---|
54 | %define IN_SUPLIB
|
---|
55 | %endif
|
---|
56 | %ifdef IN_SUP_R3
|
---|
57 | %define IN_SUPLIB
|
---|
58 | %endif
|
---|
59 | %ifdef IN_SUP_GC
|
---|
60 | %define IN_SUPLIB
|
---|
61 | %endif
|
---|
62 | %ifdef IN_SUPLIB
|
---|
63 | extern NAME(g_pSUPGlobalInfoPage)
|
---|
64 | %elifdef IN_RING0
|
---|
65 | %ifdef RT_OS_WINDOWS
|
---|
66 | %define IMPORTED_SUPLIB
|
---|
67 | extern IMPNAME(g_SUPGlobalInfoPage)
|
---|
68 | %else
|
---|
69 | extern NAME(g_SUPGlobalInfoPage)
|
---|
70 | %endif
|
---|
71 | %else
|
---|
72 | %ifdef RT_OS_WINDOWS
|
---|
73 | %define IMPORTED_SUPLIB
|
---|
74 | extern IMPNAME(g_pSUPGlobalInfoPage)
|
---|
75 | %else
|
---|
76 | extern NAME(g_pSUPGlobalInfoPage)
|
---|
77 | %endif
|
---|
78 | %endif
|
---|
79 |
|
---|
80 |
|
---|
81 | BEGINCODE
|
---|
82 |
|
---|
83 | ;
|
---|
84 | ; The default stuff that works everywhere.
|
---|
85 | ; Uses cpuid for serializing.
|
---|
86 | ;
|
---|
87 | %undef ASYNC_GIP
|
---|
88 | %undef USE_LFENCE
|
---|
89 | %define NEED_TRANSACTION_ID
|
---|
90 | %define NEED_TO_SAVE_REGS
|
---|
91 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLegacySync
|
---|
92 | %include "timesupA.mac"
|
---|
93 |
|
---|
94 | %define ASYNC_GIP
|
---|
95 | %ifdef IN_RC
|
---|
96 | %undef NEED_TRANSACTION_ID
|
---|
97 | %endif
|
---|
98 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLegacyAsync
|
---|
99 | %include "timesupA.mac"
|
---|
100 |
|
---|
101 | ;
|
---|
102 | ; Alternative implementation that employs lfence instead of cpuid.
|
---|
103 | ;
|
---|
104 | %undef ASYNC_GIP
|
---|
105 | %define USE_LFENCE
|
---|
106 | %define NEED_TRANSACTION_ID
|
---|
107 | %undef NEED_TO_SAVE_REGS
|
---|
108 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLFenceSync
|
---|
109 | %include "timesupA.mac"
|
---|
110 |
|
---|
111 | %define ASYNC_GIP
|
---|
112 | %ifdef IN_RC
|
---|
113 | %undef NEED_TRANSACTION_ID
|
---|
114 | %endif
|
---|
115 | %define rtTimeNanoTSInternalAsm RTTimeNanoTSLFenceAsync
|
---|
116 | %include "timesupA.mac"
|
---|
117 |
|
---|
118 |
|
---|
119 | %endif ; !IN_GUEST
|
---|