全部博文(685)
发布时间:2014-09-23 13:57:13
新版本内核中大内核锁lock_kernel已经被完全去掉,更改老代码驱动中的lock_kernel时可改用up/down函数。关于up/down的使用,详细如下:信号量的原理就是一个整数的增减,up=加1,down = 减1;当这个值>=1时它就是属于资源释放状态,此时使用down能获得,如果<=0则无法down获得。其实信号量不是互斥的,linux内核说定.........【阅读全文】
发布时间:2014-09-22 11:02:47
#include <linux/module.h>#include <linux/delay.h>#include <linux/types.h>#include <linux/init.h>#include <linux/kernel.h>#include <linux/string.h>#include <linux/ioport.h>#include <linux/platform_device.h>#include <linux/delay.h>#include <linux/err.h>#include <linux/clk.h>#include <linu.........【阅读全文】
发布时间:2014-09-21 15:01:01
/* * This code implements the ECC algorithm used in SmartMedia. * * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. * The two unused bit are set to 1. * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC&nb.........【阅读全文】
发布时间:2014-09-20 13:58:19
/* * makeyaffs2image.c * * Makes a YAFFS2 file system image that can be used to load up a file system. * Uses default Linux MTD layout - search for "NAND LAYOUT" to change. */ #include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <sys/types.h>#in.........【阅读全文】