ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

po.h
Go to the documentation of this file.
00001 /*
00002 * PROJECT:         ReactOS Kernel
00003 * LICENSE:         GPL - See COPYING in the top level directory
00004 * FILE:            ntoskrnl/include/po.h
00005 * PURPOSE:         Internal header for the Power Manager
00006 * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
00007 */
00008 
00009 #include <guiddef.h>
00010 #include <poclass.h>
00011 
00012 //
00013 // Define this if you want debugging support
00014 //
00015 #define _PO_DEBUG_                                      0x00
00016 
00017 //
00018 // These define the Debug Masks Supported
00019 //
00020 #define PO_STATE_DEBUG                                  0x01
00021 
00022 //
00023 // Debug/Tracing support
00024 //
00025 #if _PO_DEBUG_
00026 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
00027 #define POTRACE DbgPrintEx
00028 #else
00029 #define POTRACE(x, ...)                                 \
00030     if (x & PopTraceLevel) DbgPrint(__VA_ARGS__)
00031 #endif
00032 #else
00033 #define POTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
00034 #endif
00035 
00036 typedef struct _PO_HIBER_PERF
00037 {
00038     ULONGLONG IoTicks;
00039     ULONGLONG InitTicks;
00040     ULONGLONG CopyTicks;
00041     ULONGLONG StartCount;
00042     ULONG ElapsedTime;
00043     ULONG IoTime;
00044     ULONG CopyTime;
00045     ULONG InitTime;
00046     ULONG PagesWritten;
00047     ULONG PagesProcessed;
00048     ULONG BytesCopied;
00049     ULONG DumpCount;
00050     ULONG FileRuns;
00051 } PO_HIBER_PERF, *PPO_HIBER_PERF;
00052 
00053 typedef struct _PO_MEMORY_IMAGE
00054 {
00055     ULONG Signature;
00056     ULONG Version;
00057     ULONG CheckSum;
00058     ULONG LengthSelf;
00059     PFN_NUMBER PageSelf;
00060     ULONG PageSize;
00061     ULONG ImageType;
00062     LARGE_INTEGER SystemTime;
00063     ULONGLONG InterruptTime;
00064     ULONG FeatureFlags;
00065     UCHAR HiberFlags;
00066     UCHAR spare[3];
00067     ULONG NoHiberPtes;
00068     ULONG_PTR HiberVa;
00069     PHYSICAL_ADDRESS HiberPte;
00070     ULONG NoFreePages;
00071     ULONG FreeMapCheck;
00072     ULONG WakeCheck;
00073     PFN_NUMBER TotalPages;
00074     PFN_NUMBER FirstTablePage;
00075     PFN_NUMBER LastFilePage;
00076     PO_HIBER_PERF PerfInfo;
00077 } PO_MEMORY_IMAGE, *PPO_MEMORY_IMAGE;
00078 
00079 typedef struct _PO_MEMORY_RANGE_ARRAY_RANGE
00080 {
00081     PFN_NUMBER PageNo;
00082     PFN_NUMBER StartPage;
00083     PFN_NUMBER EndPage;
00084     ULONG CheckSum;
00085 } PO_MEMORY_RANGE_ARRAY_RANGE;
00086 
00087 typedef struct _PO_MEMORY_RANGE_ARRAY_LINK
00088 {
00089     struct _PO_MEMORY_RANGE_ARRAY *Next;
00090     PFN_NUMBER NextTable;
00091     ULONG CheckSum;
00092     ULONG EntryCount;
00093 } PO_MEMORY_RANGE_ARRAY_LINK;
00094 
00095 typedef struct _PO_MEMORY_RANGE_ARRAY
00096 {
00097     union
00098     {
00099         PO_MEMORY_RANGE_ARRAY_RANGE Range;
00100         PO_MEMORY_RANGE_ARRAY_LINK Link;
00101     };
00102 } PO_MEMORY_RANGE_ARRAY, *PPO_MEMORY_RANGE_ARRAY;
00103 
00104 typedef struct _POP_HIBER_CONTEXT
00105 {
00106     BOOLEAN WriteToFile;
00107     BOOLEAN ReserveLoaderMemory;
00108     BOOLEAN ReserveFreeMemory;
00109     BOOLEAN VerifyOnWake;
00110     BOOLEAN Reset;
00111     UCHAR HiberFlags;
00112     BOOLEAN LinkFile;
00113     HANDLE LinkFileHandle;
00114     PKSPIN_LOCK Lock;
00115     BOOLEAN MapFrozen;
00116     RTL_BITMAP MemoryMap;
00117     LIST_ENTRY ClonedRanges;
00118     ULONG ClonedRangeCount;
00119     PLIST_ENTRY NextCloneRange;
00120     PFN_NUMBER NextPreserve;
00121     PMDL LoaderMdl;
00122     PMDL Clones;
00123     PUCHAR NextClone;
00124     ULONG NoClones;
00125     PMDL Spares;
00126     ULONGLONG PagesOut;
00127     PVOID IoPage;
00128     PVOID CurrentMcb;
00129     PVOID DumpStack;
00130     PKPROCESSOR_STATE WakeState;
00131     ULONG NoRanges;
00132     ULONG_PTR HiberVa;
00133     PHYSICAL_ADDRESS HiberPte;
00134     NTSTATUS Status;
00135     PPO_MEMORY_IMAGE MemoryImage;
00136     PPO_MEMORY_RANGE_ARRAY TableHead;
00137     PVOID CompressionWorkspace;
00138     PUCHAR CompressedWriteBuffer;
00139     PULONG PerformanceStats;
00140     PVOID CompressionBlock;
00141     PVOID DmaIO;
00142     PVOID TemporaryHeap;
00143     PO_HIBER_PERF PerfInfo;
00144 } POP_HIBER_CONTEXT, *PPOP_HIBER_CONTEXT;
00145 
00146 typedef struct _PO_NOTIFY_ORDER_LEVEL
00147 {
00148     KEVENT LevelReady;
00149     ULONG DeviceCount;
00150     ULONG ActiveCount;
00151     LIST_ENTRY WaitSleep;
00152     LIST_ENTRY ReadySleep;
00153     LIST_ENTRY Pending;
00154     LIST_ENTRY Complete;
00155     LIST_ENTRY ReadyS0;
00156     LIST_ENTRY WaitS0;
00157 } PO_NOTIFY_ORDER_LEVEL, *PPO_NOTIFY_ORDER_LEVEL;
00158 
00159 typedef struct _POP_SHUTDOWN_BUG_CHECK
00160 {
00161     HANDLE ThreadHandle;
00162     HANDLE ThreadId;
00163     HANDLE ProcessId;
00164     ULONG Code;
00165     ULONG_PTR Parameter1;
00166     ULONG_PTR Parameter2;
00167     ULONG_PTR Parameter3;
00168     ULONG_PTR Parameter4;
00169 } POP_SHUTDOWN_BUG_CHECK, *PPOP_SHUTDOWN_BUG_CHECK;
00170 
00171 typedef struct _POP_DEVICE_POWER_IRP
00172 {
00173     SINGLE_LIST_ENTRY Free;
00174     PIRP Irp;
00175     PPO_DEVICE_NOTIFY Notify;
00176     LIST_ENTRY Pending;
00177     LIST_ENTRY Complete;
00178     LIST_ENTRY Abort;
00179     LIST_ENTRY Failed;
00180 } POP_DEVICE_POWER_IRP, *PPOP_DEVICE_POWER_IRP;
00181 
00182 typedef struct _PO_DEVICE_NOTIFY_ORDER
00183 {
00184     ULONG DevNodeSequence;
00185     PDEVICE_OBJECT *WarmEjectPdoPointer;
00186     PO_NOTIFY_ORDER_LEVEL OrderLevel[8];
00187 } PO_DEVICE_NOTIFY_ORDER, *PPO_DEVICE_NOTIFY_ORDER;
00188 
00189 typedef struct _POP_DEVICE_SYS_STATE
00190 {
00191     UCHAR IrpMinor;
00192     SYSTEM_POWER_STATE SystemState;
00193     PKEVENT Event;
00194     KSPIN_LOCK SpinLock;
00195     PKTHREAD Thread;
00196     BOOLEAN GetNewDeviceList;
00197     PO_DEVICE_NOTIFY_ORDER Order;
00198     NTSTATUS Status;
00199     PDEVICE_OBJECT FailedDevice;
00200     BOOLEAN Waking;
00201     BOOLEAN Cancelled;
00202     BOOLEAN IgnoreErrors;
00203     BOOLEAN IgnoreNotImplemented;
00204     BOOLEAN _WaitAny;
00205     BOOLEAN _WaitAll;
00206     LIST_ENTRY PresentIrpQueue;
00207     POP_DEVICE_POWER_IRP Head;
00208     POP_DEVICE_POWER_IRP PowerIrpState[20];
00209 } POP_DEVICE_SYS_STATE, *PPOP_DEVICE_SYS_STATE;
00210 
00211 typedef struct _POP_POWER_ACTION
00212 {
00213     UCHAR Updates;
00214     UCHAR State;
00215     BOOLEAN Shutdown;
00216     POWER_ACTION Action;
00217     SYSTEM_POWER_STATE LightestState;
00218     ULONG Flags;
00219     NTSTATUS Status;
00220     UCHAR IrpMinor;
00221     SYSTEM_POWER_STATE SystemState;
00222     SYSTEM_POWER_STATE NextSystemState;
00223     PPOP_SHUTDOWN_BUG_CHECK ShutdownBugCode;
00224     PPOP_DEVICE_SYS_STATE DevState;
00225     PPOP_HIBER_CONTEXT HiberContext;
00226     ULONGLONG WakeTime;
00227     ULONGLONG SleepTime;
00228 } POP_POWER_ACTION, *PPOP_POWER_ACTION;
00229 
00230 typedef enum _POP_DEVICE_IDLE_TYPE
00231 {
00232     DeviceIdleNormal,
00233     DeviceIdleDisk,
00234 } POP_DEVICE_IDLE_TYPE, *PPOP_DEVICE_IDLE_TYPE;
00235 
00236 typedef struct _POWER_CHANNEL_SUMMARY
00237 {
00238     ULONG Signature;
00239     ULONG TotalCount;
00240     ULONG D0Count;
00241     LIST_ENTRY NotifyList;
00242 } POWER_CHANNEL_SUMMARY, *PPOWER_CHANNEL_SUMMARY;
00243     
00244 typedef struct  _DEVICE_OBJECT_POWER_EXTENSION
00245 {
00246     ULONG IdleCount;
00247     ULONG ConservationIdleTime;
00248     ULONG PerformanceIdleTime;
00249     PDEVICE_OBJECT DeviceObject;
00250     LIST_ENTRY IdleList;
00251     DEVICE_POWER_STATE State;
00252     LIST_ENTRY NotifySourceList;
00253     LIST_ENTRY NotifyTargetList;
00254     POWER_CHANNEL_SUMMARY PowerChannelSummary;
00255     LIST_ENTRY Volume;
00256 } DEVICE_OBJECT_POWER_EXTENSION, *PDEVICE_OBJECT_POWER_EXTENSION;
00257 
00258 //
00259 // Initialization routines
00260 //
00261 BOOLEAN
00262 NTAPI
00263 PoInitSystem(
00264     IN ULONG BootPhase
00265 );
00266 
00267 VOID
00268 NTAPI
00269 PoInitializePrcb(
00270     IN PKPRCB Prcb
00271 );
00272 
00273 //
00274 // I/O Routines
00275 //
00276 VOID
00277 NTAPI
00278 PoInitializeDeviceObject(
00279     IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension
00280 );
00281 
00282 VOID
00283 NTAPI
00284 PoVolumeDevice(
00285     IN PDEVICE_OBJECT DeviceObject
00286 );
00287 
00288 //
00289 // Power State routines
00290 //
00291 NTSTATUS
00292 NTAPI
00293 PopSetSystemPowerState(
00294     SYSTEM_POWER_STATE PowerState,
00295     POWER_ACTION PowerAction
00296 );
00297 
00298 VOID
00299 NTAPI
00300 PopCleanupPowerState(
00301     IN PPOWER_STATE PowerState
00302 );
00303 
00304 NTSTATUS
00305 NTAPI
00306 PopAddRemoveSysCapsCallback(
00307     IN PVOID NotificationStructure,
00308     IN PVOID Context
00309 );
00310 
00311 //
00312 // Notifications
00313 //
00314 VOID
00315 NTAPI
00316 PoNotifySystemTimeSet(
00317     VOID
00318 );
00319 
00320 //
00321 // Shutdown routines
00322 //
00323 VOID
00324 NTAPI
00325 PopReadShutdownPolicy(
00326     VOID
00327 );
00328 
00329 VOID
00330 NTAPI
00331 PopGracefulShutdown(
00332     IN PVOID Context
00333 );
00334 
00335 VOID
00336 NTAPI
00337 PopFlushVolumes(
00338     IN BOOLEAN ShuttingDown
00339 );
00340 
00341 //
00342 // Global data inside the Power Manager
00343 //
00344 extern PDEVICE_NODE PopSystemPowerDeviceNode;
00345 extern KGUARDED_MUTEX PopVolumeLock;
00346 extern LIST_ENTRY PopVolumeDevices;
00347 extern KSPIN_LOCK PopDopeGlobalLock;
00348 extern POP_POWER_ACTION PopAction;
00349 

Generated on Sun May 27 2012 04:37:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.