常用Linux標頭檔
/* linux/drivers/sys-print.c<br /> * Author: Woodpecker <Pecker.Hu@gmail.com><br /> *<br /> * use sysfs to implement a Dynamic printk.<br /> *<br /> * This file is subject to the terms and conditions of the GNU General Public<br /> * License. See the file COPYING in the main directory of this archive for<br /> * more details.<br /> *<br /> */</p><p>#include <linux/module.h>/* MODULE_LICENSE */<br />#include <linux/kernel.h>/* printk,pr_info */<br />#include <linux/errno.h>/* EINVAL,EAGAIN,etc. */<br />#include <linux/err.h>/* IS_ERR */<br />#include <linux/init.h>/* module_init */<br />#include <linux/delay.h>/* mdelay,msleep */<br />#include <linux/hrtimer.h>/* hrtimer APIs */<br />#include <linux/time.h>/* struct timespec */<br />#include <linux/device.h>/* device_create */<br />#include <linux/fs.h>/* */<br />#include <linux/slab.h> /* kzalloc */</p><p>MODULE_AUTHOR("Woodpecker <Pecker.Hu@gmail.com>");<br />MODULE_DESCRIPTION("Dynamic print");<br />MODULE_LICENSE("GPL");
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1)) /* 0XFFFFF000 */
2010/09/08 Nanjing