aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-09-21 04:09:58 +0000
committerEric Andersen <andersen@codepoet.org>2000-09-21 04:09:58 +0000
commitc873d61008d544fa3fba40232f0c6f6f87c534ab (patch)
tree79b9a2ab235d699a2b317d23c69b22b3c480e9f2
parentba35b984448810f6ead7579f85b28cf089f64033 (diff)
downloadbusybox-w32-c873d61008d544fa3fba40232f0c6f6f87c534ab.tar.gz
busybox-w32-c873d61008d544fa3fba40232f0c6f6f87c534ab.tar.bz2
busybox-w32-c873d61008d544fa3fba40232f0c6f6f87c534ab.zip
Remove all the kernel headers so it will compile under libc5
-Erik
-rw-r--r--fbset.c61
-rw-r--r--util-linux/fbset.c61
2 files changed, 98 insertions, 24 deletions
diff --git a/fbset.c b/fbset.c
index 2fcc7c294..235338c55 100644
--- a/fbset.c
+++ b/fbset.c
@@ -32,15 +32,9 @@
32#include <errno.h> 32#include <errno.h>
33#include <ctype.h> 33#include <ctype.h>
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#include <linux/fb.h>
36#include <linux/version.h>
37 35
38#define PERROR(ctx) do { perror(ctx); exit(1); } while(0) 36#define PERROR(ctx) do { perror(ctx); exit(1); } while(0)
39 37
40#ifndef KERNEL_VERSION
41#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
42#endif
43
44#define DEFAULTFBDEV "/dev/fb0" 38#define DEFAULTFBDEV "/dev/fb0"
45#define DEFAULTFBMODE "/etc/fb.modes" 39#define DEFAULTFBMODE "/etc/fb.modes"
46 40
@@ -88,6 +82,55 @@
88 82
89static unsigned int g_options = 0; 83static unsigned int g_options = 0;
90 84
85/* Stuff stolen from the kernel's fb.h */
86#define FBIOGET_VSCREENINFO 0x4600
87#define FBIOPUT_VSCREENINFO 0x4601
88#define __u32 unsigned int
89struct fb_bitfield {
90 __u32 offset; /* beginning of bitfield */
91 __u32 length; /* length of bitfield */
92 __u32 msb_right; /* != 0 : Most significant bit is */
93 /* right */
94};
95struct fb_var_screeninfo {
96 __u32 xres; /* visible resolution */
97 __u32 yres;
98 __u32 xres_virtual; /* virtual resolution */
99 __u32 yres_virtual;
100 __u32 xoffset; /* offset from virtual to visible */
101 __u32 yoffset; /* resolution */
102
103 __u32 bits_per_pixel; /* guess what */
104 __u32 grayscale; /* != 0 Graylevels instead of colors */
105
106 struct fb_bitfield red; /* bitfield in fb mem if true color, */
107 struct fb_bitfield green; /* else only length is significant */
108 struct fb_bitfield blue;
109 struct fb_bitfield transp; /* transparency */
110
111 __u32 nonstd; /* != 0 Non standard pixel format */
112
113 __u32 activate; /* see FB_ACTIVATE_* */
114
115 __u32 height; /* height of picture in mm */
116 __u32 width; /* width of picture in mm */
117
118 __u32 accel_flags; /* acceleration flags (hints) */
119
120 /* Timing: All values in pixclocks, except pixclock (of course) */
121 __u32 pixclock; /* pixel clock in ps (pico seconds) */
122 __u32 left_margin; /* time from sync to picture */
123 __u32 right_margin; /* time from picture to sync */
124 __u32 upper_margin; /* time from sync to picture */
125 __u32 lower_margin;
126 __u32 hsync_len; /* length of horizontal sync */
127 __u32 vsync_len; /* length of vertical sync */
128 __u32 sync; /* see FB_SYNC_* */
129 __u32 vmode; /* see FB_VMODE_* */
130 __u32 reserved[6]; /* Reserved for future compatibility */
131};
132
133
91struct cmdoptions_t { 134struct cmdoptions_t {
92 char *name; 135 char *name;
93 unsigned char param_count; 136 unsigned char param_count;
@@ -271,16 +314,10 @@ static void showmode(struct fb_var_screeninfo *v)
271#endif 314#endif
272 printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, 315 printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres,
273 v->xres_virtual, v->yres_virtual, v->bits_per_pixel); 316 v->xres_virtual, v->yres_virtual, v->bits_per_pixel);
274#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
275 printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, 317 printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin,
276 v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, 318 v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len,
277 v->vsync_len); 319 v->vsync_len);
278 printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); 320 printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false"));
279#else
280 printf("\ttimings %lu %lu %lu %lu %lu %lu %lu\n", v->pixclock,
281 v->left_margin, v->right_margin, v->upper_margin,
282 v->lower_margin, v->hsync_len, v->vsync_len);
283#endif
284 printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, 321 printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length,
285 v->red.offset, v->green.length, v->green.offset, v->blue.length, 322 v->red.offset, v->green.length, v->green.offset, v->blue.length,
286 v->blue.offset, v->transp.length, v->transp.offset); 323 v->blue.offset, v->transp.length, v->transp.offset);
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 2fcc7c294..235338c55 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -32,15 +32,9 @@
32#include <errno.h> 32#include <errno.h>
33#include <ctype.h> 33#include <ctype.h>
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#include <linux/fb.h>
36#include <linux/version.h>
37 35
38#define PERROR(ctx) do { perror(ctx); exit(1); } while(0) 36#define PERROR(ctx) do { perror(ctx); exit(1); } while(0)
39 37
40#ifndef KERNEL_VERSION
41#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
42#endif
43
44#define DEFAULTFBDEV "/dev/fb0" 38#define DEFAULTFBDEV "/dev/fb0"
45#define DEFAULTFBMODE "/etc/fb.modes" 39#define DEFAULTFBMODE "/etc/fb.modes"
46 40
@@ -88,6 +82,55 @@
88 82
89static unsigned int g_options = 0; 83static unsigned int g_options = 0;
90 84
85/* Stuff stolen from the kernel's fb.h */
86#define FBIOGET_VSCREENINFO 0x4600
87#define FBIOPUT_VSCREENINFO 0x4601
88#define __u32 unsigned int
89struct fb_bitfield {
90 __u32 offset; /* beginning of bitfield */
91 __u32 length; /* length of bitfield */
92 __u32 msb_right; /* != 0 : Most significant bit is */
93 /* right */
94};
95struct fb_var_screeninfo {
96 __u32 xres; /* visible resolution */
97 __u32 yres;
98 __u32 xres_virtual; /* virtual resolution */
99 __u32 yres_virtual;
100 __u32 xoffset; /* offset from virtual to visible */
101 __u32 yoffset; /* resolution */
102
103 __u32 bits_per_pixel; /* guess what */
104 __u32 grayscale; /* != 0 Graylevels instead of colors */
105
106 struct fb_bitfield red; /* bitfield in fb mem if true color, */
107 struct fb_bitfield green; /* else only length is significant */
108 struct fb_bitfield blue;
109 struct fb_bitfield transp; /* transparency */
110
111 __u32 nonstd; /* != 0 Non standard pixel format */
112
113 __u32 activate; /* see FB_ACTIVATE_* */
114
115 __u32 height; /* height of picture in mm */
116 __u32 width; /* width of picture in mm */
117
118 __u32 accel_flags; /* acceleration flags (hints) */
119
120 /* Timing: All values in pixclocks, except pixclock (of course) */
121 __u32 pixclock; /* pixel clock in ps (pico seconds) */
122 __u32 left_margin; /* time from sync to picture */
123 __u32 right_margin; /* time from picture to sync */
124 __u32 upper_margin; /* time from sync to picture */
125 __u32 lower_margin;
126 __u32 hsync_len; /* length of horizontal sync */
127 __u32 vsync_len; /* length of vertical sync */
128 __u32 sync; /* see FB_SYNC_* */
129 __u32 vmode; /* see FB_VMODE_* */
130 __u32 reserved[6]; /* Reserved for future compatibility */
131};
132
133
91struct cmdoptions_t { 134struct cmdoptions_t {
92 char *name; 135 char *name;
93 unsigned char param_count; 136 unsigned char param_count;
@@ -271,16 +314,10 @@ static void showmode(struct fb_var_screeninfo *v)
271#endif 314#endif
272 printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, 315 printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres,
273 v->xres_virtual, v->yres_virtual, v->bits_per_pixel); 316 v->xres_virtual, v->yres_virtual, v->bits_per_pixel);
274#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
275 printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, 317 printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin,
276 v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, 318 v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len,
277 v->vsync_len); 319 v->vsync_len);
278 printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); 320 printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false"));
279#else
280 printf("\ttimings %lu %lu %lu %lu %lu %lu %lu\n", v->pixclock,
281 v->left_margin, v->right_margin, v->upper_margin,
282 v->lower_margin, v->hsync_len, v->vsync_len);
283#endif
284 printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, 321 printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length,
285 v->red.offset, v->green.length, v->green.offset, v->blue.length, 322 v->red.offset, v->green.length, v->green.offset, v->blue.length,
286 v->blue.offset, v->transp.length, v->transp.offset); 323 v->blue.offset, v->transp.length, v->transp.offset);