void
IOBuffer::_UnlockMemory(team_id team, size_t count, bool isWrite)
{
	for (uint32 i = 0; i < count; i++) {
		unlock_memory_etc(team, (void*)(addr_t)fVecs[i].base, fVecs[i].length,
			isWrite ? 0 : B_READ_DEVICE);
	}
}
示例#2
0
void
IOBuffer::_UnlockMemory(team_id team, size_t count, bool isWrite)
{
	for (uint32 i = 0; i < count; i++) {
		unlock_memory_etc(team, fVecs[i].iov_base, fVecs[i].iov_len,
			isWrite ? 0 : B_READ_DEVICE);
	}
}
示例#3
0
int rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
{
    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)pMem;
    int rc = B_OK;

    switch (pMemHaiku->Core.enmType)
    {
    case RTR0MEMOBJTYPE_PAGE:
    case RTR0MEMOBJTYPE_LOW:
    case RTR0MEMOBJTYPE_CONT:
    case RTR0MEMOBJTYPE_MAPPING:
    case RTR0MEMOBJTYPE_PHYS:
    case RTR0MEMOBJTYPE_PHYS_NC:
    {
        if (pMemHaiku->AreaId > -1)
            rc = delete_area(pMemHaiku->AreaId);

        AssertMsg(rc == B_OK, ("%#x", rc));
        break;
    }

    case RTR0MEMOBJTYPE_LOCK:
    {
        team_id team = B_SYSTEM_TEAM;

        if (pMemHaiku->Core.u.Lock.R0Process != NIL_RTR0PROCESS)
            team = ((team_id)pMemHaiku->Core.u.Lock.R0Process);

        rc = unlock_memory_etc(team, pMemHaiku->Core.pv, pMemHaiku->Core.cb, B_READ_DEVICE);
        AssertMsg(rc == B_OK, ("%#x", rc));
        break;
    }

    case RTR0MEMOBJTYPE_RES_VIRT:
    {
        team_id team = B_SYSTEM_TEAM;
        if (pMemHaiku->Core.u.Lock.R0Process != NIL_RTR0PROCESS)
            team = ((team_id)pMemHaiku->Core.u.Lock.R0Process);

        rc = vm_unreserve_address_range(team, pMemHaiku->Core.pv, pMemHaiku->Core.cb);
        AssertMsg(rc == B_OK, ("%#x", rc));
        break;
    }

    default:
        AssertMsgFailed(("enmType=%d\n", pMemHaiku->Core.enmType));
        return VERR_INTERNAL_ERROR;
    }

    return VINF_SUCCESS;
}