#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/fb.h>
#include <linux/init.h>
#define VIDEOMEMSIZE …
static void *videomemory;
static u_long videomemorysize = …;
module_param(videomemorysize, ulong, 0);
MODULE_PARM_DESC(…) …;
static char *mode_option = …;
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(…) …;
static const struct fb_videomode vfb_default = …;
static struct fb_fix_screeninfo vfb_fix = …;
static bool vfb_enable __initdata = …;
module_param(vfb_enable, bool, 0);
MODULE_PARM_DESC(…) …;
static int vfb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info);
static int vfb_set_par(struct fb_info *info);
static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info);
static int vfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info);
static int vfb_mmap(struct fb_info *info,
struct vm_area_struct *vma);
static const struct fb_ops vfb_ops = …;
static u_long get_line_length(int xres_virtual, int bpp)
{ … }
static int vfb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{ … }
static int vfb_set_par(struct fb_info *info)
{ … }
static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{ … }
static int vfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{ … }
static int vfb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{ … }
#ifndef MODULE
static int __init vfb_setup(char *options)
{ … }
#endif
static int vfb_probe(struct platform_device *dev)
{ … }
static void vfb_remove(struct platform_device *dev)
{ … }
static struct platform_driver vfb_driver = …;
static struct platform_device *vfb_device;
static int __init vfb_init(void)
{ … }
module_init(…) …;
#ifdef MODULE
static void __exit vfb_exit(void)
{
platform_device_unregister(vfb_device);
platform_driver_unregister(&vfb_driver);
}
module_exit(vfb_exit);
MODULE_DESCRIPTION("Virtual Frame Buffer driver");
MODULE_LICENSE("GPL");
#endif