Changeset 81388 in vbox
- Timestamp:
- Oct 20, 2019 11:15:06 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134101
- Location:
- trunk
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/PDMInternal.h
r81375 r81388 976 976 977 977 978 /** @name PDM task structures. 979 * @{ */ 980 981 /** 982 * A asynchronous user mode task. 983 */ 984 typedef struct PDMTASK 985 { 986 /** Task owner type. */ 987 PDMTASKTYPE volatile enmType; 988 /** Queue flags. */ 989 uint32_t volatile fFlags; 990 /** User argument for the callback. */ 991 R3PTRTYPE(void *) volatile pvUser; 992 /** The callback (will be cast according to enmType before callout). */ 993 R3PTRTYPE(PFNRT) volatile pfnCallback; 994 /** The owner identifier. */ 995 R3PTRTYPE(void *) volatile pvOwner; 996 /** Task name. */ 997 R3PTRTYPE(const char *) pszName; 998 } PDMTASK; 999 /** Pointer to a PDM task. */ 1000 typedef PDMTASK *PPDMTASK; 1001 1002 /** 1003 * A task set. 1004 * 1005 * This is served by one task executor thread. 1006 */ 1007 typedef struct PDMTASKSET 1008 { 1009 /** Magic value (PDMTASKSET_MAGIC). */ 1010 uint32_t u32Magic; 1011 /** Set if this task set works for ring-0 and raw-mode. */ 1012 bool fRZEnabled; 1013 /** Number of allocated taks. */ 1014 uint8_t volatile cAllocated; 1015 /** Base handle value for this set. */ 1016 uint16_t uHandleBase; 1017 /** The task executor thread. */ 1018 R3PTRTYPE(RTTHREAD) hThread; 1019 /** Event semaphore for waking up the thread when fRZEnabled is set. */ 1020 SUPSEMEVENT hEventR0; 1021 /** Event semaphore for waking up the thread when fRZEnabled is clear. */ 1022 R3PTRTYPE(RTSEMEVENT) hEventR3; 1023 /** Padding so fTriggered is in its own cacheline. */ 1024 uint64_t au64Padding2[4]; 1025 1026 /** Bitmask of triggered tasks. */ 1027 uint64_t volatile fTriggered; 1028 /** Shutdown thread indicator. */ 1029 bool volatile fShutdown; 1030 /** Padding. */ 1031 bool volatile afPadding3[3]; 1032 /** Task currently running, UINT32_MAX if idle. */ 1033 uint32_t volatile idxRunning; 1034 /** Padding so fTriggered and fShutdown are in their own cacheline. */ 1035 uint64_t volatile au64Padding3[6]; 1036 1037 /** The individual tasks. (Unallocated tasks have NULL pvOwner.) */ 1038 PDMTASK aTasks[64]; 1039 } PDMTASKSET; 1040 AssertCompileMemberAlignment(PDMTASKSET, fTriggered, 64); 1041 AssertCompileMemberAlignment(PDMTASKSET, aTasks, 64); 1042 /** Magic value for PDMTASKSET::u32Magic. */ 1043 #define PDMTASKSET_MAGIC UINT32_C(0x19320314) 1044 /** Pointer to a task set. */ 1045 typedef PDMTASKSET *PPDMTASKSET; 1046 1047 /** @} */ 1048 1049 978 1050 /** 979 1051 * Queue device helper task operation. … … 1133 1205 PDMCRITSECT NopCritSect; 1134 1206 1207 /** The ring-0 capable task sets (max 128). */ 1208 PDMTASKSET aTaskSets[2]; 1209 /** Pointer to task sets (max 512). */ 1210 R3PTRTYPE(PPDMTASKSET) apTaskSets[8]; 1211 1212 /** PCI Buses. */ 1213 PDMPCIBUS aPciBuses[PDM_PCI_BUSSES_MAX]; 1214 /** The register PIC device. */ 1215 PDMPIC Pic; 1216 /** The registered APIC device. */ 1217 PDMAPIC Apic; 1218 /** The registered I/O APIC device. */ 1219 PDMIOAPIC IoApic; 1220 1135 1221 /** List of registered devices. (FIFO) */ 1136 1222 R3PTRTYPE(PPDMDEV) pDevs; … … 1145 1231 /** The registered firmware device (can be NULL). */ 1146 1232 R3PTRTYPE(PPDMFW) pFirmware; 1147 /** PCI Buses. */1148 PDMPCIBUS aPciBuses[PDM_PCI_BUSSES_MAX];1149 /** The register PIC device. */1150 PDMPIC Pic;1151 /** The registered APIC device. */1152 PDMAPIC Apic;1153 /** The registered I/O APIC device. */1154 PDMIOAPIC IoApic;1155 1233 /** The registered DMAC device. */ 1156 1234 R3PTRTYPE(PPDMDMAC) pDmac; … … 1160 1238 R3PTRTYPE(PPDMUSBHUB) pUsbHubs; 1161 1239 1240 /** @name Queues 1241 * @{ */ 1162 1242 /** Queue in which devhlp tasks are queued for R3 execution - R3 Ptr. */ 1163 1243 R3PTRTYPE(PPDMQUEUE) pDevHlpQueueR3; … … 1175 1255 * See PDM_QUEUE_FLUSH_FLAG_ACTIVE and PDM_QUEUE_FLUSH_FLAG_PENDING. */ 1176 1256 uint32_t volatile fQueueFlushing; 1257 /** @} */ 1177 1258 1178 1259 /** The current IRQ tag (tracing purposes). */ … … 1216 1297 STAMCOUNTER StatQueuedCritSectLeaves; 1217 1298 } PDM; 1299 AssertCompileMemberAlignment(PDM, CritSect, 8); 1300 AssertCompileMemberAlignment(PDM, aTaskSets, 64); 1301 AssertCompileMemberAlignment(PDM, StatQueuedCritSectLeaves, 8); 1218 1302 AssertCompileMemberAlignment(PDM, GCPhysVMMDevHeap, sizeof(RTGCPHYS)); 1219 AssertCompileMemberAlignment(PDM, CritSect, 8);1220 AssertCompileMemberAlignment(PDM, StatQueuedCritSectLeaves, 8);1221 1303 /** Pointer to PDM VM instance data. */ 1222 1304 typedef PDM *PPDM; … … 1385 1467 void pdmR3QueueRelocate(PVM pVM, RTGCINTPTR offDelta); 1386 1468 1469 int pdmR3TaskInit(PVM pVM); 1470 void pdmR3TaskTerm(PVM pVM); 1471 1387 1472 int pdmR3ThreadCreateDevice(PVM pVM, PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread, 1388 1473 PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
Note:
See TracChangeset
for help on using the changeset viewer.