37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
// Firmware power provider interface for resident platform drivers.
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <ntlite/status.h>
|
|
|
|
// A registered provider remains resident through the final hardware transition.
|
|
// Callbacks run in thread context; Enter returns an error if the transition fails.
|
|
typedef struct NTL_FIRMWARE_POWER_PROVIDER {
|
|
uint32_t Size;
|
|
void* Context;
|
|
KSTATUS (*Prepare)(void* context, uint32_t action);
|
|
KSTATUS (*Enter)(void* context, uint32_t action);
|
|
} NTL_FIRMWARE_POWER_PROVIDER;
|
|
|
|
#ifdef NTL_KERNEL_BUILD
|
|
#define NTL_DDK_POWER_API __declspec(dllexport)
|
|
#else
|
|
#define NTL_DDK_POWER_API __declspec(dllimport)
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Installs one firmware power provider for the lifetime of the boot.
|
|
NTL_DDK_POWER_API KSTATUS KeRegisterFirmwarePowerProvider(
|
|
const NTL_FIRMWARE_POWER_PROVIDER* provider);
|
|
|
|
// Reports a physical button press from a firmware driver's worker context.
|
|
NTL_DDK_POWER_API KSTATUS KeNotifyPowerButton(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|