1 | /* $Id: mp-r0drv.h 85121 2020-07-08 19:33:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Multiprocessor, Ring-0 Driver, Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-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 | * 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 | #ifndef IPRT_INCLUDED_SRC_r0drv_mp_r0drv_h
|
---|
28 | #define IPRT_INCLUDED_SRC_r0drv_mp_r0drv_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <iprt/mp.h>
|
---|
34 |
|
---|
35 | RT_C_DECLS_BEGIN
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * MP callback
|
---|
39 | *
|
---|
40 | * @param idCpu CPU id
|
---|
41 | * @param pvUser1 The first user argument.
|
---|
42 | * @param pvUser2 The second user argument.
|
---|
43 | */
|
---|
44 | typedef DECLCALLBACKTYPE(void, FNMPWORKER,(RTCPUID idCpu, void *pvUser1, void *pvUser2));
|
---|
45 | /** Pointer to a FNMPWORKER(). */
|
---|
46 | typedef FNMPWORKER *PFNMPWORKER;
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * RTMpOn* argument packet used by the host specific callback
|
---|
50 | * wrapper functions.
|
---|
51 | */
|
---|
52 | typedef struct RTMPARGS
|
---|
53 | {
|
---|
54 | PFNMPWORKER pfnWorker;
|
---|
55 | void *pvUser1;
|
---|
56 | void *pvUser2;
|
---|
57 | RTCPUID idCpu;
|
---|
58 | RTCPUID idCpu2;
|
---|
59 | uint32_t volatile cHits;
|
---|
60 | #ifdef RT_OS_WINDOWS
|
---|
61 | /** Turns out that KeFlushQueuedDpcs doesn't necessarily wait till all
|
---|
62 | * callbacks are done. So, do reference counting to make sure we don't free
|
---|
63 | * this structure befor all CPUs have completely handled their requests. */
|
---|
64 | int32_t volatile cRefs;
|
---|
65 | #endif
|
---|
66 | #ifdef RT_OS_LINUX
|
---|
67 | PRTCPUSET pWorkerSet;
|
---|
68 | #endif
|
---|
69 | } RTMPARGS;
|
---|
70 | /** Pointer to a RTMpOn* argument packet. */
|
---|
71 | typedef RTMPARGS *PRTMPARGS;
|
---|
72 |
|
---|
73 | /* Called from initterm-r0drv.cpp: */
|
---|
74 | DECLHIDDEN(int) rtR0MpNotificationInit(void);
|
---|
75 | DECLHIDDEN(void) rtR0MpNotificationTerm(void);
|
---|
76 |
|
---|
77 | /* The following is only relevant when using mpnotifcation-r0drv.cpp: */
|
---|
78 | DECLHIDDEN(int) rtR0MpNotificationNativeInit(void);
|
---|
79 | DECLHIDDEN(void) rtR0MpNotificationNativeTerm(void);
|
---|
80 | DECLHIDDEN(void) rtMpNotificationDoCallbacks(RTMPEVENT enmEvent, RTCPUID idCpu);
|
---|
81 |
|
---|
82 | RT_C_DECLS_END
|
---|
83 |
|
---|
84 | #endif /* !IPRT_INCLUDED_SRC_r0drv_mp_r0drv_h */
|
---|
85 |
|
---|