当前位置: 首页>>代码示例>>C++>>正文


C++ PR_DEBUG函数代码示例

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


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


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