VirtualBox

Changeset 40501 in vbox for trunk


Ignore:
Timestamp:
Mar 16, 2012 3:04:26 PM (13 years ago)
Author:
vboxsync
Message:

Additions/VBoxGuest: next drop of the Solaris STREAMS code.

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  
    357357}
    358358
     359/** Resets (zeroes) a member in our open node state array in an IRQ-safe way.
     360 */
    359361static void vbgr0SolResetSoftState(PVBGR0STATE pState)
    360362{
     
    451453    }
    452454    qprocsoff(pState->pWriteQueue);
    453     pState->pWriteQueue = NULL;
     455    pSession = pState->pSession;
     456    vbgr0SolResetSoftState(pState);
    454457    pReadQueue->q_ptr = NULL;
    455458
    456     pSession = pState->pSession;
    457     pState->pSession = NULL;
    458459    Log((DEVICE_NAME "::Close: pSession=%p pState=%p\n", pSession, pState));
    459     vbgr0SolResetSoftState(pState);
    460460    if (!pSession)
    461461    {
     
    470470    return 0;
    471471}
     472
     473
     474#ifdef TESTCASE
     475/** Simple test of vbgr0SolOpen and vbgr0SolClose. */
     476void 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
    472497
    473498
  • trunk/src/VBox/Additions/common/VBoxGuest/testcase/solaris.h

    r40488 r40501  
    2727#include <time.h>  /* struct timeval */
    2828
    29 /* Const#define MOD_NOAUTOUNLOAD        0x1ants */
     29/* Overrides */
     30#define dev_t unsigned
     31
     32/* Constants */
    3033#define DDI_FAILURE (-1)
    3134#define DDI_SUCCESS (0)
     
    300303#define mod_remove(...) 0
    301304#define mod_info(...) 0
    302 #define makedevice(...) 0
    303 #define getmajor(...) 0
    304305#define RTR0Init(...) VINF_SUCCESS
    305306#define RTR0Term(...) do {} while(0)
     
    366367
    367368#define mod_install(linkage) (s_pvLinkage && ((linkage) == s_pvLinkage) ? 0 : EINVAL)
    368 
    369369#define QREADR          0x00000010
    370370#define         WR(q)          ((q)->q_flag & QREADR ? (q) + 1 : (q))
    371371#define         RD(q)          ((q)->q_flag & QREADR ? (q) : (q) - 1)
    372372
     373
     374/* Basic initialisation of a queue structure pair for testing. */
     375static inline void doInitQueues(queue_t aQueues[2])
     376{
     377    aQueues[0].q_flag = QREADR;
     378}
     379
     380static inline dev_t makedevice(unsigned cMajor, unsigned cMinor)
     381{
     382    return cMajor * 4096 + cMinor;
     383}
     384
     385static inline unsigned getmajor(dev_t device)
     386{
     387    return device / 4096;
     388}
     389
    373390/* API stubs with controllable logic */
    374391
  • trunk/src/VBox/Additions/common/VBoxGuest/testcase/tstVBoxGuest-solaris.cpp

    r40488 r40501  
    2727    RTTestBanner(hTest);
    2828    test_init(hTest);
     29    testOpenClose(hTest);
    2930
    3031    /*
  • trunk/src/VBox/Additions/common/VBoxGuest/testcase/tstVBoxGuest-solaris.h

    r40488 r40501  
    2525
    2626extern void test_init(RTTEST hTest);
     27extern void testOpenClose(RTTEST hTest);
    2728
    2829RT_C_DECLS_END
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette