- 博客(4)
- 收藏
- 关注
翻译 linux应用层open,close,read,write
1. open 函数说明open 函数是用于打开或创建文件,在打开或创建文件时可以指定文件的属性及用户的权限等各种参数。头文件: #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h>函数原型int open(const char ...
2020-02-29 21:18:42
552
原创 linux 4.0版本内核的中断注册
前言Linux4.0的内核,中断注册时(request_irq()),不能使用硬中断号直接注册。要通过设备树获取内核虚拟中断号,然后注册中断。一、旧版本内核的注册方法。如下:在linux内核中用于申请中断的函数是request_irq(),函数原型在Kernel/irq/manage.c中定义:int request_irq(unsigned int irq, ir...
2020-02-18 21:12:42
671
翻译 linux延时函数
应用程序的延时函数:头文件: #include <unistd.h>函数:unsigned int sleep (unsigned int seconds);//n秒此外:int usleep (useconds_t usec);//n微秒实际上用select不错的选择,如下:#include <time.h>#include <sys/time.h...
2019-07-27 15:30:34
782
原创 linux kfifo的使用
Linux kfifo的使用基于3.10-lsti内核Kfifo也叫内核队列。1.首先定义struct kfifo fifo;2. kfifo初始化。方法一:动态分配并初始化Int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask)* kfifo_alloc - dynamically
2017-08-17 08:39:10
7156
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人