#include <linux/compat.h>
#include <linux/console.h>
#include <linux/fb.h>
#include <linux/fbcon.h>
#include <linux/major.h>
#include "fb_internal.h"
static struct fb_info *file_fb_info(struct file *file)
{ … }
static ssize_t fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{ … }
static ssize_t fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{ … }
static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{ … }
static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ … }
#ifdef CONFIG_COMPAT
struct fb_fix_screeninfo32 { … };
struct fb_cmap32 { … };
static int fb_getput_cmap(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{ … }
static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
struct fb_fix_screeninfo32 __user *fix32)
{ … }
static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{ … }
static long fb_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
#endif
static int fb_mmap(struct file *file, struct vm_area_struct *vma)
{ … }
static int fb_open(struct inode *inode, struct file *file)
__acquires(&info->lock)
__releases(&info->lock)
{ … }
static int fb_release(struct inode *inode, struct file *file)
__acquires(&info->lock)
__releases(&info->lock)
{ … }
#if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU)
static unsigned long get_fb_unmapped_area(struct file *filp,
unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags)
{
struct fb_info * const info = filp->private_data;
unsigned long fb_size = PAGE_ALIGN(info->fix.smem_len);
if (pgoff > fb_size || len > fb_size - pgoff)
return -EINVAL;
return (unsigned long)info->screen_base + pgoff;
}
#endif
static const struct file_operations fb_fops = …;
int fb_register_chrdev(void)
{ … }
void fb_unregister_chrdev(void)
{ … }