本文整理汇总了C++中IOSleep函数的典型用法代码示例。如果您正苦于以下问题:C++ IOSleep函数的具体用法?C++ IOSleep怎么用?C++ IOSleep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IOSleep函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: USBTrace
//================================================================================================
//
// ResetControllerState
//
//================================================================================================
//
IOReturn
AppleUSBOHCI::ResetControllerState(void)
{
USBTrace( kUSBTOHCI, KTPOHCIResetControllerState, (uintptr_t)this, 0, 0, 0);
// Disable All OHCI Interrupts
_pOHCIRegisters->hcInterruptDisable = HostToUSBLong(kOHCIHcInterrupt_MIE);
IOSync();
// Place the USB bus into the Reset State
_pOHCIRegisters->hcControl = HostToUSBLong((kOHCIFunctionalState_Reset << kOHCIHcControl_HCFSPhase));
IOSync();
// always make sure we stay in reset for at least 50 ms
IOSleep(50);
// Clear all Processing Registers
_pOHCIRegisters->hcHCCA = 0;
_pOHCIRegisters->hcControlHeadED = 0;
_pOHCIRegisters->hcControlCurrentED = 0;
_pOHCIRegisters->hcBulkHeadED = 0;
_pOHCIRegisters->hcBulkCurrentED = 0;
IOSync();
// turn off the global power
OHCIRootHubPower(0 /* kOff */);
// go ahead and reset the controller
_pOHCIRegisters->hcCommandStatus = HostToUSBLong(kOHCIHcCommandStatus_HCR); // Reset OHCI
IOSync();
IOSleep(1); // the spec says 10 microseconds
return kIOReturnSuccess;
}
开发者ID:a-page,项目名称:IOUSBFamily,代码行数:40,代码来源:AppleUSBOHCI_PwrMgmt.cpp
示例2: DEBUG_LOG
void CodecCommander::performCodecReset()
{
/*
Reset is created by sending two Function Group resets, potentially separated
by an undefined number of idle frames, but no other valid commands.
This Function Group “Double” reset shall do a full initialization and reset
most settings to their power on defaults.
This function can be used to reset codec on dekstop boards, for example H87-HD3,
to overcome audio loss and jack sense problem after sleep with AppleHDA v2.6.0+
*/
if (!coldBoot)
{
DEBUG_LOG("CodecCommander: cc: --> resetting codec\n");
mIntelHDA->sendCommand(1, HDA_VERB_RESET, HDA_PARM_NULL);
IOSleep(100); // define smaller delays ????
mIntelHDA->sendCommand(1, HDA_VERB_RESET, HDA_PARM_NULL);
IOSleep(100);
// forcefully set power state to D3
mIntelHDA->sendCommand(1, HDA_VERB_SET_PSTATE, HDA_PARM_PS_D3_HOT);
eapdPoweredDown = true;
DEBUG_LOG("CodecCommander: cc: --> hda codec power restored\n");
}
}
开发者ID:freedonghee,项目名称:EAPD-Codec-Commander,代码行数:26,代码来源:CodecCommander.cpp
示例3: ite_family_enter
bool SuperIODevice::detectITEFamilyChip()
{
// IT87XX can enter only on port 0x2E
port = 0x2E;
ite_family_enter(port);
id = superio_listen_port_word(port, kSuperIOChipIDRegister);
HWSensorsDebugLog("probing device on 0x%x, id=0x%x", port, id);
ldn = 0;
vendor = "";
switch (id) {
case IT8512F:
case IT8712F:
case IT8716F:
case IT8718F:
case IT8720F:
case IT8721F:
case IT8726F:
case IT8620E:
case IT8728F:
case IT8752F:
case IT8771E:
case IT8772E:
model = id;
ldn = kFintekITEHardwareMonitorLDN;
vendor = "ITE";
break;
}
if (model != 0 && ldn != 0) {
HWSensorsDebugLog("detected %s %s, starting address sanity checks", vendor, superio_get_model_name(model));
superio_select_logical_device(port, ldn);
IOSleep(10);
address = superio_listen_port_word(port, kSuperIOBaseAddressRegister);
IOSleep(10);
UInt16 verify = superio_listen_port_word(port, kSuperIOBaseAddressRegister);
IOSleep(10);
ite_family_exit(port);
if (address != verify || address < 0x100 || (address & 0xF007) != 0)
return false;
return true;
}
else ite_family_exit(port);
return false;
}
开发者ID:MagOO33,项目名称:HWSensors,代码行数:60,代码来源:SuperIODevice.cpp
示例4: debugIOLog
IOReturn AudioProj10PowerObject::setHardwarePowerOn(){
debugIOLog (3, "+ AudioProj10PowerObject::setHardwarePowerOn");
IOReturn result = kIOReturnSuccess;
UInt32 progOut;
IOService *keyLargo = 0;
keyLargo = IOService::waitForService(IOService::serviceMatching("KeyLargo"));
if(keyLargo){
long gpioOffset = kPowerObjectOffset;
UInt8 value = kPowerOn;
keyLargo->callPlatformFunction("keyLargo_writeRegUInt8", false, (void *)&gpioOffset, (void *)(UInt32)value, 0, 0);
}
IOSleep(80);
progOut = audioPluginRef->sndHWGetProgOutput();
progOut &= ~kSndHWProgOutput0;
audioPluginRef->sndHWSetProgOutput(progOut);
IOSleep(200);
if(audioPluginRef) {
audioPluginRef->sndHWSetPowerState(kIOAudioDeviceActive);
audioPluginRef->setDeviceDetectionActive();
}
debugIOLog (3, "- AudioProj10PowerObject::setHardwarePowerOn");
return result;
}
开发者ID:OpenDarwin-CVS,项目名称:XPostFacto,代码行数:26,代码来源:AudioHardwarePower.cpp
示例5: ite_family_enter
bool SuperIODevice::detectITEFamilyChip()
{
// IT87XX can enter only on port 0x2E
port = 0x2E;
ite_family_enter(port);
id = superio_listen_port_word(port, kSuperIOChipIDRegister);
ldn = 0;
vendor = "";
switch (id) {
case IT8512F:
case IT8712F:
case IT8716F:
case IT8718F:
case IT8720F:
case IT8721F:
case IT8726F:
case IT8728F:
case IT8752F:
case IT8771E:
case IT8772E:
model = id;
ldn = kFintekITEHardwareMonitorLDN;
vendor = "ITE";
break;
}
if (model != 0 && ldn != 0) {
superio_select_logical_device(port, ldn);
IOSleep(10);
address = superio_listen_port_word(port, kSuperIOBaseAddressRegister);
IOSleep(10);
UInt16 verify = superio_listen_port_word(port, kSuperIOBaseAddressRegister);
IOSleep(10);
ite_family_exit(port);
if (address != verify || address < 0x100 || (address & 0xF007) != 0)
return false;
return true;
}
else ite_family_exit(port);
return false;
}
开发者ID:Bitesher,项目名称:HWSensors,代码行数:54,代码来源:SuperIO.cpp
示例6: DEBUG_LOG
IOReturn CodecCommander::setPowerState(unsigned long powerStateOrdinal, IOService *policyMaker)
{
if (kPowerStateSleep == powerStateOrdinal) {
DEBUG_LOG("CodecCommander: cc: --> asleep\n");
eapdPoweredDown = true;
// though this probably has been determined after parsing codec power state, we set this as false again
coldBoot = false;
}
else if (kPowerStateNormal == powerStateOrdinal) {
DEBUG_LOG("CodecCommander: cc: --> awake\n");
updateCount = 0;
// This operation has to be performed right at wake or codec will enter power mode 0 immediately!
// *****
// set EAPD bit at wake or cold boot
if (eapdPoweredDown) {
DEBUG_LOG("CodecCommander: cc: --> hda codec power restored\n");
// delay setting by 100ms, otherwise immediate command won't be received
IOSleep(100);
setOutputs();
}
// only when this is done we can stars a check workloop!
// *****
// if infinite checking requested
if (checkInfinite){
// if checking infinitely then make sure to delay workloop
if (coldBoot) {
fTimer->setTimeoutMS(20000); // create a nasty 20sec delay for AudioEngineOutput to initialize
}
// if we are waking it will be already initialized
else {
fTimer->setTimeoutMS(100); // so fire timer for workLoop almost immediately
}
DEBUG_LOG("CodecCommander: cc: --> workloop started\n");
}
// generate audio stream at wake if requested
if (!coldBoot && generatePop){
// apply delay or it will not trigger a system event
IOSleep(streamDelay);
createAudioStream();
}
// simulate headphone jack replug
simulateHedphoneJack();
}
return IOPMAckImplied;
}
开发者ID:aplev,项目名称:EAPD-Codec-Commander,代码行数:50,代码来源:CodecCommander.cpp
示例7: bfe_wait_bit
static int
bfe_wait_bit( struct bfe_softc * sc, u_int32_t reg, u_int32_t bit,
u_long timeout, const int clear )
{
u_long i;
int use_sleep = 0;
/* [email protected]: long timeouts polls are done using a blocking wait */
if (timeout >= 10000) {
use_sleep = 1;
timeout /= 1000;
}
for (i = 0; i < timeout; i++) {
u_int32_t val = CSR_READ_4(sc, reg);
if (clear && !(val & bit))
break;
if (!clear && (val & bit))
break;
if (use_sleep)
IOSleep(10);
else
DELAY(10);
}
if (i == timeout) {
DEBUG_LOG("bfe%d: BUG! Timeout waiting for bit %08x of register "
"%x to %s.\n", sc->bfe_unit, bit, reg,
(clear ? "clear" : "set"));
return -1;
}
return 0;
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:34,代码来源:if_bfe.c
示例8: USBLog
IOReturn
AppleUSBUHCI::RHResumePortCompletion(UInt32 port)
{
UInt16 value;
USBLog(5, "AppleUSBUHCI[%p]::RHResumePortCompletion - finishing resume on port %d", this, (int)port);
if (!_rhPortBeingResumed[port-1])
{
USBLog(1, "AppleUSBUHCI[%p]::RHResumePortCompletion - port %d does not appear to be resuming!", this, (int)port);
USBTrace( kUSBTUHCI, kTPUHCIRHResumePortCompletion, (uintptr_t)this, (int)port, 0, kIOReturnInternalError );
return kIOReturnInternalError;
}
if (!_controllerAvailable)
{
USBLog(5, "AppleUSBEHCI[%p]::RHResumePortCompletion - cannot finish resume on port %d because the controller is unavailable", this, (int)port);
_rhPortBeingResumed[port-1] = false;
return kIOReturnInternalError;
}
value = ReadPortStatus(port-1) & kUHCI_PORTSC_MASK;
value &= ~(kUHCI_PORTSC_RD | kUHCI_PORTSC_SUSPEND);
USBLog(5, "AppleUSBUHCI[%p]: de-asserting resume signal by writing (%p)", this, (void*)value);
WritePortStatus(port-1, value);
IOSync();
IOSleep(2); // allow it to kick in
_rhPortBeingResumed[port-1] = false;
_portSuspendChange[port-1] = true;
EnsureUsability();
return kIOReturnSuccess;
}
开发者ID:a-page,项目名称:IOUSBFamily,代码行数:32,代码来源:AppleUSBUHCI_RootHub.cpp
示例9: DEBUG_LOG
IOReturn
SATSMARTUserClient::HandleTerminate ( IOService * provider )
{
IOReturn status = kIOReturnSuccess;
DEBUG_LOG("%s[%p]::%s\n", getClassName(), this, __FUNCTION__);
while ( fOutstandingCommands != 0 )
{
IOSleep ( 10 );
}
// Check if we have our provider open.
if ( provider->isOpen ( this ) )
{
// Yes we do, so close the connection
DEBUG_LOG("%s[%p]::%s closing provider\n", getClassName(), this, __FUNCTION__);
provider->close ( this, kIOATASMARTUserClientAccessMask );
}
// Decouple us from the IORegistry.
detach ( provider );
fProvider = NULL;
DEBUG_LOG("%s[%p]::%s result %d\n", getClassName(), this, __FUNCTION__, status);
return status;
}
开发者ID:D1001,项目名称:OS-X-SAT-SMART-Driver,代码行数:28,代码来源:SATSMARTUserClient.cpp
示例10: while
bool
IOATABlockStorageDriver::finalize ( IOOptionBits options )
{
if ( fPowerManagementInitialized )
{
while ( fPowerTransitionInProgress )
{
IOSleep ( 1 );
}
fCommandGate->commandWakeup ( &fCurrentPowerState, false );
PMstop ( );
if ( fPowerManagementThread != NULL )
{
// If the power management thread is scheduled, unschedule it.
thread_call_cancel ( fPowerManagementThread );
}
fPowerManagementInitialized = false;
}
return super::finalize ( options );
}
开发者ID:aosm,项目名称:IOATABlockStorage,代码行数:33,代码来源:IOATABlockStorageDriver.cpp
示例11: OUTVID
float X3100monitor::getSensorValue(FakeSMCSensor *sensor)
{
if (sensor->getGroup() == kFakeSMCTemperatureSensor) {
short value = 0;
if (mmio_base) {
OUTVID(TIC1, 3);
// if ((INVID16(TSC1) & (1<<15)) && !(INVID16(TSC1) & (1<<8)))//enabled and ready
for (int i=0; i<1000; i++) { //attempts to ready
if (INVID16(TSS1) & (1<<10)) //valid?
break;
IOSleep(10);
}
value = INVID8(TR1);
}
return 150 - value;
}
return 0;
}
开发者ID:alexandrezia,项目名称:HWSensors,代码行数:26,代码来源:X3100monitor.cpp
示例12: OUTVID
bool GmaSensors::willReadSensorValue(FakeSMCSensor *sensor, float *outValue)
{
if (sensor->getGroup() == kFakeSMCTemperatureSensor) {
short value = 0;
if (mmio_base) {
OUTVID(TIC1, 3);
// if ((INVID16(TSC1) & (1<<15)) && !(INVID16(TSC1) & (1<<8)))//enabled and ready
for (int i=0; i<1000; i++) { //attempts to ready
if (INVID16(TSS1) & (1<<10)) //valid?
break;
IOSleep(10);
}
value = INVID8(TR1);
}
*outValue = (float)(150 - value);
}
return true;
}
开发者ID:queer1,项目名称:HWSensors,代码行数:26,代码来源:GmaSensors.cpp
示例13: ELG
IOReturn AppleRS232Serial::setPowerState(unsigned long powerStateOrdinal, IOService *whatDevice)
{
bool ok;
UInt32 counter = 0;
ELG(0, powerStateOrdinal, "setPowerState - powerStateOrdinal");
retain(); // paranoia is your friend, make sure we're not freed
fWaitForGatedCmd = true; // could do this async, but let's be sync initially
ok = thread_call_enter1(fPowerThreadCall, (void *)powerStateOrdinal); // schedule work on workloop
if (ok) { // if thread was already pending ...
ALERT(0, 0, "setPowerState - thread already pending?"); // a 'never' in current flow
release(); // don't need/want the retain, so undo it
}
while (fWaitForGatedCmd) { // we're being sync for now, wait for it to finish
IOSleep(2); // it should be very fast
counter++;
}
ELG(0, counter, "setPowerState - finished after N sleeps of 2ms each");
return IOPMAckImplied; // we're done
}/* end setPowerState */
开发者ID:OTiZ,项目名称:osx,代码行数:27,代码来源:AppleRS232Power.cpp
示例14: msleep_interruptible
unsigned long msleep_interruptible(unsigned int msecs)
{
// FIXME, make into interruptable sleep
// Sleep the calling thread for a number of milliseconds
IOSleep(msecs);
return(0);
}
开发者ID:vrudikov,项目名称:crystalhd-for-osx,代码行数:7,代码来源:linux_compatible.c
示例15: DbgPrint
IOReturn AttansicL2Ethernet::disable(IONetworkInterface *netif)
{
DbgPrint("disable()\n");
at_adapter *adapter=&adapter_;
setLinkStatus(kIONetworkLinkValid, 0);
transmitQueue_->flush();
transmitQueue_->stop();
transmitQueue_->setCapacity(0);
at_reset_hw(adapter);
IOSleep(1);
at_irq_disable(adapter);
adapter->link_speed = SPEED_0;
adapter->link_duplex = -1;
// pretty wrong place for DMA stuff cleaning, eh?
if (adapter->pdev && adapter->pdev->isOpen () ) adapter->pdev->close(this);
return kIOReturnSuccess;
}
开发者ID:aelam,项目名称:iats,代码行数:25,代码来源:AttansicL2Ethernet.cpp
示例16: DbgPrint
IOReturn AtherosL1Ethernet::getHardwareAddress(IOEthernetAddress *addr)
{
DbgPrint("getHardwareAddress()\n");
IOSleep(1000);
if (is_valid_ether_addr(adapter_.hw.mac_addr))
{
memcpy(addr->bytes, adapter_.hw.mac_addr, NODE_ADDRESS_SIZE);
return kIOReturnSuccess;
}
if (get_permanent_address(&adapter_.hw) == 0)
{
if (is_valid_ether_addr(adapter_.hw.perm_mac_addr))
{
memcpy(adapter_.hw.mac_addr, adapter_.hw.perm_mac_addr, NODE_ADDRESS_SIZE);
memcpy(addr->bytes, adapter_.hw.mac_addr, NODE_ADDRESS_SIZE);
}
else
{
ErrPrint("Invalid mac address\n");
return kIOReturnUnsupported;
}
return kIOReturnSuccess;
}
else
{
DbgPrint("Couldn't get device mac address\n");
memcpy(adapter_.hw.mac_addr, addr->bytes, NODE_ADDRESS_SIZE);
//return kIOReturnUnsupported;
return kIOReturnSuccess;
}
}
开发者ID:aelam,项目名称:iats,代码行数:33,代码来源:AtherosL1Ethernet.cpp
示例17: IOSleep
void darwin_iwi4965::setPowerStateOn() {
// IOSleep(2);
// _cardGone = false;
// wakeUp();
if ( pmPCICapPtr )
{
fPCIDevice->saveDeviceState();
fPCIDevice->configWrite16( kPCIPMCSR, 0x8000 );
IOSleep(10); // wait for internal reset completion
fPCIDevice->restoreDeviceState();
}
// Since the driver returned a non-acknowledgement when called at
// setPowerState(), it sends an ACK to the policy-maker here to
// indicate that our power state transition is complete.
_pmPowerState = kWiFiControllerPowerStateOn;
_pmPolicyMaker->acknowledgeSetPowerState();
// With power restored, all clients will be notified that the driver
// has became "usable". If a client wishes to use the driver, then the
// driver can expect a call to its enable() method to start things off.
}
开发者ID:Klozz,项目名称:iwidarwin,代码行数:26,代码来源:WiFiPower.cpp
示例18: switch
bool FakeSMCPlugin::releaseGPUIndex(UInt8 index)
{
SYNCLOCK;
for (int i = 0; i < 3; i++) {
IOReturn resut = storageProvider->callPlatformFunction(kFakeSMCReleaseGPUIndex, true, (void *)&index, 0, 0, 0);
switch (resut) {
case kIOReturnSuccess:
SYNCUNLOCK;
return true;
case kIOReturnBadArgument:
SYNCUNLOCK;
return false;
default:
break;
}
IOSleep(10);
}
SYNCUNLOCK;
return false;
}
开发者ID:Bitesher,项目名称:HWSensors,代码行数:26,代码来源:FakeSMCPlugin.cpp
示例19: checkACStatusThread
static void checkACStatusThread(thread_call_param_t param0,
thread_call_param_t param1)
{
int i=0;
const int retryTimes = 10;
while (!isStatusThreadCanCancel && i<retryTimes) {
if(NULL == commmonBatteryDevice)
{
IOLog("Can't find battery device, retry %d...\n", retryTimes-i);
commmonBatteryDevice = getBatteryDevice();
IOSleep(3000);
i++;
continue;
}
OSObject * obj = commmonBatteryDevice->getProperty("ExternalConnected");
OSBoolean * status = OSDynamicCast(OSBoolean, obj);
if (!status)
{
IOLog("Battery status get failed.\n");
break;
}
if(ACStatusChangedCallback)
{
bool batStatus = status->getValue();
if(batStatus != ACStatus)
{
//IOLog("Battery status changed.\n");
ACStatus = batStatus;
ACStatusChangedCallback(batStatus);
}
}
else
ACStatus = status->getValue();
IOSleep(ACStatus?1000:5000);//1s=1000ms
}
if(i == 10)
IOLog("Can't find battery device, exit.\n");
else
IOLog("Battery thread cancelled.\n");
isStatusThreadCancelled = true;
}
开发者ID:htge,项目名称:AutoDisableTurboBoost,代码行数:45,代码来源:Battery.cpp
示例20: IOSleep
/******************************************************************************
* CodecCommander::setOutputs - set EAPD status bit on SP/HP
******************************************************************************/
void CodecCommander::setEAPD(UInt8 logicLevel)
{
// delay by at least 100ms, otherwise first immediate command won't be received
// some codecs will produce loud pop when EAPD is enabled too soon, need custom delay until codec inits
if (mConfiguration->getSendDelay() < 100)
IOSleep(100);
else
IOSleep(mConfiguration->getSendDelay());
// for nodes supporting EAPD bit 1 in logicLevel defines EAPD logic state: 1 - enable, 0 - disable
for (int i = 0; i < MAX_EAPD_NODES; i++)
{
if (eapdCapableNodes[i] != 0)
mIntelHDA->sendCommand(eapdCapableNodes[i], HDA_VERB_EAPDBTL_SET, logicLevel);
}
eapdPoweredDown = false;
}
开发者ID:freedonghee,项目名称:EAPD-Codec-Commander,代码行数:21,代码来源:CodecCommander.cpp
注:本文中的IOSleep函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论