VirtualBox

Changeset 40560 in vbox for trunk


Ignore:
Timestamp:
Mar 21, 2012 11:18:15 AM (13 years ago)
Author:
vboxsync
Message:

Additions/Common/VBoxGuest: put Solaris helper functions into their own file.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r40533 r40560  
    213213  PROGRAMS += tstVBoxGuest-solaris
    214214  tstVBoxGuest-solaris_TEMPLATE = VBOXR3TSTEXE
    215   tstVBoxGuest-solaris_SOURCES  = VBoxGuest-solaris-streams.c
     215  tstVBoxGuest-solaris_SOURCES  = \
     216        VBoxGuest-solaris-streams.c \
     217        testcase/tstVBoxGuest-solaris.c
    216218  tstVBoxGuest-solaris_DEFS     = TESTCASE
    217219  tstVBoxGuest-solaris_LIBS     = $(LIB_RUNTIME)
  • trunk/src/VBox/Additions/common/VBoxGuest/testcase/solaris.h

    r40552 r40560  
    352352#define putbq(...) do {} while(0)
    353353
     354/* Externally defined helpers. */
     355
     356extern void miocack(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData, int rc);
     357extern void miocnak(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData, int iErr);
     358extern int miocpullup(mblk_t *pMBlk, size_t cbMsg);
     359
    354360/* API stubs with simple logic */
    355361
     
    385391}
    386392
    387 static inline void miocack(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData,
    388                            int rc)
    389 {
    390     struct iocblk *pIOCBlk = (struct iocblk *)pMBlk->b_rptr;
    391 
    392     pMBlk->b_datap->db_type = M_IOCACK;
    393     pIOCBlk->ioc_count = cbData;
    394     pIOCBlk->ioc_error = 0;
    395     pIOCBlk->ioc_rval = rc;
    396     qreply(pWriteQueue, pMBlk);
    397 }
    398 
    399 static inline void miocnak(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData,
    400                            int iErr)
    401 {
    402     struct iocblk *pIOCBlk = (struct iocblk *)pMBlk->b_rptr;
    403 
    404     pMBlk->b_datap->db_type = M_IOCNAK;
    405     pIOCBlk->ioc_count = cbData;
    406     pIOCBlk->ioc_error = iErr;
    407     qreply(pWriteQueue, pMBlk);
    408 }
    409 
    410 /* This does not work like the real version, but does some sanity testing
    411  * and sets a flag. */
    412 static inline int miocpullup(mblk_t *pMBlk, size_t cbMsg)
    413 {
    414     struct iocblk *pIOCBlk = (struct iocblk *)pMBlk->b_rptr;
    415 
    416     if (pIOCBlk->ioc_count == TRANSPARENT)
    417         return EINVAL;
    418     if (   !pMBlk->b_cont
    419         || pMBlk->b_cont->b_wptr < pMBlk->b_cont->b_rptr + cbMsg)
    420         return EINVAL;
    421     pMBlk->b_flag = 1;  /* Test for this to be sure miocpullup was called. */
    422     return 0;
    423 }
    424 
    425393/* API stubs with controllable logic */
    426394
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