• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IOLog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IOLog函数的典型用法代码示例。如果您正苦于以下问题:C++ IOLog函数的具体用法?C++ IOLog怎么用?C++ IOLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IOLog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: omap_set_dma_callback

/*
 * Allows changing the DMA callback function or data. This may be needed if
 * the driver shares a single DMA channel for multiple dma triggers.
 */
int omap_set_dma_callback(int lch,
						  void (*callback)(int lch, u16 ch_status, void *data),
						  void *data)
{
	unsigned long flags;
	
	if (lch < 0)
		return -ENODEV;
	
	spin_lock_irqsave(&dma_chan_lock, flags);
	if (dma_chan[lch].dev_id == -1) {
		IOLog("DMA callback for not set for free channel");
		spin_unlock_irqrestore(&dma_chan_lock, flags);
		return -EINVAL;
	}
	dma_chan[lch].callback = callback;
	dma_chan[lch].data = data;
	spin_unlock_irqrestore(&dma_chan_lock, flags);
	
	return 0;
}
开发者ID:christinaa,项目名称:Daisy,代码行数:25,代码来源:dma.c


示例2: require

IOReturn
IrDAUserClient::getIrDAStatus(void *pIn, void *pOut, IOByteCount inputSize, IOByteCount *outPutSize)
{
    IrDAComm *irda;
    
    require(*outPutSize == sizeof(IrDAStatus), Fail);
    require(fDriver, Fail);
    
	bzero(pOut, sizeof(IrDAStatus));
	
    irda = fDriver->GetIrDAComm();
	if (irda)                               // sometimes IrDA may not be there
	    irda->GetIrDAStatus((IrDAStatus *)pOut);
	    
    fDriver->GetIrDAStatus((IrDAStatus *)pOut);
    return kIOReturnSuccess;

Fail:
    IOLog("IrDA: Failing to get status\n");
    return kIOReturnBadArgument;
}
开发者ID:JeremyAgost,项目名称:osx-10.9,代码行数:21,代码来源:IrDAUser.cpp


示例3: IOLog

bool Xbox360Peripheral::QueueSerialRead(void)
{
    IOUSBCompletion complete;
    IOReturn err;
    
    if ((serialInPipe == NULL) || (serialInBuffer == NULL))
        return false;
    complete.target = this;
    complete.action = SerialReadCompleteInternal;
    complete.parameter = serialInBuffer;
    err = serialInPipe->Read(serialInBuffer, 0, 0, serialInBuffer->getLength(), &complete);
    if (err == kIOReturnSuccess)
    {
        return true;
    }
    else
    {
        IOLog("read - failed to start for chatpad (0x%.8x)\n",err);
        return false;
    }
}
开发者ID:Wisees,项目名称:360Controller,代码行数:21,代码来源:_60Controller.cpp


示例4: omap_dma_set_global_params

/**
 * @brief omap_dma_set_global_params : Set global priority settings for dma
 *
 * @param arb_rate
 * @param max_fifo_depth
 * @param tparams - Number of threads to reserve : DMA_THREAD_RESERVE_NORM
 * 						   DMA_THREAD_RESERVE_ONET
 * 						   DMA_THREAD_RESERVE_TWOT
 * 						   DMA_THREAD_RESERVE_THREET
 */
void
omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams)
{
	u32 reg;
	
	if (!cpu_class_is_omap2()) {
		IOLog("FIXME: no %s on 15xx/16xx", __func__);
		return;
	}
	
	if (max_fifo_depth == 0)
		max_fifo_depth = 1;
	if (arb_rate == 0)
		arb_rate = 1;
	
	reg = 0xff & max_fifo_depth;
	reg |= (0x3 & tparams) << 12;
	reg |= (arb_rate & 0xff) << 16;
	
	dma_write(reg, GCR);
}
开发者ID:christinaa,项目名称:Daisy,代码行数:31,代码来源:dma.c


示例5: omap_dma_set_prio_lch

/**
 * @brief omap_dma_set_prio_lch : Set channel wise priority settings
 *
 * @param lch
 * @param read_prio - Read priority
 * @param write_prio - Write priority
 * Both of the above can be set with one of the following values :
 * 	DMA_CH_PRIO_HIGH/DMA_CH_PRIO_LOW
 */
int
omap_dma_set_prio_lch(int lch, unsigned char read_prio,
					  unsigned char write_prio)
{
	u32 l;
	
	if (unlikely((lch < 0 || lch >= dma_lch_count))) {
		IOLog("Invalid channel id\n");
		return -EINVAL;
	}
	l = dma_read(CCR(lch));
	l &= ~((1 << 6) | (1 << 26));
	if (cpu_is_omap2430() || cpu_is_omap34xx() ||  cpu_is_omap44xx())
		l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
	else
		l |= ((read_prio & 0x1) << 6);
	
	dma_write(l, CCR(lch));
	
	return 0;
}
开发者ID:christinaa,项目名称:Daisy,代码行数:30,代码来源:dma.c


示例6: switch

int kXAudioDevice::debug_func(int where,const char *__format, ... )
{
	if(where<=0) return 0; // ignore this log
	
	char string[256];
	
	const char *subop="??";
	switch(where)
	{
		case  DERR: subop="ERROR"; break;
		case  DLIB: subop="HAL"; break;
	}
	
	va_list ap;
	va_start(ap, __format);
	vsnprintf(string,sizeof(string),__format,ap);
	IOLog("kXAudioDevice [%s] %s",subop,string);
	va_end(ap);
	
	return 0;
}
开发者ID:chicken1337,项目名称:kx-audio-driver,代码行数:21,代码来源:Compat.cpp


示例7: IOLog

IOReturn NoSleepExtension::clamshellEventInterestHandler(UInt32 messageType, IOService * provider,
                                                         void * messageArgument, vm_size_t argSize)
{
    if(messageType == kIOPMMessageClamshellStateChange)
    {
#ifdef DEBUG
        IOLog("%s[%p]::%s(%u, %p, %p, %lu)\n", getName(), this, __FUNCTION__,
              (unsigned int)messageType, provider, messageArgument, (long unsigned int)argSize);
#endif
        
        clamshellState = (bool)(((uintptr_t)messageArgument) & kClamshellStateBit);
        clamshellShouldSleep = (bool)(((uintptr_t)messageArgument) & kClamshellSleepBit);
        isClamshellStateInitialized = true;
        
        if((getCurrentSleepSuppressionState() == kNoSleepStateEnabled)) {
            setUserSleepDisabled(true);
            
            UInt64 deadline;
            clock_interval_to_deadline(10, kSecondScale, &deadline);
            thread_call_enter_delayed(delayTimer, deadline);
            
            if(clamshellShouldSleep) {
                pRootDomain->receivePowerNotification(kIOPMDisableClamshell);
            }

            // Lock screen when lid closed
            if(clamshellState == true && oldClamshellState == false) {
                lockScreen();
                //notify_
                //notify_post("com.apple.loginwindow.notify");
                //mach_port_t bp = bootstrap_port;
                //task_get_bootstrap_port(bootstrap_port, &bp);
            }
        }
        
        oldClamshellState = clamshellState;
    } 
    
    return kIOReturnSuccess;
}
开发者ID:Agentjj,项目名称:macosx-nosleep-extension,代码行数:40,代码来源:NoSleepExtension.cpp


示例8: IOLog

bool AppleARMPE::start(IOService * provider)
{
    DTEntry entry;
    char *dtype;
    unsigned int size;

    IOLog("AppleARMPE::start: Welcome to the NeXT generation.\n");

    if (!super::start(provider)) {
        panic("IOPlatformExpert failed to start");
    }

    removeProperty(kIOPlatformMapperPresentKey);
    assert(IOService::getPlatform() == this);

    registerService();

    /*
     * Let these time out to let everything else initialize right. 
     */
#if 0
    publishResource("IONVRAM");
    publishResource("IORTC");
#endif

    if (kSuccess == DTLookupEntry(NULL, "/", &entry)) {
        /*
         * What's the device name? 
         */
        if (kSuccess == DTGetProperty(entry, "compatible", (void **) &dtype, &size)) {
            populate_model_name(dtype);
        } else {
            populate_model_name("Generic ARM Device");
        }
    } else {
        populate_model_name("Generic ARM Device");
    }

    return true;
}
开发者ID:UIKit0,项目名称:xnu,代码行数:40,代码来源:AppleARMPE.cpp


示例9: switch

// Process new data
void WirelessHIDDevice::receivedMessage(IOMemoryDescriptor *data)
{
    unsigned char buf[29];
    
    if (data->getLength() != 29)
        return;
        
    data->readBytes(0, buf, 29);
    
    switch (buf[1])
    {
        case 0x0f:  // Initial info
            if (buf[16] == 0x13)
                receivedUpdate(0x13, buf + 17);
            serialString[0] = HexData[(buf[0x0A] & 0xF0) >> 4];
            serialString[1] = HexData[buf[0x0A] & 0x0F];
            serialString[2] = HexData[(buf[0x0B] & 0xF0) >> 4];
            serialString[3] = HexData[buf[0x0B] & 0x0F];
            serialString[4] = HexData[(buf[0x0C] & 0xF0) >> 4];
            serialString[5] = HexData[buf[0x0C] & 0x0F];
            serialString[6] = HexData[(buf[0x0D] & 0xF0) >> 4];
            serialString[7] = HexData[buf[0x0D] & 0x0F];
            serialString[8] = '\0';
            IOLog("Got serial number: %s", serialString);
            break;
            
        case 0x01:  // HID info update
            if (buf[3] == 0xf0)
                receivedHIDupdate(buf + 4, buf[5]);
            break;
            
        case 0x00:  // Info update
            receivedUpdate(buf[3], buf + 4);
            break;
            
        default:
            break;
    }
}
开发者ID:Aerodynamic,项目名称:360Controller,代码行数:40,代码来源:WirelessHIDDevice.cpp


示例10: freePacket

UInt32 AgereET131x::outputPacket(mbuf_t m, void * param)
{
	int status = 0;

    /**************************************************************************
	 Queue is not empty or TCB is not available
     *************************************************************************/
    if( MP_TCB_RESOURCES_NOT_AVAILABLE( &adapter )) {
        /**********************************************************************
		 NOTE - If there's an error on send, no need to queue the
		 packet under Linux; if we just send an error up to the netif
		 layer, it will resend the skb to us.
         *********************************************************************/
       // IOLog("TCB Resources Not Available\n" );
		freePacket(m);
		netStats->outputErrors += 1;
		return kIOReturnOutputDropped;
    }

	/**********************************************************************
	 We need to see if the link is up; if it's not, make the netif layer
	 think we're good and drop the packet
	 *********************************************************************/
	if( MP_SHOULD_FAIL_SEND( &adapter ) ){
		freePacket( m );
		netStats->outputErrors += 1;
		return kIOReturnOutputDropped;
	}

	status = send_packet( m );
	if( status != 0 ){
		IOLog( "General error, drop packet(%d)\n", status );
		freePacket( m );
		netStats->outputErrors += 1;
		return kIOReturnOutputDropped;
	}

	return kIOReturnSuccess;
}
开发者ID:andyvand,项目名称:Intel-OS-X-LAN-Driver,代码行数:39,代码来源:AgereET131x.cpp


示例11: omap_set_dma_dest_burst_mode

void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
{
	unsigned int burst = 0;
	u32 l;
	
	l = dma_read(CSDP(lch));
	l &= ~(0x03 << 14);
	
	switch (burst_mode) {
		case OMAP_DMA_DATA_BURST_DIS:
			break;
		case OMAP_DMA_DATA_BURST_4:
			if (cpu_class_is_omap2())
				burst = 0x1;
			else
				burst = 0x2;
			break;
		case OMAP_DMA_DATA_BURST_8:
			if (cpu_class_is_omap2())
				burst = 0x2;
			else
				burst = 0x3;
			break;
		case OMAP_DMA_DATA_BURST_16:
			if (cpu_class_is_omap2()) {
				burst = 0x3;
				break;
			}
			/* OMAP1 don't support burst 16
			 * fall through
			 */
		default:
			IOLog("Invalid DMA burst mode");
			BUG();
			return;
	}
	l |= (burst << 14);
	dma_write(l, CSDP(lch));
}
开发者ID:christinaa,项目名称:Daisy,代码行数:39,代码来源:dma.c


示例12: IOLog

//init method
// ->alloc everything here
bool com_objective_see_firewall::init(OSDictionary *dict)
{
    //return var
    bool result = false;
    
    //dbg msg
    IOLog("LULU: in %s\n", __FUNCTION__);
    
    //super
    if(true != super::init(dict))
    {
        //bail
        goto bail;
    }
    
    //happy
    result = true;
    
bail:
    
    return result;
}
开发者ID:Delostik,项目名称:LuLu,代码行数:24,代码来源:driver.cpp


示例13: IOLog

IOReturn PhantomAudioEngine::performAudioEngineStart()
{
    IOLog("PhantomAudioEngine[%p]::performAudioEngineStart()\n", this);
    
    // When performAudioEngineStart() gets called, the audio engine should be started from the beginning
    // of the sample buffer.  Because it is starting on the first sample, a new timestamp is needed
    // to indicate when that sample is being read from/written to.  The function takeTimeStamp() 
    // is provided to do that automatically with the current time.
    // By default takeTimeStamp() will increment the current loop count in addition to taking the current
    // timestamp.  Since we are starting a new audio engine run, and not looping, we don't want the loop count
    // to be incremented.  To accomplish that, false is passed to takeTimeStamp(). 
    
    // The audio engine will also have to take a timestamp each time the buffer wraps around
    // How that is implemented depends on the type of hardware - PCI hardware will likely
    // receive an interrupt to perform that task
    takeTimeStamp(false);
    currentBlock = 0;
    
    timerEventSource->setTimeoutUS(blockTimeoutUS);
    
    return kIOReturnSuccess;
}
开发者ID:arnelh,项目名称:Examples,代码行数:22,代码来源:PhantomAudioEngine.cpp


示例14: debugFunctionEnter

bool
PAEngine::setDeviceInfo(struct PAVirtualDeviceInfo *newInfo)
{
	debugFunctionEnter();

	info = newInfo;

	if (!info->blockSize ||
		(NUM_SAMPLE_FRAMES % info->blockSize) != 0) {
		IOLog("%s(%p):: bogus blockSize %d\n", getName(), this, (int) info->blockSize);
		return false;
	}

	channelsIn = info->channelsIn;
	channelsOut = info->channelsOut;
	nStreams = max(channelsIn, channelsOut) / CHANNELS_PER_STREAM;

	if (nStreams == 0)
		return false;

	return true;
}
开发者ID:Cyclic,项目名称:PulseAudioOSX,代码行数:22,代码来源:PAEngine.cpp


示例15: getDisplayModes

/*! @function	getInformationForDisplayMode
    @abstract	Return information about a given display mode.
    @discussion IOFramebuffer subclasses must implement this method to
				return information in the IODisplayModeInformation
				structure for the display mode with the passed ID. 
    @param		displayMode A display mode ID previously returned by
				getDisplayModes().
    @param		info Pointer to a structure of type IODisplayModeInformation
				to be filled out by the driver. IODisplayModeInformation
				is documented in IOGraphicsTypes.h.
    @result		an IOReturn code. A return other than kIOReturnSuccess will
				prevent the system from using the device.
*/
IOReturn
com_doequalsglory_driver_IOProxyFramebuffer::getInformationForDisplayMode(IODisplayModeID displayMode, IODisplayModeInformation *info) {
#if defined(DEBUG_CALLS)
	IOLog(kDebugStr "getInformationForDisplayMode(%d)\n", displayMode);
#endif
	
	if (!info) {
		return kIOReturnBadArgument;
	}
	bzero (info, sizeof (*info));
	
	info->maxDepthIndex	= kDepth32Bit;
	info->nominalWidth = gProxyDisplayModes[displayMode].nominalWidth;
	info->nominalHeight	= gProxyDisplayModes[displayMode].nominalHeight;
	//info->refreshRate = 0x3C0000;												// 60Hz in fixed point 16.16.
	//info->refreshRate	= 60 << 16;												// from IOBootFramebuffer.cpp
	//info->refreshRate = 0x0;
	info->refreshRate = gProxyDisplayModes[displayMode].refreshRate;
	info->flags = gProxyDisplayModes[displayMode].flags;
	
    return kIOReturnSuccess;
}
开发者ID:Akira-Hayasaka,项目名称:ioproxyvideofamily,代码行数:35,代码来源:IOProxyFramebuffer.cpp


示例16: probe

IOService *Apple16X50PCI::
probe(IOService *provider, SInt32 *score)
{
    Provider = OSDynamicCast(IOPCIDevice, provider);
    if (!Provider) {
        IOLog ("Apple16X50PCI: Attached to non-IOPCIDevice provider!  Failing probe()\n");
        return NULL;
    }

    if (!super::probe(provider, score)) return NULL;

    char buf[80];
    UInt8 dev  = Provider->getDeviceNumber();
    UInt8 func = Provider->getFunctionNumber();
    UInt8 bus  = Provider->getBusNumber();
    
    OSData *propData = OSDynamicCast(OSData, Provider->getProperty("AAPL,slot-name"));
    if (propData && (propData->getLength()) < 16)
        snprintf(buf, sizeof (buf), "PCI %s Bus=%d Dev=%d Func=%d", (char *)(propData->getBytesNoCopy()), bus, dev, func);
    else
        snprintf(buf, sizeof (buf), "PCI Bus=%d Dev=%d Func=%d", bus, dev, func);
    setProperty(kLocationKey, buf);
    Location = (OSDynamicCast(OSString, getProperty(kLocationKey))->getCStringNoCopy());

    setProperty(kIOTTYBaseNameKey, "pci-serial");  // this will be the TTY base name for all UARTS
    InterfaceBaseName="PCI Serial Adapter"; // this will (eventually) be displayed in NetworkPrefs
    
    InterfaceInstance=dev;

    snprintf(buf, sizeof (buf), "Apple16X50PCI%d", (int)InterfaceInstance);
    setName(buf);
    
    // turn off all access except Config space (for now)
    Provider->setMemoryEnable(false);
    Provider->setIOEnable(false);
    Provider->setBusMasterEnable(false);

    return this;
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:39,代码来源:Apple16X50PCI.cpp


示例17: fuse_vncache_purge

void
fuse_vncache_purge(vnode_t vp)
{
#if FUSE_TRACE_VNCACHE
    IOLog("osxfuse: cache purge vp=%p\n", vp);
#endif

#if M_OSXFUSE_ENABLE_BIG_LOCK
    struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp));
    bool biglock_locked = fuse_biglock_have_lock(data->biglock);

    if (biglock_locked) {
        fuse_biglock_unlock(data->biglock);
    }
#endif /* M_OSXFUSE_ENABLE_BIG_LOCK */
    cache_purge(vp);
#if M_OSXFUSE_ENABLE_BIG_LOCK
    if (biglock_locked) {
        fuse_biglock_lock(data->biglock);
    }
#endif
}
开发者ID:MeetLima,项目名称:osxfuse-kext,代码行数:22,代码来源:fuse_node.c


示例18: IOLog

IOReturn
AppleKiwiATA::selectIOTimerValue( IOATADevConfig* configRequest, UInt32 unitNumber)
{
// This particular chip snoops the SetFeatures command, so we just snag what the 
// driver tells us as info, but don't set the chip in anyway.

	
	
	busTimings[unitNumber].ataPIOSpeedMode = configRequest->getPIOMode();
	busTimings[unitNumber].ataPIOCycleTime = configRequest->getPIOCycleTime();
	busTimings[unitNumber].ataMultiDMASpeed = configRequest->getDMAMode();
	busTimings[unitNumber].ataMultiCycleTime = configRequest->getDMACycleTime();
	busTimings[unitNumber].ataUltraDMASpeedMode = configRequest->getUltraMode();

	IOLog("AppleKiwiATA:  PIO Mode %d  UDMA mode %d \n", 
	bitSigToNumeric(busTimings[unitNumber].ataPIOSpeedMode), 
	bitSigToNumeric(busTimings[unitNumber].ataUltraDMASpeedMode) );
	
	// stuff the values back into the request structure and return result
	return getConfig( configRequest, unitNumber);

}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:22,代码来源:AppleKiwiATA.cpp


示例19: IOLog

void SoftU2FUserClient::frameReceivedGated(IOMemoryDescriptor *report) {
  IOLog("%s[%p]::%s(%p)\n", getName(), this, __FUNCTION__, report);

  IOMemoryMap *reportMap = nullptr;

  if (isInactive())
    return;

  if (report->prepare() != kIOReturnSuccess)
    return;

  reportMap = report->map();

  // Notify userland that we got a report.
  if (_notifyRef && reportMap->getLength() == sizeof(U2FHID_FRAME)) {
    io_user_reference_t *args = (io_user_reference_t *)reportMap->getAddress();
    sendAsyncResult64(*_notifyRef, kIOReturnSuccess, args, sizeof(U2FHID_FRAME) / sizeof(io_user_reference_t));
  }

  reportMap->release();
  report->complete();
}
开发者ID:charlie-j,项目名称:SoftU2F,代码行数:22,代码来源:SoftU2FUserClient.cpp


示例20: fuse_vncache_enter

void
fuse_vncache_enter(vnode_t dvp, vnode_t vp, struct componentname *cnp)
{
#if FUSE_TRACE_VNCACHE
    IOLog("osxfuse: cache enter dvp=%p, vp=%p, %s\n", dvp, vp, cnp->cn_nameptr);
#endif

#if M_OSXFUSE_ENABLE_BIG_LOCK
    struct fuse_data *data = fuse_get_mpdata(vnode_mount(dvp));
    bool biglock_locked = fuse_biglock_have_lock(data->biglock);

    if (biglock_locked) {
        fuse_biglock_unlock(data->biglock);
    }
#endif /* M_OSXFUSE_ENABLE_BIG_LOCK */
    cache_enter(dvp, vp, cnp);
#if M_OSXFUSE_ENABLE_BIG_LOCK
    if (biglock_locked) {
        fuse_biglock_lock(data->biglock);
    }
#endif
}
开发者ID:MeetLima,项目名称:osxfuse-kext,代码行数:22,代码来源:fuse_node.c



注:本文中的IOLog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IOMEM函数代码示例发布时间:2022-05-30
下一篇:
C++ IOLockUnlock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap