本文整理汇总了C++中HPT_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ HPT_ASSERT函数的具体用法?C++ HPT_ASSERT怎么用?C++ HPT_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HPT_ASSERT函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: freelist_put
void freelist_put(struct freelist * list, void *p)
{
HPT_ASSERT(list->dma==0);
list->count++;
*(void **)p = list->head;
list->head = p;
}
示例2: hpt_delete_array
static int
hpt_delete_array(_VBUS_ARG DEVICEID id, DWORD options)
{
PVDevice pArray = ID_TO_VDEV(id);
BOOLEAN del_block0 = (options & DAF_KEEP_DATA_IF_POSSIBLE)?0:1;
int i;
PVDevice pa;
if ((id==0) || check_VDevice_valid(pArray))
return -1;
if(!mIsArray(pArray)) return -1;
if (pArray->u.array.rf_rebuilding || pArray->u.array.rf_verifying ||
pArray->u.array.rf_initializing)
return -1;
for(i=0; i<pArray->u.array.bArnMember; i++) {
pa = pArray->u.array.pMember[i];
if (pa && mIsArray(pa)) {
if (pa->u.array.rf_rebuilding || pa->u.array.rf_verifying ||
pa->u.array.rf_initializing)
return -1;
}
}
if (pArray->pVBus!=_vbus_p) { HPT_ASSERT(0); return -1;}
fDeleteArray(_VBUS_P pArray, del_block0);
return 0;
}
示例3: freelist_put_dma
void freelist_put_dma(struct freelist *list, void *p, BUS_ADDRESS busaddr)
{
HPT_ASSERT(list->dma);
list->count++;
*(void **)p = list->head;
*(BUS_ADDRESS *)((void **)p+1) = busaddr;
list->head = p;
}
示例4: os_request_timer
void os_request_timer(void * osext, HPT_U32 interval)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
callout_reset(&vbus_ext->timer, interval * hz / 1000000,
os_timer_for_ldm, vbus_ext);
}
示例5: os_request_timer
void os_request_timer(void * osext, HPT_U32 interval)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0,
os_timer_for_ldm, vbus_ext, 0);
}
示例6: os_request_timer
void os_request_timer(void * osext, HPT_U32 interval)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer);
vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000);
}
示例7: HPT_ASSERT
void *freelist_get_dma(struct freelist *list, BUS_ADDRESS *busaddr)
{
void *result;
HPT_ASSERT(list->dma);
result = freelist_get(list);
if (result)
*busaddr = *(BUS_ADDRESS *)((void **)result+1);
return result;
}
示例8: os_request_timer
void os_request_timer(void * osext, HPT_U32 interval)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
#if (__FreeBSD_version >= 1000510)
callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0,
os_timer_for_ldm, vbus_ext, 0);
#else
untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer);
vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000);
#endif
}
示例9: os_buildsgl
static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical)
{
POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv;
union ccb *ccb = ext->ccb;
if (logical) {
os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr);
pSg->size = ccb->csio.dxfer_len;
pSg->eot = 1;
return TRUE;
}
/* since we have provided physical sg, nobody will ask us to build physical sg */
HPT_ASSERT(0);
return FALSE;
}
示例10: os_schedule_task
void os_schedule_task(void *osext, OSM_TASK *task)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(task->next==0);
if (vbus_ext->tasks==0)
vbus_ext->tasks = task;
else {
OSM_TASK *t = vbus_ext->tasks;
while (t->next) t = t->next;
t->next = task;
}
if (vbus_ext->worker.ta_context)
TASK_ENQUEUE(&vbus_ext->worker);
}
示例11: hpt_rebuild_data_block
void
hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flags)
{
ULONG capacity = pArray->VDeviceCapacity / (pArray->u.array.bArnMember-1);
PCommand pCmd;
UINT result;
int needsync=0, retry=0, needdelete=0;
void *buffer = NULL;
_VBUS_INST(&pAdapter->VBus)
if (pArray->u.array.rf_broken==1 ||
pArray->u.array.RebuildSectors>=capacity)
return;
mtx_lock(&pAdapter->lock);
switch(flags)
{
case DUPLICATE:
case REBUILD_PARITY:
if(pArray->u.array.rf_rebuilding == 0)
{
pArray->u.array.rf_rebuilding = 1;
hpt_printk(("Rebuilding started.\n"));
ioctl_ReportEvent(ET_REBUILD_STARTED, pArray);
}
break;
case INITIALIZE:
if(pArray->u.array.rf_initializing == 0)
{
pArray->u.array.rf_initializing = 1;
hpt_printk(("Initializing started.\n"));
ioctl_ReportEvent(ET_INITIALIZE_STARTED, pArray);
}
break;
case VERIFY:
if(pArray->u.array.rf_verifying == 0)
{
pArray->u.array.rf_verifying = 1;
hpt_printk(("Verifying started.\n"));
ioctl_ReportEvent(ET_VERIFY_STARTED, pArray);
}
break;
}
retry_cmd:
pCmd = AllocateCommand(_VBUS_P0);
HPT_ASSERT(pCmd);
pCmd->cf_control = 1;
End_Job = 0;
if (pArray->VDeviceType==VD_RAID_1)
{
#define MAX_REBUILD_SECTORS 0x40
/* take care for discontinuous buffer in R1ControlSgl */
buffer = malloc(SECTOR_TO_BYTE(MAX_REBUILD_SECTORS), M_DEVBUF, M_NOWAIT);
if(!buffer) {
FreeCommand(_VBUS_P pCmd);
hpt_printk(("can't allocate rebuild buffer\n"));
goto fail;
}
switch(flags)
{
case DUPLICATE:
pCmd->uCmd.R1Control.Command = CTRL_CMD_REBUILD;
pCmd->uCmd.R1Control.nSectors = MAX_REBUILD_SECTORS;
break;
case VERIFY:
pCmd->uCmd.R1Control.Command = CTRL_CMD_VERIFY;
pCmd->uCmd.R1Control.nSectors = MAX_REBUILD_SECTORS/2;
break;
case INITIALIZE:
pCmd->uCmd.R1Control.Command = CTRL_CMD_REBUILD;
pCmd->uCmd.R1Control.nSectors = MAX_REBUILD_SECTORS;
break;
}
pCmd->uCmd.R1Control.Lba = pArray->u.array.RebuildSectors;
if (capacity - pArray->u.array.RebuildSectors < pCmd->uCmd.R1Control.nSectors)
pCmd->uCmd.R1Control.nSectors = capacity - pArray->u.array.RebuildSectors;
pCmd->uCmd.R1Control.Buffer = buffer;
pCmd->pfnBuildSgl = R1ControlSgl;
}
else if (pArray->VDeviceType==VD_RAID_5)
{
switch(flags)
{
case DUPLICATE:
case REBUILD_PARITY:
pCmd->uCmd.R5Control.Command = CTRL_CMD_REBUILD; break;
case VERIFY:
pCmd->uCmd.R5Control.Command = CTRL_CMD_VERIFY; break;
//.........这里部分代码省略.........