Changeset 6156 in vbox for trunk/src/VBox
- Timestamp:
- Dec 19, 2007 5:46:03 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r5999 r6156 542 542 fadt.u16IAPCBOOTARCH = RT_H2LE_U16(IAPC_BOOT_ARCH_LEGACY_DEV | IAPC_BOOT_ARCH_8042); 543 543 /** @note WBINVD is required for ACPI versions newer than 1.0 */ 544 fadt.u32Flags = RT_H2LE_U32( FADT_FL_WBINVD | FADT_FL_SLP_BUTTON 545 | FADT_FL_FIX_RTC | FADT_FL_TMR_VAL_EXT); 544 fadt.u32Flags = RT_H2LE_U32( FADT_FL_WBINVD 545 | FADT_FL_FIX_RTC 546 | FADT_FL_TMR_VAL_EXT); 546 547 acpiWriteGenericAddr(&fadt.ResetReg, 1, 8, 0, 1, ACPI_RESET_BLK); 547 548 fadt.u8ResetVal = ACPI_RESET_REG_VAL; … … 741 742 ACPIState *s = IACPIPORT_2_ACPISTATE(pInterface); 742 743 update_pm1a (s, s->pm1a_sts | PWRBTN_STS, s->pm1a_en); 744 return VINF_SUCCESS; 745 } 746 747 /** 748 * Send an ACPI sleep button event. 749 * 750 * @returns VBox status code 751 * @param pInterface Pointer to the interface structure containing the called function pointer. 752 */ 753 static DECLCALLBACK(int) acpiSleepButtonPress(PPDMIACPIPORT pInterface) 754 { 755 ACPIState *s = IACPIPORT_2_ACPISTATE(pInterface); 756 update_pm1a (s, s->pm1a_sts | SLPBTN_STS, s->pm1a_en); 743 757 return VINF_SUCCESS; 744 758 } … … 1664 1678 s->IBase.pfnQueryInterface = acpiQueryInterface; 1665 1679 /* IACPIPort */ 1680 s->IACPIPort.pfnSleepButtonPress = acpiSleepButtonPress; 1666 1681 s->IACPIPort.pfnPowerButtonPress = acpiPowerButtonPress; 1667 1682 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r6103 r6156 404 404 RTPrintf("VBoxManage controlvm <uuid>|<name>\n" 405 405 " pause|resume|reset|poweroff|savestate|\n" 406 " acpipowerbutton 406 " acpipowerbutton|acpisleepbutton|\n" 407 407 " setlinkstate<1-4> on|off |\n" 408 408 " usbattach <uuid>|<address> |\n" … … 5326 5326 CHECK_ERROR_BREAK (console, PowerButton()); 5327 5327 } 5328 else if (strcmp(argv[1], "acpisleepbutton") == 0) 5329 { 5330 CHECK_ERROR_BREAK (console, SleepButton()); 5331 } 5328 5332 else if (strncmp(argv[1], "setlinkstate", 12) == 0) 5329 5333 { -
trunk/src/VBox/Main/ConsoleImpl.cpp
r5999 r6156 1540 1540 setError (E_FAIL, 1541 1541 tr ("Controlled power off failed (%Vrc)"), vrc); 1542 1543 LogFlowThisFunc (("rc=%08X\n", rc)); 1544 LogFlowThisFuncLeave(); 1545 return rc; 1546 } 1547 1548 STDMETHODIMP Console::SleepButton() 1549 { 1550 LogFlowThisFuncEnter(); 1551 1552 AutoCaller autoCaller (this); 1553 CheckComRCReturnRC (autoCaller.rc()); 1554 1555 AutoLock lock (this); 1556 1557 if (mMachineState != MachineState_Running) 1558 return setError (E_FAIL, tr ("Cannot send the sleep button event as it is " 1559 "not running (machine state: %d)"), 1560 mMachineState); 1561 1562 /* protect mpVM */ 1563 AutoVMCaller autoVMCaller (this); 1564 CheckComRCReturnRC (autoVMCaller.rc()); 1565 1566 PPDMIBASE pBase; 1567 int vrc = PDMR3QueryDeviceLun (mpVM, "acpi", 0, 0, &pBase); 1568 if (VBOX_SUCCESS (vrc)) 1569 { 1570 Assert (pBase); 1571 PPDMIACPIPORT pPort = 1572 (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT); 1573 vrc = pPort ? pPort->pfnSleepButtonPress(pPort) : VERR_INVALID_POINTER; 1574 } 1575 1576 HRESULT rc = VBOX_SUCCESS (vrc) ? S_OK : 1577 setError (E_FAIL, 1578 tr ("Sending sleep button event failed (%Vrc)"), vrc); 1542 1579 1543 1580 LogFlowThisFunc (("rc=%08X\n", rc)); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r6076 r6156 3758 3758 </method> 3759 3759 3760 <method name="sleepButton"> 3761 <desc>Send the ACPI sleep button event to the guest.</desc> 3762 </method> 3763 3760 3764 <method name="saveState"> 3761 3765 <desc> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r5999 r6156 126 126 STDMETHOD(Resume)(); 127 127 STDMETHOD(PowerButton)(); 128 STDMETHOD(SleepButton)(); 128 129 STDMETHOD(SaveState) (IProgress **aProgress); 129 130 STDMETHOD(AdoptSavedState) (INPTR BSTR aSavedStateFile);
Note:
See TracChangeset
for help on using the changeset viewer.