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

C++ PR_DEBUG函数代码示例

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

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



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

示例1: page_tryretire

/*
 * Try to retire a page when we stumble onto it in the page lock routines.
 */
void
page_tryretire(page_t *pp)
{
	ASSERT(PAGE_EXCL(pp));

	if (!pr_enable) {
		page_unlock(pp);
		return;
	}

	/*
	 * If the page is a big page, try to break it up.
	 *
	 * If there are other bad pages besides `pp', they will be
	 * recursively retired for us thanks to a bit of magic.
	 * If the page is a small page with errors, try to retire it.
	 */
	if (pp->p_szc > 0) {
		if (PP_ISFREE(pp) && !page_try_demote_free_pages(pp)) {
			page_unlock(pp);
			PR_DEBUG(prd_nofreedemote);
			return;
		} else if (!page_try_demote_pages(pp)) {
			page_unlock(pp);
			PR_DEBUG(prd_nodemote);
			return;
		}
		PR_DEBUG(prd_demoted);
		page_unlock(pp);
	} else {
		(void) page_retire_pp(pp);
	}
}
开发者ID:andreiw,项目名称:polaris,代码行数:36,代码来源:page_retire.c


示例2: kern_unlocked_ioctl

/*
* This is the ioctl implementation.
*/
static long kern_unlocked_ioctl(struct file *filp, unsigned int cmd,
		unsigned long arg)
{
	int res;
	void *p;

	PR_DEBUG("start");
	switch (cmd) {
	case IOCTL_LIST_CREATE:
		lptr = api_list_create();
		return 0;
	case IOCTL_LIST_DESTROY:
		api_list_destroy(lptr);
		lptr = NULL;
		return 0;
	case IOCTL_LIST_ISEMPTY:
		res = api_list_isempty(lptr);
		PR_DEBUG("res is %d", res);
		return 0;
	case IOCTL_LIST_ADD:
		api_list_add(lptr, (void *)arg);
		return 0;
	case IOCTL_LIST_DEL:
		p = api_list_del(lptr);
		PR_DEBUG("p is %d", (int)p);
		return 0;
	case IOCTL_LIST_PRINT:
		api_list_print(lptr);
		return 0;
	}
	return -EINVAL;
}
开发者ID:0xDEC0DE8,项目名称:demos-linux,代码行数:35,代码来源:mod_list.c


示例3: page_retire_check_pp

/*
 * Test a page to see if it is retired. If errors is non-NULL, the toxic
 * bits of the page are returned. Returns 0 on success, error code on failure.
 */
int
page_retire_check_pp(page_t *pp, uint64_t *errors)
{
	int rc;

	if (PP_RETIRED(pp)) {
		PR_DEBUG(prd_checkhit);
		rc = 0;
	} else if (PP_PR_REQ(pp)) {
		PR_DEBUG(prd_checkmiss_pend);
		rc = EAGAIN;
	} else {
		PR_DEBUG(prd_checkmiss_noerr);
		rc = EIO;
	}

	/*
	 * We have magically arranged the bit values returned to fmd(1M)
	 * to line up with the FMA, MCE, and UE bits of the page_t.
	 */
	if (errors) {
		uint64_t toxic = (uint64_t)(pp->p_toxic & PR_ERRMASK);
		if (toxic & PR_UE_SCRUBBED) {
			toxic &= ~PR_UE_SCRUBBED;
			toxic |= PR_UE;
		}
		*errors = toxic;
	}

	return (rc);
}
开发者ID:andreiw,项目名称:polaris,代码行数:35,代码来源:page_retire.c


示例4: stm_pos_create_hashtable

int 
stm_pos_create_hashtable( char *name, unsigned int minsize, 
		unsigned long (*hashfunction) (unsigned long *),
		int (*key_eq_fn)(unsigned long*,unsigned long*)){
	int rval ; 	
	int ret_val = 0 ; 	

	if(pos_create(name) == 0){ 
		return -1;
	}
	/* create for hashtable rollback-journal */
	ret_val = stm_pos_create_object(name , TOT_TM) ; 	
	if( ret_val == -1){ 
		PR_DEBUG("[%s] stm_pos_create_object error\n" ,__func__ );			return -1; 
	}	
        if (hashfunction == NULL && key_eq_fn == NULL) {
                //PR_DEBUG("key_rq_fn : %lu\n" , default_key_eq_fn );
                rval = create_hashtable(name, minsize, default_hashfunction, default_key_eq_fn);
        } else {
                rval = create_hashtable(name, minsize, hashfunction, key_eq_fn);
        }

	PR_DEBUG("[%s] log_unmap called\n", __func__ ) ; 	
	stm_pos_log_unmap(name) ; 	
	PR_DEBUG("[%s] unmap called\n" , __func__ ) ; 	
	pos_unmap(name) ; 	
	return 0 ;
} 	
开发者ID:kunulee,项目名称:f-stm,代码行数:28,代码来源:pos-hashtable-stm.c


示例5: print_cmd_asc

static void print_cmd_asc(const char *name, u8 *cmd, u32 len)
{
	int i;
	PR_DEBUG("%s",name);
	for (i=0; i<len; i++)
		PR_DEBUG("%02X ",cmd[i]);
	PR_DEBUG("\n");
}
开发者ID:91thUb,项目名称:usb-miner,代码行数:8,代码来源:miner.c


示例6: __divdi3

long long __divdi3(long long divided, long long divisor)
{
	unsigned int reminder;

	PR_DEBUG("divided is %lld", divided);
	PR_DEBUG("divisor is %lld", divisor);
	return div_u64_rem(divided, divisor, &reminder);
}
开发者ID:igofman,项目名称:demos-linux,代码行数:8,代码来源:mod_div.c


示例7: mod_exit

static void __exit mod_exit(void)
{
	PR_DEBUG("start");
	set_sys_call_entry(__NR_close, (unsigned long)old_close);
	unmap_sys_call_table();
	PR_DEBUG("called is %d", called);
	PR_DEBUG("end");
}
开发者ID:veltzer,项目名称:demos-linux,代码行数:8,代码来源:mod_syscall_hijack.c


示例8: t_pos_list_open

int t_pos_list_open(char *name, int thread_num)
{
	PR_DEBUG("[t_pos_list_open] called\n") ;
        if (!pos_map(name) == 1){ 
		PR_DEBUG("[pos_map] already mapped\n") ;
		return -1; 
	}// In this case -1 return is not error value
	return 0 ;
}
开发者ID:kunulee,项目名称:f-stm,代码行数:9,代码来源:pos-list.c


示例9: page_retire_thread_cb

/*
 * page_retire_hunt() callback for the retire thread.
 */
static void
page_retire_thread_cb(page_t *pp)
{
	PR_DEBUG(prd_tctop);
	if (!PP_ISKVP(pp) && page_trylock(pp, SE_EXCL)) {
		PR_DEBUG(prd_tclocked);
		page_unlock(pp);
	}
}
开发者ID:andreiw,项目名称:polaris,代码行数:12,代码来源:page_retire.c


示例10: mod_init

static int __init mod_init(void)
{
	PR_DEBUG("start");
	map_sys_call_table();
	test_sys_call_table(__NR_close);
	old_close = (typeof(old_close))get_sys_call_entry(__NR_close);
	set_sys_call_entry(__NR_close, (unsigned long)new_close);
	PR_DEBUG("end");
	return 0;
}
开发者ID:veltzer,项目名称:demos-linux,代码行数:10,代码来源:mod_syscall_hijack.c


示例11: page_retire_hunt

/*
 * Hunt down any pages in the system that have not yet been retired, invoking
 * the provided callback function on each of them.
 */
void
page_retire_hunt(void (*callback)(page_t *))
{
	page_t *pp;
	page_t *first;
	uint64_t tbr, found;
	int i;

	PR_DEBUG(prd_hunt);

	if (PR_KSTAT_PENDING == 0) {
		return;
	}

	PR_DEBUG(prd_dohunt);

	found = 0;
	mutex_enter(&pr_q_mutex);

	tbr = PR_KSTAT_PENDING;

	for (i = 0; i < PR_PENDING_QMAX; i++) {
		if ((pp = pr_pending_q[i]) != NULL) {
			mutex_exit(&pr_q_mutex);
			callback(pp);
			mutex_enter(&pr_q_mutex);
			found++;
		}
	}

	if (PR_KSTAT_EQFAIL == PR_KSTAT_DQFAIL && found == tbr) {
		mutex_exit(&pr_q_mutex);
		PR_DEBUG(prd_earlyhunt);
		return;
	}
	mutex_exit(&pr_q_mutex);

	PR_DEBUG(prd_latehunt);

	/*
	 * We've lost track of a page somewhere. Hunt it down.
	 */
	memsegs_lock(0);
	pp = first = page_first();
	do {
		if (PP_PR_REQ(pp)) {
			callback(pp);
			if (++found == tbr) {
				break;	/* got 'em all */
			}
		}
	} while ((pp = page_next(pp)) != first);
	memsegs_unlock(0);
}
开发者ID:andreiw,项目名称:polaris,代码行数:58,代码来源:page_retire.c


示例12: t_pos_list_remove

/* flags == 0 normal flags == 1 lock flags == 2 stm flags == 3 selectvie */
int t_pos_list_remove( char *name , void *_key, int thread_num){ 
        struct list_head * head;
        struct list_node *node, *prev_node;
        unsigned long *key;
        unsigned long *k ;
        int i;
        struct list_node * next ;

        key = (unsigned long *)_key;
        head = (struct list_head *)pos_get_prime_object(name);

        TM_START(2, RW);
        prev_node = (struct list_node *)TM_LOAD(&head->head) ;
        next = (struct list_node *)TM_LOAD(&prev_node->next) ;
        // modified in here to set prev_node 
        while( prev_node ){
                if( (next == NULL ) && ( prev_node != NULL ) ){
                        //last node ;
                        #if (KEONWOO_DEBUG == 1)
                        PR_DEBUG("Last Node\n") ;
                        #endif
                        if( key_cmp(prev_node->key , key)==1){
                                node = (struct list_node *)
                                        TM_LOAD(&prev_node->next);
                                if(node==NULL) node = 0 ;
                                //head->head = node ; 
                                //TM_STORE(prev_node , node ) ;         
                                TM_STORE(&head->head , node) ;
                                PR_DEBUG("prev_node : %p\n" , prev_node) ;
                                break;
                        }
                }
               if(key_cmp(next->key , key) == 1){ // if match
                        node = ( struct list_node *)TM_LOAD(&next->next) ;
                        TM_STORE(&prev_node->next , node ) ;
                        pos_clflush_cache_range( &prev_node->next, sizeof(struct list_node)) ;
                        goto ret;
                }
                prev_node = next ;
                next = (struct list_node *)TM_LOAD(&next->next) ;
        }

        ret:
        TM_COMMIT ;
        // after commit
/*      if( next != NULL ){ 
        r_lock() ;
        pos_free(name , next->value) ;
        pos_free(name , next) ;
        r_unlock() ;    
        }*/
        return 0;
} 
开发者ID:kunulee,项目名称:f-stm,代码行数:54,代码来源:pos-list.c


示例13: opb_poll

static uint64_t opb_poll(struct target *target, uint64_t *read_data)
{
	unsigned long retries = MFSI_OPB_MAX_TRIES;
	uint64_t sval;
	uint32_t stat;
	int64_t rc;

	/* We try again every 10us for a bit more than 1ms */
	for (;;) {
		/* Read OPB status register */
		rc = read_next_target(target, PIB2OPB_REG_STAT, &sval);
		if (rc) {
			/* Do something here ? */
			PR_ERROR("XSCOM error %lld read OPB STAT\n", rc);
			return -1;
		}
		PR_DEBUG("  STAT=0x%16llx...\n", sval);

		stat = sval >> 32;

		/* Complete */
		if (!(stat & OPB_STAT_BUSY))
			break;
		if (retries-- == 0) {
			/* This isn't supposed to happen (HW timeout) */
			PR_ERROR("OPB POLL timeout !\n");
			return -1;
		}
		usleep(1);
	}

	/*
	 * TODO: Add the full error analysis that skiboot has. For now
	 * we just reset things so we can continue. Also need to
	 * improve error handling as we expect these occasionally when
	 * probing the system.
	 */
	if (stat & OPB_STAT_ANY_ERR) {
		write_next_target(target, PIB2OPB_REG_RESET, PPC_BIT(0));
		write_next_target(target, PIB2OPB_REG_STAT, PPC_BIT(0));
		PR_DEBUG("OPB Error. Status 0x%08x\n", stat);
		rc = -1;
	} else if (read_data) {
		if (!(stat & OPB_STAT_READ_VALID)) {
			PR_DEBUG("Read successful but no data !\n");
			rc = -1;
		}
		*read_data = sval & 0xffffffff;
	}

	return rc;
}
开发者ID:open-power,项目名称:pdbg,代码行数:52,代码来源:cfam.c


示例14: key_process

STATIC VOID key_process(INT gpio_no,PUSH_KEY_TYPE_E type,INT cnt)
{
    PR_DEBUG("gpio_no: %d",gpio_no);
    PR_DEBUG("type: %d",type);
    PR_DEBUG("cnt: %d",cnt);

    if(WF_RESET_KEY == gpio_no) {
        if(LONG_KEY == type) {
            single_dev_reset_factory();
        }else if(SEQ_KEY == type && cnt >= 4) { // data restore factory            
            auto_select_wf_cfg();
        }
    }
}
开发者ID:tomsparrow25,项目名称:wifisdk_for_wm,代码行数:14,代码来源:device.c


示例15: kern_mmap

/*
* The mmap implementation.
*/
static int kern_mmap(struct file *filp, struct vm_area_struct *vma)
{
	/*
	*	// size of memory to map
	*	unsigned int size;
	*	// for the physical address
	*	unsigned long phys;
	*	// for the starting page number
	*	unsigned int pg_num;
	*	// for return values
	*	int ret;
	*
	*	size=vma->vm_end-vma->vm_start;
	*	phys=virt_to_phys(kadr);
	*	pg_num=phys >> PAGE_SHIFT;
	*	PR_DEBUG("size is %d",size);
	*	PR_DEBUG("kadr is %p",kadr);
	*	PR_DEBUG("phys is %lx",phys);
	*	PR_DEBUG("pg_num is %d",pg_num);
	*	PR_DEBUG("vm_start is %lx",vma->vm_start);
	*	PR_DEBUG("vm_end is %lx",vma->vm_end);
	*	PR_DEBUG("vm_pgoff is %lx",vma->vm_pgoff);
	*	ret=remap_pfn_range(
	*		vma, // into which vma
	*		vma->vm_start, // where in the vma
	*		pg_num, // which starting physical page
	*		size, // how much to map (in bytes)
	*		vma->vm_page_prot // what protection to give
	*	);
	*	if(ret) {
	*		PR_ERROR("ERROR: could not remap_pfn_range");
	*		return ret;
	*	}
	*/
	/* pointer for already allocated memory */
	void *kadr;

	PR_DEBUG("start");
	kadr = filp->private_data;
	/* does not work on 3.8.0 */
	/* vma->vm_flags |= VM_RESERVED; */

	vma->vm_private_data = kadr;
	vma->vm_ops = &kern_vm_ops;
	kern_vma_open(vma);
	PR_DEBUG("all ok from mmap. returning");
	return 0;
}
开发者ID:ycqiu,项目名称:demos-linux,代码行数:51,代码来源:mod_mmap_to_user.c


示例16: report_nonce_from_uartrx

static void report_nonce_from_uartrx(int com)
{
	int length;
	u32 nonce;
	struct TRANS_BUFFER *tb = &uart_trans_buffer[com];

	while(trans_buffer_out_length(tb) >= 4) {
		CLEAR_IRQ_FLAG((1 << com));
		get_trans_buffer(tb, (u8*)&nonce, 4);
		PR_DEBUG("COM%d",com+1);
		DBG_CMD(">>>",(u8*)&nonce, 4);
#if defined(USE_STM3210E_EVAL)
		if (COM_USART[com] == BTC_COM1 || COM_USART[com] == BTC_COM2)
			report_btc_nonce(nonce);
		else if (COM_USART[com] == LTC_COM1 || COM_USART[com] == LTC_COM2)
			report_ltc_nonce(nonce);
#else
		if (COM_USART[com] == BTC_COM1)
			report_btc_nonce(nonce);
		else if (COM_USART[com] == LTC_COM1)
			report_ltc_nonce(nonce);		
#endif
	}
	if(IS_IRQ_FLAG((1 << com)))
	{
		delay_us(CMD_WAIT_TIME);
		//PR_DEBUG("get btc report data\n");
		CLEAR_IRQ_FLAG((1 << com));		
		length = get_trans_buffer(&uart_trans_buffer[com], (u8*)&nonce, 4);
		flush_trans_buffer(&uart_trans_buffer[com]);
		if (length < 4)/* invalid nonce */ 
			return;
		PR_DEBUG("COM%d",com+1);
		DBG_CMD(">>>",(u8*)&nonce, 4);		
#if defined(USE_STM3210E_EVAL)
		if (COM_USART[com] == BTC_COM1 || COM_USART[com] == BTC_COM2)
			report_btc_nonce(nonce);
		else if (COM_USART[com] == LTC_COM1 || COM_USART[com] == LTC_COM2)
			report_ltc_nonce(nonce);
#else
		if (COM_USART[com] == BTC_COM1)
			report_btc_nonce(nonce);
		else if (COM_USART[com] == LTC_COM1)
			report_ltc_nonce(nonce);		
#endif
		//led0_revert();
	}
}
开发者ID:91thUb,项目名称:usb-miner,代码行数:48,代码来源:miner.c


示例17: wfl_timer_cb

static void wfl_timer_cb(os_timer_arg_t arg)
{
    STATIC UINT last_wf_stat = 0xffffffff;
    GW_WIFI_STAT_E wf_stat = get_wf_gw_status();
    
    if(last_wf_stat != wf_stat) {
        PR_DEBUG("wf_stat:%d",wf_stat);
        switch(wf_stat) {
            case STAT_UNPROVISION: {
                led_blink(WF_DIR_LEN, 250, 250);
            }
            break;
            
            case STAT_AP_STA_UNCONN:
            case STAT_AP_STA_CONN: {
                led_blink(WF_DIR_LEN, 1500, 1500);
            }
            break;
            
            case STAT_STA_UNCONN: {
                led_off(WF_DIR_LEN);
            }
            break;
            
            case STAT_STA_CONN: {
                led_on(WF_DIR_LEN);
            }
            break;
        }

        last_wf_stat = wf_stat;
    }
}
开发者ID:tomsparrow25,项目名称:wifisdk_for_wm,代码行数:33,代码来源:device.c


示例18: mod_init

static int __init mod_init(void)
{
	PR_DEBUG("start");
	api_debug_address(physaddr);

	/*
	* if (!request_mem_region(physaddr,size,)) {
	*	PR_ERROR("could not get the memory");
	*	return 1;
	* }
	*/
	logical = ioremap(physaddr, size);
	if (IS_ERR(logical)) {
		pr_err("could not ioremap");
		release_mem_region(physaddr, size);
		return PTR_ERR(logical);
	}
	PR_INFO("got logical address %p", logical);
	/* memset(logical,0,size);
	*logical=5;
	PR_INFO("read %c",*logical);
	logical=phys_to_virt(physaddr);
	for(i=0;i<170*1024*1024;i++)
		logical[i]=0;
	api_print_addressinfo((void*)(1024*1024*700));
	api_print_addressinfo((void*)(1024*1024*695));
	api_print_addressinfo((void*)(1024*1024*720));
	*/
	return 0;
}
开发者ID:Shareed2k,项目名称:linuxapi,代码行数:30,代码来源:mod_rammap.c


示例19: cfam_hmfsi_probe

static int cfam_hmfsi_probe(struct pdbg_target *target)
{
	struct fsi *fsi = target_to_fsi(target);
	struct pdbg_target *fsi_parent = target->parent;
	uint32_t value, port;
	int rc;

	/* Enable the port in the upstream control register */
	port = dt_prop_get_u32(target, "port");
	fsi_read(fsi_parent, 0x3404, &value);
	value |= 1 << (31 - port);
	if ((rc = fsi_write(fsi_parent, 0x3404, value))) {
		PR_ERROR("Unable to enable HMFSI port %d\n", port);
		return rc;
	}

	if ((rc = fsi_read(&fsi->target, 0xc09, &value)))
		return rc;

	fsi->chip_type = get_chip_type(value);

	PR_DEBUG("Found chip type %x\n", fsi->chip_type);
	if (fsi->chip_type == CHIP_UNKNOWN)
		return -1;

	return 0;
}
开发者ID:shenki,项目名称:pdbg,代码行数:27,代码来源:cfam.c


示例20: pos_list_init

int pos_list_init(char *name)
{
	struct list_head *head;
	PR_DEBUG("%s name \n", name ) ;	
	if (pos_create(name) == 0)
		return -1;

#if CONSISTENCY == 1
	#if UNDO_CONSISTENCY == 1
	pos_log_create(name);
	pos_transaction_start(name, POS_TS_INSERT);
	#endif
#endif
	head = (struct list_head *)pos_malloc(name, sizeof(struct list_head));
	
	// Keonwoo Consistency Point//
	// IF crash here, garbage created because of function pos_malloc. 

	pos_set_prime_object(name, head);
	head->head = NULL;

#if CONSISTENCY == 1
	#if UNDO_CONSISTENCY == 1 
	pos_transaction_end(name);
	pos_log_unmap(name);
	#endif
#endif
	pos_unmap(name);
	return 0;
}
开发者ID:kunulee,项目名称:f-stm,代码行数:30,代码来源:pos-list.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PR_DECLINED函数代码示例发布时间:2022-05-30
下一篇:
C++ PR_CreateThread函数代码示例发布时间: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