- Timestamp:
- Mar 27, 2009 4:39:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r18191 r18370 288 288 if (RT_SUCCESS(rc)) 289 289 { 290 g_u32Cookie = CookieReq.u.Out.u32Cookie;291 g_u32SessionCookie = CookieReq.u.Out.u32SessionCookie;292 g_pSession = CookieReq.u.Out.pSession;293 g_pFunctions = pFuncsReq;294 if (ppSession)295 *ppSession = CookieReq.u.Out.pSession;296 297 290 /* 298 291 * Map the GIP into userspace. 299 * This is an optional feature, so we will ignore any failures here.300 292 */ 301 if (!g_pSUPGlobalInfoPage) 293 Assert(!g_pSUPGlobalInfoPage); 294 SUPGIPMAP GipMapReq; 295 GipMapReq.Hdr.u32Cookie = g_u32Cookie; 296 GipMapReq.Hdr.u32SessionCookie = g_u32SessionCookie; 297 GipMapReq.Hdr.cbIn = SUP_IOCTL_GIP_MAP_SIZE_IN; 298 GipMapReq.Hdr.cbOut = SUP_IOCTL_GIP_MAP_SIZE_OUT; 299 GipMapReq.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT; 300 GipMapReq.Hdr.rc = VERR_INTERNAL_ERROR; 301 GipMapReq.u.Out.HCPhysGip = NIL_RTHCPHYS; 302 GipMapReq.u.Out.pGipR0 = NIL_RTR0PTR; 303 GipMapReq.u.Out.pGipR3 = NULL; 304 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_GIP_MAP, &GipMapReq, SUP_IOCTL_GIP_MAP_SIZE); 305 if (RT_SUCCESS(rc)) 306 rc = GipMapReq.Hdr.rc; 307 if (RT_SUCCESS(rc)) 302 308 { 303 SUPGIPMAP GipMapReq; 304 GipMapReq.Hdr.u32Cookie = g_u32Cookie; 305 GipMapReq.Hdr.u32SessionCookie = g_u32SessionCookie; 306 GipMapReq.Hdr.cbIn = SUP_IOCTL_GIP_MAP_SIZE_IN; 307 GipMapReq.Hdr.cbOut = SUP_IOCTL_GIP_MAP_SIZE_OUT; 308 GipMapReq.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT; 309 GipMapReq.Hdr.rc = VERR_INTERNAL_ERROR; 310 GipMapReq.u.Out.HCPhysGip = NIL_RTHCPHYS; 311 GipMapReq.u.Out.pGipR0 = NIL_RTR0PTR; 312 GipMapReq.u.Out.pGipR3 = NULL; 313 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_GIP_MAP, &GipMapReq, SUP_IOCTL_GIP_MAP_SIZE); 314 if (RT_SUCCESS(rc)) 315 rc = GipMapReq.Hdr.rc; 316 if (RT_SUCCESS(rc)) 317 { 318 AssertRelease(GipMapReq.u.Out.pGipR3->u32Magic == SUPGLOBALINFOPAGE_MAGIC); 319 AssertRelease(GipMapReq.u.Out.pGipR3->u32Version >= SUPGLOBALINFOPAGE_VERSION); 320 ASMAtomicXchgSize(&g_HCPhysSUPGlobalInfoPage, GipMapReq.u.Out.HCPhysGip); 321 ASMAtomicCmpXchgPtr((void * volatile *)&g_pSUPGlobalInfoPage, GipMapReq.u.Out.pGipR3, NULL); 322 ASMAtomicCmpXchgPtr((void * volatile *)&g_pSUPGlobalInfoPageR0, (void *)GipMapReq.u.Out.pGipR0, NULL); 323 } 309 AssertRelease(GipMapReq.u.Out.pGipR3->u32Magic == SUPGLOBALINFOPAGE_MAGIC); 310 AssertRelease(GipMapReq.u.Out.pGipR3->u32Version >= SUPGLOBALINFOPAGE_VERSION); 311 312 /* 313 * Set the globals and return success. 314 */ 315 ASMAtomicXchgSize(&g_HCPhysSUPGlobalInfoPage, GipMapReq.u.Out.HCPhysGip); 316 ASMAtomicCmpXchgPtr((void * volatile *)&g_pSUPGlobalInfoPage, GipMapReq.u.Out.pGipR3, NULL); 317 ASMAtomicCmpXchgPtr((void * volatile *)&g_pSUPGlobalInfoPageR0, (void *)GipMapReq.u.Out.pGipR0, NULL); 318 319 g_u32Cookie = CookieReq.u.Out.u32Cookie; 320 g_u32SessionCookie = CookieReq.u.Out.u32SessionCookie; 321 g_pSession = CookieReq.u.Out.pSession; 322 g_pFunctions = pFuncsReq; 323 if (ppSession) 324 *ppSession = CookieReq.u.Out.pSession; 325 return VINF_SUCCESS; 324 326 } 325 return rc;326 327 } 327 328
Note:
See TracChangeset
for help on using the changeset viewer.