power.h revision 590bfe12ce22cd3716448fbb9f4dc51664bfe5e2
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * IPRT - Power management.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * available from http://www.virtualbox.org. This file is free software;
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * you can redistribute it and/or modify it under the terms of the GNU
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * General Public License (GPL) as published by the Free Software
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * The contents of this file may alternatively be used under the terms
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * of the Common Development and Distribution License Version 1.0
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * VirtualBox OSE distribution, in which case the provisions of the
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * CDDL are applicable instead of those of the GPL.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * You may elect to license modified versions of this file under the
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * terms and conditions of either the GPL or the CDDL or both.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * additional information or have any questions.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync/** @defgroup grp_rt_power RTPower - Power management
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @ingroup grp_rt
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * MP event, see FNRTPOWERNOTIFICATION.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync /** The system will go into suspend mode. */
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync /** The system has resumed. */
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Notification callback.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * The context this is called in differs a bit from platform to
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * platform, so be careful while in here.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param enmEvent The event.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param pvUser The user argument.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsynctypedef DECLCALLBACK(void) FNRTPOWERNOTIFICATION(RTPOWEREVENT enmEvent, void *pvUser);
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync/** Pointer to a FNRTPOWERNOTIFICATION(). */
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsynctypedef FNRTPOWERNOTIFICATION *PFNRTPOWERNOTIFICATION;
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * Registers a notification callback for power events.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @returns IPRT status code.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VINF_SUCCESS on success.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VERR_NO_MEMORY if a registration record cannot be allocated.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VERR_ALREADY_EXISTS if the pfnCallback and pvUser already exist
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * in the callback list.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param pfnCallback The callback.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param pvUser The user argument to the callback function.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsyncRTDECL(int) RTPowerNotificationRegister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser);
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * This deregisters a notification callback registered via RTPowerNotificationRegister().
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * The pfnCallback and pvUser arguments must be identical to the registration call
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * of we won't find the right entry.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @returns IPRT status code.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VINF_SUCCESS on success.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VERR_NOT_FOUND if no matching entry was found.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param pfnCallback The callback.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param pvUser The user argument to the callback function.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsyncRTDECL(int) RTPowerNotificationDeregister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser);
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * This calls all registered power management callback handlers registered via RTPowerNotificationRegister().
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @returns IPRT status code.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @retval VINF_SUCCESS on success.
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync * @param enmEvent Power Management event
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsyncRTDECL(int) RTPowerSignalEvent(RTPOWEREVENT enmEvent);
1b23e980949bcd3bbeb5eaa7bfebf5b9be3a99f2vboxsync#endif /* IN_RING0 */