~ubuntu-branches/ubuntu/natty/virtualbox-ose/natty-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-10-15 02:12:28 UTC
  • mfrom: (0.3.10 upstream) (0.4.19 sid)
  • Revision ID: james.westby@ubuntu.com-20101015021228-5e6vbxgtes8mg189
Tags: 3.2.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - VirtualBox should go in Accessories, not in System tools.
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add ubuntu-01-fix-build-gcc45.patch to fix FTBFS due to uninitalized
  variables. Thanks to Lubomir Rintel <lkundrak@v3.sk> for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Revision: 60692 $ */
 
1
/* $Revision: 64889 $ */
2
2
/** @file
3
3
 * VBoxGuestLibR0 - IDC with VBoxGuest and HGCM helpers.
4
4
 */
52
52
 */
53
53
int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess, uint32_t fFlags)
54
54
{
55
 
    int rc = VINF_SUCCESS;
 
55
    int         rc = VINF_SUCCESS;
 
56
    RTR0MEMOBJ  MemObj = NIL_RTR0MEMOBJ;
 
57
    uint32_t    fAccess;
56
58
 
57
59
    /* Zero size buffers shouldn't be locked. */
58
60
    if (u32Size == 0)
105
107
     *       we lock both kernel pages on all systems, even those where we
106
108
     *       know they aren't pagable.
107
109
     */
108
 
    RTR0MEMOBJ  MemObj = NIL_RTR0MEMOBJ;
109
 
    uint32_t    fAccess = RTMEM_PROT_READ | (fWriteAccess ? RTMEM_PROT_WRITE : 0);
 
110
    fAccess = RTMEM_PROT_READ | (fWriteAccess ? RTMEM_PROT_WRITE : 0);
110
111
    if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER)
111
112
        rc = RTR0MemObjLockUser(&MemObj, (RTR3PTR)pv, u32Size, fAccess, NIL_RTR0PROCESS);
112
113
    else
123
124
 
124
125
void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size)
125
126
{
126
 
    NOREF(pv);
127
 
    NOREF(u32Size);
128
 
 
129
127
#ifdef RT_OS_WINDOWS
130
128
    PMDL pMdl = (PMDL)pvCtx;
131
129
 
142
140
    AssertRC(rc);
143
141
 
144
142
#endif
 
143
 
 
144
    NOREF(pv);
 
145
    NOREF(u32Size);
145
146
}
146
147
 
147
148
#else  /* !VBGL_VBOXGUEST */