Changeset 26058 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Jan 27, 2010 9:23:23 AM (15 years ago)
- 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 95 95 VBoxGuestR3LibTime.cpp \ 96 96 VBoxGuestR3LibVideo.cpp \ 97 VBoxGuestR3LibCpuHot plug.cpp97 VBoxGuestR3LibCpuHotPlug.cpp 98 98 ifeq ($(KBUILD_TARGET),win) ## @todo get rid of this hack (as soon as it's all implemented / #defined). 99 99 VBoxGuestR3Lib_SOURCES = \ -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp
r26014 r26058 5 5 6 6 /* 7 * Copyright (C) 20 07Sun Microsystems, Inc.7 * Copyright (C) 2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 #include "VBGLR3Internal.h" 27 27 28 29 /** 30 * Initialize CPU hot plugging. 31 * 32 * This will enable the CPU hot plugging events. 33 * 34 * @returns VBox status code. 35 */ 28 36 VBGLR3DECL(int) VbglR3CpuHotplugInit(void) 29 37 { 30 int rc = VINF_SUCCESS; 38 int rc = VbglR3CtlFilterMask(VMMDEV_EVENT_CPU_HOTPLUG, 0); 39 if (RT_FAILURE(rc)) 40 return rc; 41 31 42 VMMDevCpuHotPlugStatusRequest Req; 32 43 vmmdevInitRequest(&Req.header, VMMDevReq_SetCpuHotPlugStatus); 33 44 Req.enmStatusType = VMMDevCpuStatusType_Enable; 34 35 rc = VbglR3CtlFilterMask(VMMDEV_EVENT_CPU_HOTPLUG, 0);36 if (RT_FAILURE(rc))37 return rc;38 39 45 rc = vbglR3GRPerform(&Req.header); 40 46 if (RT_FAILURE(rc)) … … 44 50 } 45 51 52 53 /** 54 * Terminate CPU hot plugging. 55 * 56 * This will disable the CPU hot plugging events. 57 * 58 * @returns VBox status. 59 */ 46 60 VBGLR3DECL(int) VbglR3CpuHotplugTerm(void) 47 61 { 62 /* Clear the events. */ 63 VbglR3CtlFilterMask(0, VMMDEV_EVENT_CPU_HOTPLUG); 64 48 65 VMMDevCpuHotPlugStatusRequest Req; 49 66 vmmdevInitRequest(&Req.header, VMMDevReq_SetCpuHotPlugStatus); 50 67 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); 57 69 } 58 70 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 */ 59 80 VBGLR3DECL(int) VbglR3CpuHotplugWaitForEvent(VMMDevCpuEventType *penmEventType, uint32_t *pidCpuCore, uint32_t *pidCpuPackage) 60 81 { 82 AssertPtrReturn(penmEventType, VERR_INVALID_POINTER); 83 AssertPtrReturn(pidCpuCore, VERR_INVALID_POINTER); 84 AssertPtrReturn(pidCpuPackage, VERR_INVALID_POINTER); 85 61 86 VBoxGuestWaitEventInfo waitEvent; 62 int rc;63 64 AssertPtrReturn(penmEventType, VERR_INVALID_PARAMETER);65 AssertPtrReturn(pidCpuCore, VERR_INVALID_PARAMETER);66 AssertPtrReturn(pidCpuPackage, VERR_INVALID_PARAMETER);67 87 waitEvent.u32TimeoutIn = RT_INDEFINITE_WAIT; 68 88 waitEvent.u32EventMaskIn = VMMDEV_EVENT_CPU_HOTPLUG; 69 89 waitEvent.u32Result = VBOXGUEST_WAITEVENT_ERROR; 70 90 waitEvent.u32EventFlagsOut = 0; 71 rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));91 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent)); 72 92 if (RT_SUCCESS(rc)) 73 93 { … … 77 97 VMMDevGetCpuHotPlugRequest Req; 78 98 79 /* get the seamless changerequest */99 /* get the CPU hot plugging request */ 80 100 vmmdevInitRequest(&Req.header, VMMDevReq_GetCpuHotPlugRequest); 81 101 Req.idCpuCore = UINT32_MAX;
Note:
See TracChangeset
for help on using the changeset viewer.