~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/HostDrivers/Support/SUPR0IdcClient.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: SUPR0IdcClient.c $ */
 
1
/* $Id: SUPR0IdcClient.c 33540 2010-10-28 09:27:05Z vboxsync $ */
2
2
/** @file
3
3
 * VirtualBox Support Driver - IDC Client Lib, Core.
4
4
 */
42
42
 * Opens the IDC interface of the support driver.
43
43
 *
44
44
 * This will perform basic version negotiations and fail if the
45
 
 * minmum requirements aren't met.
 
45
 * minimum requirements aren't met.
46
46
 *
47
47
 * @returns VBox status code.
48
48
 * @param   pHandle             The handle structure (output).
124
124
            &&  Req.u.Out.uSessionVersion >= uMinVersion
125
125
            &&  (Req.u.Out.uSessionVersion & UINT32_C(0xffff0000)) == (SUPDRV_IDC_VERSION & UINT32_C(0xffff0000)))
126
126
        {
127
 
            ASMAtomicCmpXchgPtr((void * volatile *)&g_pMainHandle, pHandle, NULL);
 
127
            ASMAtomicCmpXchgPtr(&g_pMainHandle, pHandle, NULL);
128
128
            return rc;
129
129
        }
130
130
 
166
166
    if (RT_SUCCESS(rc))
167
167
    {
168
168
        pHandle->s.pSession = NULL;
169
 
        ASMAtomicCmpXchgPtr((void * volatile *)&g_pMainHandle, NULL, pHandle);
 
169
        ASMAtomicCmpXchgPtr(&g_pMainHandle, NULL, pHandle);
170
170
    }
171
171
    return rc;
172
172
}
202
202
 */
203
203
PSUPDRVIDCHANDLE supR0IdcGetHandleFromSession(PSUPDRVSESSION pSession)
204
204
{
205
 
    PSUPDRVIDCHANDLE pHandle = (PSUPDRVIDCHANDLE)ASMAtomicUoReadPtr((void * volatile *)&g_pMainHandle);
 
205
    PSUPDRVIDCHANDLE pHandle = ASMAtomicUoReadPtrT(&g_pMainHandle, PSUPDRVIDCHANDLE);
206
206
    if (    VALID_PTR(pHandle)
207
207
        &&  pHandle->s.pSession == pSession)
208
208
        return pHandle;