Linux设备驱动程序第二版

源代码在线查看: import.c

软件大小: 641 K
上传用户: dujibei
关键词: Linux 设备驱动 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*				 * import.c -- a module using a symbol from export.c				 *				 * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet				 * Copyright (C) 2001 O'Reilly & Associates				 *				 * The source code in this file can be freely used, adapted,				 * and redistributed in source or binary form, so long as an				 * acknowledgment appears in derived source files.  The citation				 * should list that the code comes from the book "Linux Device				 * Drivers" by Alessandro Rubini and Jonathan Corbet, published				 * by O'Reilly & Associates.   No warranty is attached;				 * we cannot take responsibility for errors or fitness for use.				 *				 */								#ifndef __KERNEL__				#  define __KERNEL__				#endif				#ifndef MODULE				#  define MODULE				#endif								/*				 * Use versioning if needed				 */				#include  /* retrieve the CONFIG_* macros */				#ifdef CONFIG_MODVERSIONS				#   undef MODVERSIONS /* it might be defined */				#   define MODVERSIONS				#endif								#ifdef MODVERSIONS				#  include 				#  include "export.ver"				#endif												#include 				#include 				#include "sysdep.h"								extern int export_function(int, int);								int import_init(void)				{				    int i = export_function(2,2);				    printk("import: my mate tells that 2+2 = %i\n",i);				    return 0;				}								void import_cleanup(void)				{}								module_init(import_init);				module_exit(import_cleanup);							

相关资源