Changeset 40820 in vbox
- Timestamp:
- Apr 7, 2012 9:01:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/VBox/sup.h (modified) (1 diff)
-
src/VBox/HostDrivers/Support/SUPLib.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r40777 r40820 1144 1144 */ 1145 1145 SUPR3DECL(int) SUPR3QueryVTCaps(uint32_t *pfCaps); 1146 1147 /** 1148 * Open the tracer. 1149 * 1150 * @returns VBox status code. 1151 * @param uCookie Cookie identifying the tracer we expect to talk to. 1152 * @param uArg Tracer specific open argument. 1153 */ 1154 SUPR3DECL(int) SUPR3TracerOpen(uint32_t uCookie, uintptr_t uArg); 1155 1156 /** 1157 * Closes the tracer. 1158 * 1159 * @returns VBox status code. 1160 */ 1161 SUPR3DECL(int) SUPR3TracerClose(void); 1162 1163 /** 1164 * Perform an I/O request on the tracer. 1165 * 1166 * @returns VBox status. 1167 * @param uCmd The tracer command. 1168 * @param uArg The argument. 1169 * @param piRetVal Where to store the tracer return value. 1170 */ 1171 SUPR3DECL(int) SUPR3TracerIoCtl(uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal); 1146 1172 1147 1173 /** @} */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r40763 r40820 2308 2308 } 2309 2309 2310 2311 SUPR3DECL(int) SUPR3TracerOpen(uint32_t uCookie, uintptr_t uArg) 2312 { 2313 /* fake */ 2314 if (RT_UNLIKELY(g_u32FakeMode)) 2315 return VINF_SUCCESS; 2316 2317 /* 2318 * Issue IOCtl to the SUPDRV kernel module. 2319 */ 2320 SUPTRACEROPEN Req; 2321 Req.Hdr.u32Cookie = g_u32Cookie; 2322 Req.Hdr.u32SessionCookie= g_u32SessionCookie; 2323 Req.Hdr.cbIn = SUP_IOCTL_TRACER_OPEN_SIZE_IN; 2324 Req.Hdr.cbOut = SUP_IOCTL_TRACER_OPEN_SIZE_OUT; 2325 Req.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT; 2326 Req.Hdr.rc = VERR_INTERNAL_ERROR; 2327 Req.u.In.uCookie = uCookie; 2328 Req.u.In.uArg = uArg; 2329 int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_TRACER_OPEN, &Req, SUP_IOCTL_TRACER_OPEN_SIZE); 2330 if (RT_SUCCESS(rc)) 2331 rc = Req.Hdr.rc; 2332 return rc; 2333 } 2334 2335 2336 SUPR3DECL(int) SUPR3TracerClose(void) 2337 { 2338 /* fake */ 2339 if (RT_UNLIKELY(g_u32FakeMode)) 2340 return VINF_SUCCESS; 2341 2342 /* 2343 * Issue IOCtl to the SUPDRV kernel module. 2344 */ 2345 SUPREQHDR Req; 2346 Req.u32Cookie = g_u32Cookie; 2347 Req.u32SessionCookie= g_u32SessionCookie; 2348 Req.cbIn = SUP_IOCTL_TRACER_OPEN_SIZE_IN; 2349 Req.cbOut = SUP_IOCTL_TRACER_OPEN_SIZE_OUT; 2350 Req.fFlags = SUPREQHDR_FLAGS_DEFAULT; 2351 Req.rc = VERR_INTERNAL_ERROR; 2352 int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_TRACER_CLOSE, &Req, SUP_IOCTL_TRACER_CLOSE_SIZE); 2353 if (RT_SUCCESS(rc)) 2354 rc = Req.rc; 2355 return rc; 2356 } 2357 2358 2359 SUPR3DECL(int) SUPR3TracerIoCtl(uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal) 2360 { 2361 /* fake */ 2362 if (RT_UNLIKELY(g_u32FakeMode)) 2363 { 2364 *piRetVal = -1; 2365 return VERR_NOT_SUPPORTED; 2366 } 2367 2368 /* 2369 * Issue IOCtl to the SUPDRV kernel module. 2370 */ 2371 SUPTRACERIOCTL Req; 2372 Req.Hdr.u32Cookie = g_u32Cookie; 2373 Req.Hdr.u32SessionCookie= g_u32SessionCookie; 2374 Req.Hdr.cbIn = SUP_IOCTL_TRACER_IOCTL_SIZE_IN; 2375 Req.Hdr.cbOut = SUP_IOCTL_TRACER_IOCTL_SIZE_OUT; 2376 Req.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT; 2377 Req.Hdr.rc = VERR_INTERNAL_ERROR; 2378 Req.u.In.uCmd = uCmd; 2379 Req.u.In.uArg = uArg; 2380 int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_TRACER_IOCTL, &Req, SUP_IOCTL_TRACER_IOCTL_SIZE); 2381 if (RT_SUCCESS(rc)) 2382 { 2383 rc = Req.Hdr.rc; 2384 *piRetVal = Req.u.Out.iRetVal; 2385 } 2386 return rc; 2387 } 2388
Note:
See TracChangeset
for help on using the changeset viewer.

