VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp@ 56282

Last change on this file since 56282 was 55863, checked in by vboxsync, 10 years ago

IPRT,SUPDrv,VMM: Revised the context switching hook interface. Do less work when enabling the hook (formerly 'registration'). Drop the reference counting (kept internally for solaris) as it complicates restrictions wrt destroying enabled hooks. Bumped support driver version.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: threadctxhooks-r0drv-generic.cpp 55863 2015-05-14 18:29:34Z vboxsync $ */
2/** @file
3 * IPRT - Thread Context Switching Hook, Ring-0 Driver, Generic.
4 */
5
6/*
7 * Copyright (C) 2013-2015 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 * 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
27
28/*******************************************************************************
29* Header Files *
30*******************************************************************************/
31#include <iprt/thread.h>
32#include <iprt/err.h>
33
34#include "internal/iprt.h"
35
36RTDECL(int) RTThreadCtxHookCreate(PRTTHREADCTXHOOK phCtxHook, uint32_t fFlags, PFNRTTHREADCTXHOOK pfnCallback, void *pvUser)
37{
38 NOREF(phCtxHook);
39 NOREF(pfnCallback);
40 NOREF(pvUser);
41 return VERR_NOT_SUPPORTED;
42}
43RT_EXPORT_SYMBOL(RTThreadCtxHookCreate);
44
45
46RTDECL(int) RTThreadCtxHookDestroy(RTTHREADCTXHOOK hCtxHook)
47{
48 return hCtxHook == NIL_RTTHREADCTXHOOK ? VINF_SUCCESS : VERR_INVALID_HANDLE;
49}
50RT_EXPORT_SYMBOL(RTThreadCtxHookDestroy);
51
52
53RTDECL(int) RTThreadCtxHookEnable(RTTHREADCTXHOOK hCtxHook)
54{
55 NOREF(hCtxHook);
56 return VERR_NOT_SUPPORTED;
57}
58RT_EXPORT_SYMBOL(RTThreadCtxHookEnable);
59
60
61RTDECL(int) RTThreadCtxHookDisable(RTTHREADCTXHOOK hCtxHook)
62{
63 NOREF(hCtxHook);
64 return VERR_NOT_SUPPORTED;
65}
66RT_EXPORT_SYMBOL(RTThreadCtxHookDisable);
67
68
69RTDECL(bool) RTThreadCtxHookIsEnabled(RTTHREADCTXHOOK hCtxHook)
70{
71 NOREF(hCtxHook);
72 return false;
73}
74RT_EXPORT_SYMBOL(RTThreadCtxHookIsEnabled);
75
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette