VirtualBox

Changeset 26058 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jan 27, 2010 9:23:23 AM (15 years ago)
Author:
vboxsync
Message:

VBoxGuestR3LibCpuHotplug.cpp -> VBoxGuestR3LibCpuHotPlug.cpp; added missing docs and fix style.

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
1 edited
1 moved

Legend:

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

    r25975 r26058  
    9595        VBoxGuestR3LibTime.cpp \
    9696        VBoxGuestR3LibVideo.cpp \
    97         VBoxGuestR3LibCpuHotplug.cpp
     97        VBoxGuestR3LibCpuHotPlug.cpp
    9898ifeq ($(KBUILD_TARGET),win) ## @todo get rid of this hack (as soon as it's all implemented / #defined).
    9999 VBoxGuestR3Lib_SOURCES   = \
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp

    r26014 r26058  
    55
    66/*
    7  * Copyright (C) 2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626#include "VBGLR3Internal.h"
    2727
     28
     29/**
     30 * Initialize CPU hot plugging.
     31 *
     32 * This will enable the CPU hot plugging events.
     33 *
     34 * @returns VBox status code.
     35 */
    2836VBGLR3DECL(int) VbglR3CpuHotplugInit(void)
    2937{
    30     int rc = VINF_SUCCESS;
     38    int rc = VbglR3CtlFilterMask(VMMDEV_EVENT_CPU_HOTPLUG, 0);
     39    if (RT_FAILURE(rc))
     40        return rc;
     41
    3142    VMMDevCpuHotPlugStatusRequest Req;
    3243    vmmdevInitRequest(&Req.header, VMMDevReq_SetCpuHotPlugStatus);
    3344    Req.enmStatusType = VMMDevCpuStatusType_Enable;
    34 
    35     rc = VbglR3CtlFilterMask(VMMDEV_EVENT_CPU_HOTPLUG, 0);
    36     if (RT_FAILURE(rc))
    37         return rc;
    38 
    3945    rc = vbglR3GRPerform(&Req.header);
    4046    if (RT_FAILURE(rc))
     
    4450}
    4551
     52
     53/**
     54 * Terminate CPU hot plugging.
     55 *
     56 * This will disable the CPU hot plugging events.
     57 *
     58 * @returns VBox status.
     59 */
    4660VBGLR3DECL(int) VbglR3CpuHotplugTerm(void)
    4761{
     62    /* Clear the events. */
     63    VbglR3CtlFilterMask(0, VMMDEV_EVENT_CPU_HOTPLUG);
     64
    4865    VMMDevCpuHotPlugStatusRequest Req;
    4966    vmmdevInitRequest(&Req.header, VMMDevReq_SetCpuHotPlugStatus);
    5067    Req.enmStatusType = VMMDevCpuStatusType_Disable;
    51 
    52     /* Clear the events. */
    53     VbglR3CtlFilterMask(0, VMMDEV_EVENT_CPU_HOTPLUG);
    54 
    55     int rc = vbglR3GRPerform(&Req.header);
    56     return rc;
     68    return vbglR3GRPerform(&Req.header);
    5769}
    5870
     71
     72/**
     73 * Waits for a CPU hot plugging event and retrive the data associated with it.
     74 *
     75 * @returns VBox status code.
     76 * @param   penmEventType   Where to store the event type on success.
     77 * @param   pidCpuCore      Where to store the CPU core ID on success.
     78 * @param   pidCpuPackage   Where to store the CPU package ID on success.
     79 */
    5980VBGLR3DECL(int) VbglR3CpuHotplugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage)
    6081{
     82    AssertPtrReturn(penmEventType, VERR_INVALID_POINTER);
     83    AssertPtrReturn(pidCpuCore, VERR_INVALID_POINTER);
     84    AssertPtrReturn(pidCpuPackage, VERR_INVALID_POINTER);
     85
    6186    VBoxGuestWaitEventInfo waitEvent;
    62     int rc;
    63 
    64     AssertPtrReturn(penmEventType, VERR_INVALID_PARAMETER);
    65     AssertPtrReturn(pidCpuCore, VERR_INVALID_PARAMETER);
    66     AssertPtrReturn(pidCpuPackage, VERR_INVALID_PARAMETER);
    6787    waitEvent.u32TimeoutIn = RT_INDEFINITE_WAIT;
    6888    waitEvent.u32EventMaskIn = VMMDEV_EVENT_CPU_HOTPLUG;
    6989    waitEvent.u32Result = VBOXGUEST_WAITEVENT_ERROR;
    7090    waitEvent.u32EventFlagsOut = 0;
    71     rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));
     91    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));
    7292    if (RT_SUCCESS(rc))
    7393    {
     
    7797            VMMDevGetCpuHotPlugRequest Req;
    7898
    79             /* get the seamless change request */
     99            /* get the CPU hot plugging request */
    80100            vmmdevInitRequest(&Req.header, VMMDevReq_GetCpuHotPlugRequest);
    81101            Req.idCpuCore    = UINT32_MAX;
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