7 #include <linux/kernel.h>
8 #include <linux/module.h>
9 #include <linux/string.h>
22 memset(var, 0,
sizeof(*var));
33 static unsigned long sbusfb_mmapsize(
long size,
unsigned long fbsize)
36 if (size >= 0)
return size;
37 return fbsize * (-
size);
41 unsigned long physbase,
43 unsigned long iospace,
47 unsigned long map_offset = 0;
51 if (!(vma->
vm_flags & (VM_SHARED | VM_MAYSHARE)))
65 for (page = 0; page <
size; ){
67 for (i = 0; map[
i].
size; i++)
68 if (map[i].voff == off+page) {
69 map_size = sbusfb_mmapsize(map[i].size, fbsize);
71 #define POFF_MASK (PAGE_MASK|0x1UL)
73 #define POFF_MASK (PAGE_MASK)
82 if (page + map_size > size)
83 map_size = size -
page;
101 int type,
int fb_depth,
unsigned long fb_size)
120 u8 red8, green8, blue8;
121 unsigned char __user *ured;
122 unsigned char __user *ugreen;
123 unsigned char __user *ublue;
138 for (i = 0; i <
count; i++) {
159 unsigned char __user *ured;
160 unsigned char __user *ugreen;
161 unsigned char __user *ublue;
173 if (index + count > cmap->
len)
176 for (i = 0; i <
count; i++) {
177 red = cmap->
red[index +
i] >> 8;
178 green = cmap->
green[index +
i] >> 8;
179 blue = cmap->
blue[index +
i] >> 8;
194 static int fbiogetputcmap(
struct fb_info *
info,
unsigned int cmd,
unsigned long arg)
210 return info->
fbops->fb_ioctl(info,
216 static int fbiogscursor(
struct fb_info *info,
unsigned long arg)
224 2 *
sizeof (
short) + 2 *
sizeof(
struct fbcurpos));
255 return info->
fbops->fb_ioctl(info, cmd, arg);
257 return fbiogetputcmap(info, cmd, arg);
259 return fbiogetputcmap(info, cmd, arg);
261 return fbiogscursor(info, arg);