本文整理汇总了C++中IOLog函数的典型用法代码示例。如果您正苦于以下问题:C++ IOLog函数的具体用法?C++ IOLog怎么用?C++ IOLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IOLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}