首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 嵌入式系统 > 基于linux-2.6.38内核的嵌入式驱动常用的函数调用

基于linux-2.6.38内核的嵌入式驱动常用的函数调用

资料介绍
基于linux-2.6.38内核的嵌入式驱动常用的函数调用

基于linux-2.6.38内核的嵌入式驱动常用的函数调用:
1.static inline unsigned long copy_from_user(void __user *to,const void
*from, unsigned long n)
{
......
}

作用:用copy_from_user(),用户空间到内核空间传递数据,参数:目的,源,长度/??
小,返回值是n??
举例:copy_from_user(&val,buf,count);

2.static inline int register_chrdev(unsigned int major, const char
*name,const struct file_operations *fops)
{
......
}
作用:注册,即告诉内核将结构体static struct file_operations xxx_fops

举例:major=register_chrdev(0,"first_drv_led",&first_drv_led_fops);

3.static inline void __iomem *ioremap(phys_addr_t offset, unsigned long
size)
{
......
}

举例:gpkcon0 = (volatile unsigned long *)ioremap(0x7F008800, 16);

4.struct class *__class_create(struct module *owner, const char
*name,struct lock_class_key *key)
{
标签:linux-2.6.38内核
基于linux-2.6.38内核的嵌入式驱动常用的函数调用
本地下载

评论