VirtualBox

source: vbox/trunk/src/VBox/VMM/include/TMInline.h@ 84044

Last change on this file since 84044 was 82968, checked in by vboxsync, 4 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/* $Id: TMInline.h 82968 2020-02-04 10:35:17Z vboxsync $ */
2/** @file
3 * TM - Common Inlined functions.
4 */
5
6/*
7 * Copyright (C) 2006-2020 Oracle Corporation
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
18#ifndef VMM_INCLUDED_SRC_include_TMInline_h
19#define VMM_INCLUDED_SRC_include_TMInline_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24
25/**
26 * Used to unlink a timer from the active list.
27 *
28 * @param pQueue The timer queue.
29 * @param pTimer The timer that needs linking.
30 *
31 * @remarks Called while owning the relevant queue lock.
32 */
33DECL_FORCE_INLINE(void) tmTimerQueueUnlinkActive(PTMTIMERQUEUE pQueue, PTMTIMER pTimer)
34{
35#ifdef VBOX_STRICT
36 TMTIMERSTATE const enmState = pTimer->enmState;
37 Assert( pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC
38 ? enmState == TMTIMERSTATE_ACTIVE
39 : enmState == TMTIMERSTATE_PENDING_SCHEDULE || enmState == TMTIMERSTATE_PENDING_STOP_SCHEDULE);
40#endif
41
42 const PTMTIMER pPrev = TMTIMER_GET_PREV(pTimer);
43 const PTMTIMER pNext = TMTIMER_GET_NEXT(pTimer);
44 if (pPrev)
45 TMTIMER_SET_NEXT(pPrev, pNext);
46 else
47 {
48 TMTIMER_SET_HEAD(pQueue, pNext);
49 pQueue->u64Expire = pNext ? pNext->u64Expire : INT64_MAX;
50 DBGFTRACE_U64_TAG(pTimer->CTX_SUFF(pVM), pQueue->u64Expire, "tmTimerQueueUnlinkActive");
51 }
52 if (pNext)
53 TMTIMER_SET_PREV(pNext, pPrev);
54 pTimer->offNext = 0;
55 pTimer->offPrev = 0;
56}
57
58#endif /* !VMM_INCLUDED_SRC_include_TMInline_h */
59
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use