- Timestamp:
- Mar 16, 2012 3:04:26 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuest
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris-streams.c
r40488 r40501 357 357 } 358 358 359 /** Resets (zeroes) a member in our open node state array in an IRQ-safe way. 360 */ 359 361 static void vbgr0SolResetSoftState(PVBGR0STATE pState) 360 362 { … … 451 453 } 452 454 qprocsoff(pState->pWriteQueue); 453 pState->pWriteQueue = NULL; 455 pSession = pState->pSession; 456 vbgr0SolResetSoftState(pState); 454 457 pReadQueue->q_ptr = NULL; 455 458 456 pSession = pState->pSession;457 pState->pSession = NULL;458 459 Log((DEVICE_NAME "::Close: pSession=%p pState=%p\n", pSession, pState)); 459 vbgr0SolResetSoftState(pState);460 460 if (!pSession) 461 461 { … … 470 470 return 0; 471 471 } 472 473 474 #ifdef TESTCASE 475 /** Simple test of vbgr0SolOpen and vbgr0SolClose. */ 476 void testOpenClose(RTTEST hTest) 477 { 478 queue_t aQueues[4]; 479 dev_t device = 0; 480 int rc; 481 482 RTTestSub(hTest, "Testing vbgr0SolOpen and vbgr0SolClose"); 483 RT_ZERO(g_aOpenNodeStates); 484 RT_ZERO(aQueues); 485 doInitQueues(&aQueues[0]); 486 doInitQueues(&aQueues[2]); 487 rc = vbgr0SolOpen(RD(&aQueues[0]), &device, 0, 0, NULL); 488 RTTEST_CHECK(hTest, rc == 0); 489 RTTEST_CHECK(hTest, g_aOpenNodeStates[1].pWriteQueue == WR(&aQueues[0])); 490 rc = vbgr0SolOpen(RD(&aQueues[2]), &device, 0, 0, NULL); 491 RTTEST_CHECK(hTest, rc == 0); 492 RTTEST_CHECK(hTest, g_aOpenNodeStates[2].pWriteQueue == WR(&aQueues[2])); 493 vbgr0SolClose(RD(&aQueues[0]), 0, NULL); 494 vbgr0SolClose(RD(&aQueues[1]), 0, NULL); 495 } 496 #endif 472 497 473 498 -
trunk/src/VBox/Additions/common/VBoxGuest/testcase/solaris.h
r40488 r40501 27 27 #include <time.h> /* struct timeval */ 28 28 29 /* Const#define MOD_NOAUTOUNLOAD 0x1ants */ 29 /* Overrides */ 30 #define dev_t unsigned 31 32 /* Constants */ 30 33 #define DDI_FAILURE (-1) 31 34 #define DDI_SUCCESS (0) … … 300 303 #define mod_remove(...) 0 301 304 #define mod_info(...) 0 302 #define makedevice(...) 0303 #define getmajor(...) 0304 305 #define RTR0Init(...) VINF_SUCCESS 305 306 #define RTR0Term(...) do {} while(0) … … 366 367 367 368 #define mod_install(linkage) (s_pvLinkage && ((linkage) == s_pvLinkage) ? 0 : EINVAL) 368 369 369 #define QREADR 0x00000010 370 370 #define WR(q) ((q)->q_flag & QREADR ? (q) + 1 : (q)) 371 371 #define RD(q) ((q)->q_flag & QREADR ? (q) : (q) - 1) 372 372 373 374 /* Basic initialisation of a queue structure pair for testing. */ 375 static inline void doInitQueues(queue_t aQueues[2]) 376 { 377 aQueues[0].q_flag = QREADR; 378 } 379 380 static inline dev_t makedevice(unsigned cMajor, unsigned cMinor) 381 { 382 return cMajor * 4096 + cMinor; 383 } 384 385 static inline unsigned getmajor(dev_t device) 386 { 387 return device / 4096; 388 } 389 373 390 /* API stubs with controllable logic */ 374 391 -
trunk/src/VBox/Additions/common/VBoxGuest/testcase/tstVBoxGuest-solaris.cpp
r40488 r40501 27 27 RTTestBanner(hTest); 28 28 test_init(hTest); 29 testOpenClose(hTest); 29 30 30 31 /* -
trunk/src/VBox/Additions/common/VBoxGuest/testcase/tstVBoxGuest-solaris.h
r40488 r40501 25 25 26 26 extern void test_init(RTTEST hTest); 27 extern void testOpenClose(RTTEST hTest); 27 28 28 29 RT_C_DECLS_END
Note:
See TracChangeset
for help on using the changeset viewer.