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

C++ create_proc_read_entry函数代码示例

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

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



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

示例1: sculld_init

int sculld_init(void)
{
	int result, i;
	dev_t dev = MKDEV(sculld_major, 0);
	
	/*
	 * Register your major, and accept a dynamic number.
	 */
	if (sculld_major)
		result = register_chrdev_region(dev, sculld_devs, "sculld");
	else {
		result = alloc_chrdev_region(&dev, 0, sculld_devs, "sculld");
		sculld_major = MAJOR(dev);
	}
	if (result < 0)
		return result;

	/*
	 * Register with the driver core.
	 */
	register_ldd_driver(&sculld_driver);
	
	/* 
	 * allocate the devices -- we can't have them static, as the number
	 * can be specified at load time
	 */
	sculld_devices = kmalloc(sculld_devs*sizeof (struct sculld_dev), GFP_KERNEL);
	if (!sculld_devices) {
		result = -ENOMEM;
		goto fail_malloc;
	}
	memset(sculld_devices, 0, sculld_devs*sizeof (struct sculld_dev));
	for (i = 0; i < sculld_devs; i++) {
		sculld_devices[i].order = sculld_order;
		sculld_devices[i].qset = sculld_qset;
		sema_init (&sculld_devices[i].sem, 1);
		sculld_setup_cdev(sculld_devices + i, i);
		sculld_register_dev(sculld_devices + i, i);
	}


#ifdef SCULLD_USE_PROC /* only when available */
	create_proc_read_entry("sculldmem", 0, NULL, sculld_read_procmem, NULL);
#endif
	return 0; /* succeed */

  fail_malloc:
	unregister_chrdev_region(dev, sculld_devs);
	return result;
}
开发者ID:freebendy,项目名称:ldd_3e_example,代码行数:50,代码来源:main.c


示例2: tl880_create_proc_entry

/* Create tl880 entries in /proc */
int tl880_create_proc_entry()
{
	struct proc_dir_entry *entry;

	entry = create_proc_read_entry("tl880", 0, NULL, tl880_proc_read, NULL);
	
	if(!entry) {
		printk(KERN_ERR "tl880: failed to create /proc entry\n");
		return -EIO;
	} else {
		entry->owner = THIS_MODULE;
		return 0;
	}
}
开发者ID:mike-bourgeous,项目名称:myhd,代码行数:15,代码来源:tl880proc.c


示例3: init_smtc_stats

void init_smtc_stats(void)
{
	int i;

	for (i=0; i<NR_CPUS; i++) {
		smtc_cpu_stats[i].timerints = 0;
		smtc_cpu_stats[i].selfipis = 0;
	}

	atomic_set(&smtc_fpu_recoveries, 0);

	smtc_stats = create_proc_read_entry("smtc", 0444, NULL,
	                                    proc_read_smtc, NULL);
}
开发者ID:jakev,项目名称:CobraDroidBeta,代码行数:14,代码来源:smtc-proc.c


示例4: proc_app_info_init

void __init proc_app_info_init(void)
{
	static struct {
		char *name;
		int (*read_proc)(char*,char**,off_t,int,int*,void*);
	} *p, simple_ones[] = {
		
        {"app_info", app_version_read_proc},
		{NULL,}
	};
	for (p = simple_ones; p->name; p++)
		create_proc_read_entry(p->name, 0, NULL, p->read_proc, NULL);

}
开发者ID:Justin-G,项目名称:kernel_huawei_c8650,代码行数:14,代码来源:app_info.c


示例5: netlink_proto_init

static int __init netlink_proto_init(void)
{
	struct sk_buff *dummy_skb;

	if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) {
		printk(KERN_CRIT "netlink_init: panic\n");
		return -1;
	}
	sock_register(&netlink_family_ops);
#ifdef CONFIG_PROC_FS
	create_proc_read_entry("net/netlink", 0, 0, netlink_read_proc, NULL);
#endif
	return 0;
}
开发者ID:liexusong,项目名称:Linux-2.4.16,代码行数:14,代码来源:af_netlink.c


示例6: register_charging_i2c_dev

void register_charging_i2c_dev(struct device * dev) /* todo add destructor call for caller */
{
	dev_info(dev, "%s %d\n", __func__, __LINE__);
	if (!charger_extra_sysfs.dev) {
		charger_extra_sysfs.dev = dev ;
#ifdef AB8500_PROC_DEBUG_ENTRY
		charger_extra_sysfs.proc_entry = create_proc_read_entry("AB8500_CHG",0444,NULL,charging_readproc,dev);
#endif //AB8500_PROC_DEBUG_ENTRY

		make_dfms_battery_device ( ) ;

		wake_lock_init(&charger_extra_sysfs.test_wake_lock, WAKE_LOCK_SUSPEND, "suspend lock");
	}
}
开发者ID:j77-legacy,项目名称:android_kernel_samsung_codina,代码行数:14,代码来源:abb_links.c


示例7: prominfo_init

int __init
prominfo_init(void)
{
	struct proc_dir_entry **entp;
	cnodeid_t cnodeid;
	nasid_t nasid;
	char name[NODE_NAME_LEN];

	if (!ia64_platform_is("sn2"))
		return 0;

	TRACE();

	DPRINTK("running on cpu %d\n", smp_processor_id());
	DPRINTK("numnodes %d\n", numnodes);

	proc_entries = kmalloc(numnodes * sizeof(struct proc_dir_entry *),
			       GFP_KERNEL);

	sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);

	for (cnodeid = 0, entp = proc_entries;
	     cnodeid < numnodes;
	     cnodeid++, entp++) {
		sprintf(name, "node%d", cnodeid);
		*entp = proc_mkdir(name, sgi_prominfo_entry);
		nasid = cnodeid_to_nasid(cnodeid);
		create_proc_read_entry(
			"fit", 0, *entp, read_fit_entry,
			lookup_fit(nasid));
		create_proc_read_entry(
			"version", 0, *entp, read_version_entry,
			lookup_fit(nasid));
	}

	return 0;
}
开发者ID:Picture-Elements,项目名称:linux-2.4-peijse,代码行数:37,代码来源:prominfo_proc.c


示例8: ifx_wdt_init_module

/**
 * \fn static int __init ifx_wdt_init_module(void)
 * \brief Initialize WDT module
 * 
 * \return -ENOMEM  Failed to allocate memory
 *         -EINVAL  Failed to register char device
 *         0        OK
 * \ingroup IFX_WDT_INTERNAL 
 */
static int __init ifx_wdt_init_module(void)
{
    int result =0; 
    char ver_str[128] = {0};
  #if 1 /* ctc */
	struct proc_dir_entry*	proc_file_conf;
  #endif

    ifx_wdt_dev = (wdt_dev*)kmalloc(sizeof(wdt_dev),GFP_KERNEL);

    ifx_wdt_drv_ver(ver_str);
    
    if (ifx_wdt_dev == NULL){
            return -ENOMEM;
    }
    memset(ifx_wdt_dev,0,sizeof(wdt_dev));
    
    strcpy(ifx_wdt_dev->name, DEVICE_NAME);
    
  #if 1 /* ctc */
    result = register_chrdev(0,ifx_wdt_dev->name,&wdt_fops);
  #else
    result = register_chrdev(251,ifx_wdt_dev->name,&wdt_fops);
  #endif

    if (result < 0) {
  
            IFX_WDT_EMSG("cannot register device\n");
            kfree(ifx_wdt_dev);
            return -EINVAL;                         
    }
     
    ifx_wdt_dev->major = result; 

    /* Create proc file */
  #if 0 /* ctc 20100407 modified to added write procedure */
    create_proc_read_entry("ifx_wdt", 0, NULL, wdt_register_proc_read , NULL);
  #else
	proc_file_conf = create_proc_entry("ifx_wdt", 0666, NULL);
	if (proc_file_conf == NULL) {
		printk( "error creating entry in /proc/ifx_wdt\n" );
	} else {
		proc_file_conf->write_proc = wdt_register_proc_write;
		proc_file_conf->read_proc  = wdt_register_proc_read;
	}
  #endif

    return 0;
}
开发者ID:patrick-ken,项目名称:easybox-904-lte-firmware,代码行数:58,代码来源:ifxmips_wdt.c


示例9: create_testmode_status

void create_testmode_status(void)
{
	static uint32_t *p_smem_testmode_status ;
	static int l_testmode_status ;

	int size ;
	
	p_smem_testmode_status = smem_get_entry( SMEM_ID_VENDOR0 ,&size ) ;

	if( p_smem_testmode_status )
	l_testmode_status = *p_smem_testmode_status ;

	create_proc_read_entry("is_phone_testmode", S_IRUGO, NULL , testmode_read_proc,&l_testmode_status);

}
开发者ID:edgestorm,项目名称:lu3700-cm-gin,代码行数:15,代码来源:devices-msm7x27.c


示例10: prominfo_init

int __init prominfo_init(void)
{
	struct proc_dir_entry **entp;
	struct proc_dir_entry *p;
	cnodeid_t cnodeid;
	unsigned long nasid;
	char name[NODE_NAME_LEN];

	if (!ia64_platform_is("sn2"))
		return 0;

	proc_entries = kmalloc(num_online_nodes() * sizeof(struct proc_dir_entry *),
			       GFP_KERNEL);

	sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);

	entp = proc_entries;
	for_each_online_node(cnodeid) {
		sprintf(name, "node%d", cnodeid);
		*entp = proc_mkdir(name, sgi_prominfo_entry);
		nasid = cnodeid_to_nasid(cnodeid);
		p = create_proc_read_entry(
			"fit", 0, *entp, read_fit_entry,
			(void *)nasid);
		if (p)
			p->owner = THIS_MODULE;
		p = create_proc_read_entry(
			"version", 0, *entp, read_version_entry,
			(void *)nasid);
		if (p)
			p->owner = THIS_MODULE;
		entp++;
	}

	return 0;
}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:36,代码来源:prominfo_proc.c


示例11: xfs_init_procfs

int
xfs_init_procfs(void)
{
    if (!proc_mkdir("fs/xfs", NULL))
        goto out;

    if (!create_proc_read_entry("fs/xfs/stat", 0, NULL,
                                xfs_read_xfsstats, NULL))
        goto out_remove_entry;
    return 0;

out_remove_entry:
    remove_proc_entry("fs/xfs", NULL);
out:
    return -ENOMEM;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:16,代码来源:xfs_stats.c


示例12: create_qpst_enable_status

void create_qpst_enable_status(void)
{
	short *p_smem_qpst_enable_status ;
	static 	int qpst_enable_status = -1 ;

	int size ;
	
	p_smem_qpst_enable_status = smem_get_entry( SMEM_ID_VENDOR2 ,&size ) ;

	if( p_smem_qpst_enable_status )
		qpst_enable_status = *p_smem_qpst_enable_status ;

	if(qpst_enable_status!=-1)  //QPST_DISABLED = -1,  osbl_dload_mproc.c
			create_proc_read_entry("qpst_enable", S_IRUGO, NULL , qpst_enable_read_proc,&qpst_enable_status);

}
开发者ID:edgestorm,项目名称:lu3700-cm-gin,代码行数:16,代码来源:devices-msm7x27.c


示例13: bks_createProcDirEntry

// -------------------------------------------------------------------------
int __init bks_createProcDirEntry(void* private_data)
{
	int rc = 0;
	struct proc_dir_entry* entry = 0;

	printk(KERN_INFO "[bks] bks_createProcDirEntry()\n");

	entry = create_proc_read_entry(BKS_PROC_DIR_NAME, 0, 0, bks_procfile_read, private_data);

	if (!entry) {
		printk(KERN_ERR "[bks] unable to create dir /proc/%s\n", BKS_PROC_DIR_NAME);
		rc = -ENOMEM;
	}

	return rc;
}
开发者ID:Sweta23,项目名称:ucsc,代码行数:17,代码来源:bks_procfile.c


示例14: dicer_init

static int __init dicer_init(void)
{
	dicer = proc_mkdir("dicer", NULL);
	if (!dicer)
		goto error;
	num_dice_p = create_proc_read_entry("num_dice", 0, dicer, read_proc, NULL);
	if (!num_dice_p)
		goto cleanup;
	num_dice_p->write_proc = write_proc;
	return 0;
cleanup:
	remove_proc_entry(dicer->name, NULL);
error:
	printk(KERN_ALERT "DICE: Failed to create /proc entries\n");
	return -1;
}
开发者ID:indiana13,项目名称:dicer,代码行数:16,代码来源:dicer.c


示例15: curse_init

/*This function initializes all needed resources (only) once, during system init.*/
void curse_init (void)
{
	int j;
	curse_id_t t;

	//1. Initialize curse lookup table.
	curse_list_pointer = (struct syscurse *)kzalloc((MAX_CURSE_NO + 1) * sizeof(struct syscurse), GFP_KERNEL);
	if (curse_list_pointer == NULL) {
		printk(KERN_CRIT "CRITICAL: Curse system was not able to allocate memory. The system will probably crash later.");
		goto out;
	}
	for (j = 1, t = 0x01; j < MAX_CURSE_NO; ++j, t <<= 1) {
		curse_list_pointer[j].entry = (struct curse_list_entry *)&curse_full_list[j];
		curse_list_pointer[j].curse_bit = t;
		atomic_set(&(curse_list_pointer[j].ref_count), 0);
		curse_list_pointer[j].var_flags = _INHER_MASK;
		SET_INHER(j);
		curse_list_pointer[j].status = IMPLEMENTED;
		spin_lock_init(&(curse_list_pointer[j].flag_lock));
		curse_list_pointer[j].functions = &fun_array[j];
	}
	curse_list_pointer[0].status = INVALID_CURSE;
	curse_list_pointer[0].curse_bit = 0x0;
	atomic_set(&(curse_list_pointer[0].ref_count), 0);
	curse_list_pointer[0].entry = (struct curse_list_entry *)&curse_full_list[0];
	spin_lock_init(&(curse_list_pointer[0].flag_lock));
	curse_list_pointer[0].functions = &fun_array[0];

	//2. Initialize active status boolean.	::	Could default on an initial status here (based on build options).
	CURSE_SYSTEM_DOWN;

	//3. Populate entries in /proc filesystem.
	if (!(dir_node = proc_mkdir(PROC_DIR_NAME, NULL)))
		goto out;
	if (!(output_node = create_proc_read_entry(PROC_OUT_NODE_NAME, (S_IRUSR | S_IRGRP | S_IROTH), dir_node, proc_curse_read, curse_list_pointer)))
		goto out_dirred;

	//FIXME: Is there anything else to be done here?

	goto out;
//out_nodded:
	remove_proc_entry(PROC_OUT_NODE_NAME, dir_node);
out_dirred:
	remove_proc_entry(PROC_DIR_NAME, NULL);
out:
	return;		//Stub: there might be others below.
}
开发者ID:Ale1ster,项目名称:kerneldir,代码行数:48,代码来源:curse_externals.c


示例16: wlan_proc_entry

/** 
 *  @brief create wlan proc file
 *
 *  @param priv	   pointer wlan_private
 *  @param dev     pointer net_device
 *  @return 	   N/A
 */
void
wlan_proc_entry(wlan_private * priv, struct net_device *dev)
{

#ifdef	CONFIG_PROC_FS
    diag_printf("Creating Proc Interface\n");

    if (!priv->proc_entry) {
        priv->proc_entry = proc_mkdir("wlan", proc_net);

        if (priv->proc_entry) {
            priv->proc_dev = create_proc_read_entry
                ("info", 0, priv->proc_entry, wlan_proc_read, dev);
        }
    }
#endif
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:24,代码来源:wlan_proc.c


示例17: msm8k_pcm_init

static int __init msm8k_pcm_init(void)
{
	int rc;
	D("%s\n", __func__);

	rc = misc_register(&msm8k_pcm_misc);
	wake_lock_init(&pcm_wakelock, WAKE_LOCK_SUSPEND, "audio_pcm");
	wake_lock_init(&pcm_idlelock, WAKE_LOCK_IDLE, "audio_pcm_idle");
	mutex_init(&pcm_lock);

#ifdef CONFIG_PROC_FS
	create_proc_read_entry(MSM8K_PCM_PROC_NAME,
			0, NULL, msm8k_pcm_read_proc, NULL);
#endif

	return rc;
}
开发者ID:Cicatrize,项目名称:HTC-Supersonic-Incredible-2.6.29,代码行数:17,代码来源:msm8k_pcm.c


示例18: gpt_mod_init

static int __init gpt_mod_init(void)
{
    create_proc_read_entry("gpt_stat", S_IRUGO, NULL, gpt_stat_read, NULL);

#if 0
#ifndef CONFIG_MT6582_FPGA

    printk("GPT: chipver=%d\n", mt_get_chip_sw_ver());
#else
    printk("GPT: FPGA2\n" );
#endif

#endif
	printk("GPT: iniit\n" );

    return 0;
}
开发者ID:Proshivalskiy,项目名称:MT6582_kernel_source,代码行数:17,代码来源:mt_gpt.c


示例19: create_smpl_reset_status

void create_smpl_reset_status(void)
{
    static uint32_t *p_smem_pwr_on_status ;
    static int l_power_on_status ;

    int size ;

    p_smem_pwr_on_status = smem_get_entry( SMEM_POWER_ON_STATUS_INFO, &size ) ;

    if( p_smem_pwr_on_status )
        l_power_on_status = *p_smem_pwr_on_status ;

    l_power_on_status = (l_power_on_status & 0x8) ? 1 : 0;
    
    create_proc_read_entry("smpl_reset", S_IRUGO, NULL , smpl_reset_read_proc,&l_power_on_status);

}
开发者ID:edgestorm,项目名称:lu3700-cm-gin,代码行数:17,代码来源:devices-msm7x27.c


示例20: register_rtc

int register_rtc(struct rtc_ops *ops)
{
	int ret = -EBUSY;

	mutex_lock(&rtc_mutex);
	if (rtc_ops == NULL) {
		rtc_ops = ops;

		ret = misc_register(&rtc_miscdev);
		if (ret == 0)
			create_proc_read_entry("driver/rtc", 0, NULL,
					       rtc_read_proc, ops);
	}
	mutex_unlock(&rtc_mutex);

	return ret;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:17,代码来源:rtctime.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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