- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
drvsleep.c
资源名称:SMDK2440.rar [点击查看]
上传用户:qiulin1960
上传日期:2013-10-16
资源大小:2844k
文件大小:2k
源码类别:
Windows CE
开发平台:
Windows_Unix
- /*++
- THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- PARTICULAR PURPOSE.
- Copyright (c) 1995-2000 Microsoft Corporation. All rights reserved.
- Module Name:
- drvsleep.c
- Abstract:
- This module contains the implementation of DriverSleep(), which
- is used when delays are needed within power handling routines, where
- no system calls are allowed. The SH3 implementation polls the free
- running timer to implement a delay.
- Functions:
- DriverSleep
- Notes:
- Revision History:
- Glenn Davis 4/1/97
- --*/
- #include <windows.h>
- #include <p2.h>
- #include <p2debug.h>
- /* DriverSleep
- *
- * implement a busy-wait delay, for use by drivers
- * during power handler functions.
- *
- * The following assumptions are made when calling from a power
- * handler routine:
- * -- Processor is in kernel mode (so we can access mem directly)
- * -- We're non preemptible. Otherwise, we'll get swapped out and
- * delay could be longer than specified.
- */
- void
- DriverSleep(DWORD dwMS, BOOL bInPowerHandler)
- {
- /*
- * If we're not in a power handler, use Sleep to block our
- * thread and let others run. Note that Sleep() currently
- * is not very accurate for low values - the minimum sleep
- * interval is at least one system tick (25 ms).
- */
- if (!bInPowerHandler) {
- Sleep(dwMS);
- return;
- }
- }