summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-29 14:09:34 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-29 14:09:34 +0000
commit83987a59c13ace001d89b978d7b3c2b6eaecb968 (patch)
tree73505fde3f61261330dfb8ad34ae6554ec2058a5
parent2009-07-29 Roxana Leontie <roxana.leontie@gmail.com> (diff)
downloadrtems-83987a59c13ace001d89b978d7b3c2b6eaecb968.tar.bz2
2009-07-29 Roxana Leontie <roxana.leontie@gmail.com>
* Makefile.am, preinstall.am, console/fb_vga.c: Switch to using frame_buffer_ naming. Joel cleaned up formatting and removed tabs that were there long before Roxana touched this file. * console/fb_vga.h: Removed.
-rw-r--r--c/src/lib/libbsp/i386/pc386/ChangeLog7
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.am2
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/fb_vga.c175
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/fb_vga.h74
-rw-r--r--c/src/lib/libbsp/i386/pc386/preinstall.am4
5 files changed, 87 insertions, 175 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/ChangeLog b/c/src/lib/libbsp/i386/pc386/ChangeLog
index e364b058c7..840d5b49d3 100644
--- a/c/src/lib/libbsp/i386/pc386/ChangeLog
+++ b/c/src/lib/libbsp/i386/pc386/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-29 Roxana Leontie <roxana.leontie@gmail.com>
+
+ * Makefile.am, preinstall.am, console/fb_vga.c: Switch to using
+ frame_buffer_ naming. Joel cleaned up formatting and removed tabs
+ that were there long before Roxana touched this file.
+ * console/fb_vga.h: Removed.
+
2009-07-24 Roxana Leontie <roxana.leontie@gmail.com>
* console/fb_vga.c: divided fb_screeninfo structure into
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index 928dd1022f..c2e9d8810a 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -65,7 +65,7 @@ libbsp_a_SOURCES += clock/ckinit.c clock/todcfg.c ../../shared/tod.c \
include_rtemsdir = $(includedir)/rtems
include_rtems_HEADERS = console/keyboard.h console/kd.h \
- console/serial_mouse.h console/ps2_drv.h console/fb_vga.h
+ console/serial_mouse.h console/ps2_drv.h
include_HEADERS += ../../i386/shared/comm/i386_io.h
# console
diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vga.c b/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
index 20f91de012..50018280fd 100644
--- a/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
+++ b/c/src/lib/libbsp/i386/pc386/console/fb_vga.c
@@ -30,77 +30,85 @@ extern void ega_hwterm( void );
/* screen information for the VGA driver */
static struct fb_var_screeninfo fb_var =
{
- 640, 480, /* screen size x, y */
- 4 /* bits per pixel */
+ .xres = 640,
+ .yres = 480,
+ .bits_per_pixel = 4
};
static struct fb_fix_screeninfo fb_fix =
{
- (volatile char *)0xA0000, /* buffer pointer */
- 0x10000, /* buffer size */
- FB_TYPE_VGA_PLANES, /* type of dsplay */
- FB_VISUAL_PSEUDOCOLOR, /* color scheme used */
- 80 /* chars per line */
+ .smem_start = (volatile char *)0xA0000, /* buffer pointer */
+ .smem_len = 0x10000, /* buffer size */
+ .type = FB_TYPE_VGA_PLANES, /* type of dsplay */
+ .visual = FB_VISUAL_PSEUDOCOLOR, /* color scheme used */
+ .line_length = 80 /* chars per line */
};
static uint16_t red16[] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
- 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
+ 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
+ 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
};
static uint16_t green16[] = {
- 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa,
- 0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
+ 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa,
+ 0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
};
static uint16_t blue16[] = {
- 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
- 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
+ 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
+ 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
};
/*
* fbvga device driver INITIALIZE entry point.
*/
-rtems_device_driver
-fbvga_initialize( rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
+rtems_device_driver frame_buffer_initialize(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+)
{
- rtems_status_code status;
+ rtems_status_code status;
printk( "FBVGA -- driver initializing..\n" );
+
/*
* Register the device
*/
status = rtems_io_register_name ("/dev/fb0", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- {
- printk("Error registering FBVGA device!\n");
- rtems_fatal_error_occurred( status );
+ if (status != RTEMS_SUCCESSFUL) {
+ printk("Error registering FBVGA device!\n");
+ rtems_fatal_error_occurred( status );
}
+
return RTEMS_SUCCESSFUL;
}
/*
* fbvga device driver OPEN entry point
*/
-rtems_device_driver
-fbvga_open( rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
+rtems_device_driver frame_buffer_open(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+)
{
-/* rtems_status_code status; */
+ ega_hwinit();
printk( "FBVGA open called.\n" );
+
return RTEMS_SUCCESSFUL;
}
/*
* fbvga device driver CLOSE entry point
*/
-rtems_device_driver
-fbvga_close(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
+rtems_device_driver frame_buffer_close(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+)
{
+ ega_hwterm();
printk( "FBVGA close called.\n" );
+
return RTEMS_SUCCESSFUL;
}
@@ -108,27 +116,33 @@ fbvga_close(rtems_device_major_number major,
* fbvga device driver READ entry point.
* Read characters from the PS/2 mouse.
*/
-rtems_device_driver
-fbvga_read( rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
+rtems_device_driver frame_buffer_read(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+)
{
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
+
printk( "FBVGA read called.\n" );
+
rw_args->bytes_moved = 0;
+
return RTEMS_SUCCESSFUL;
}
/*
- * fbvga device driver WRITE entry point.
+ * frame_buffer device driver WRITE entry point.
* Write characters to the PS/2 mouse.
*/
-rtems_device_driver
-fbvga_write( rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
+rtems_device_driver frame_buffer_write(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+)
{
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
+
printk( "FBVGA write called.\n" );
rw_args->bytes_moved = 0;
return RTEMS_SUCCESSFUL;
@@ -150,11 +164,10 @@ static int get_palette( struct fb_cmap *cmap )
{
uint32_t i;
- if( cmap->start + cmap->len >= 16 )
- return 1;
+ if ( cmap->start + cmap->len >= 16 )
+ return 1;
- for( i = 0; i < cmap->len; i++ )
- {
+ for( i = 0; i < cmap->len; i++ ) {
cmap->red[ cmap->start + i ] = red16[ cmap->start + i ];
cmap->green[ cmap->start + i ] = green16[ cmap->start + i ];
cmap->blue[ cmap->start + i ] = blue16[ cmap->start + i ];
@@ -166,11 +179,10 @@ static int set_palette( struct fb_cmap *cmap )
{
uint32_t i;
- if( cmap->start + cmap->len >= 16 )
- return 1;
+ if ( cmap->start + cmap->len >= 16 )
+ return 1;
- for( i = 0; i < cmap->len; i++ )
- {
+ for( i = 0; i < cmap->len; i++ ) {
red16[ cmap->start + i ] = cmap->red[ cmap->start + i ];
green16[ cmap->start + i ] = cmap->green[ cmap->start + i ];
blue16[ cmap->start + i ] = cmap->blue[ cmap->start + i ];
@@ -182,65 +194,36 @@ static int set_palette( struct fb_cmap *cmap )
* IOCTL entry point -- This method is called to carry
* all services of this interface.
*/
-rtems_device_driver
-fbvga_control( rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
+rtems_device_driver frame_buffer_control(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
)
{
- rtems_libio_ioctl_args_t *args = arg;
- printk( "FBVGA ioctl called, cmd=%x\n", args->command );
- switch( args->command )
- {
- case FBIOGET_FSCREENINFO:
+ rtems_libio_ioctl_args_t *args = arg;
+
+ printk( "FBVGA ioctl called, cmd=%x\n", args->command );
+
+ switch( args->command ) {
+ case FBIOGET_FSCREENINFO:
args->ioctl_return = get_fix_screen_info( args->buffer );
break;
- case FBIOGET_VSCREENINFO:
+ case FBIOGET_VSCREENINFO:
args->ioctl_return = get_var_screen_info( args->buffer );
break;
- case FBIOPUT_VSCREENINFO:
+ case FBIOPUT_VSCREENINFO:
/* not implemented yet*/
break;
- case FBIOGETCMAP:
+ case FBIOGETCMAP:
args->ioctl_return = get_palette( args->buffer );
break;
- case FBIOPUTCMAP:
+ case FBIOPUTCMAP:
args->ioctl_return = set_palette( args->buffer );
break;
- /* this function would execute one of the routines of the
- * interface based on the operation requested
- */
- case FB_EXEC_FUNCTION:
- {
- struct fb_exec_function *env = args->buffer;
- switch( env->func_no )
- {
- case FB_FUNC_ENTER_GRAPHICS:
- /* enter graphics mode*/
- ega_hwinit();
- break;
-
- case FB_FUNC_EXIT_GRAPHICS:
- /* leave graphics mode*/
- ega_hwterm();
- break;
-
- case FB_FUNC_IS_DIRTY:
- break;
-
- case FB_FUNC_GET_MODE:
- break;
-
- default:
- break;
- }
- }
- /* no break on purpose */
- default:
- args->ioctl_return = 0;
- break;
-
- }
- return RTEMS_SUCCESSFUL;
+ default:
+ args->ioctl_return = 0;
+ break;
+ }
+ return RTEMS_SUCCESSFUL;
}
diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vga.h b/c/src/lib/libbsp/i386/pc386/console/fb_vga.h
deleted file mode 100644
index 333f683868..0000000000
--- a/c/src/lib/libbsp/i386/pc386/console/fb_vga.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef __fbvga_drv__
-#define __fbvga_drv__
-/***************************************************************************
- *
- * $Header$
- *
- * Copyright (c) 2000 -- Rosimildo da Silva.
- *
- * MODULE DESCRIPTION:
- * Prototype routines for the fbvga driver.
- *
- * by: Rosimildo da Silva:
- * rdasilva@connecttel.com
- * http://www.connecttel.com
- *
- ****************************************************************************/
-
-/* functions */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* fbvga prototype entry points */
-rtems_device_driver fbvga_initialize(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_open(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_close(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_read(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_write(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-rtems_device_driver fbvga_control(
- rtems_device_major_number,
- rtems_device_minor_number,
- void *
-);
-
-#define FBVGA_DRIVER_TABLE_ENTRY \
- { fbvga_initialize, fbvga_open, fbvga_close, \
- fbvga_read, fbvga_write, fbvga_control }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __fbvga_drv__ */
diff --git a/c/src/lib/libbsp/i386/pc386/preinstall.am b/c/src/lib/libbsp/i386/pc386/preinstall.am
index b468c543af..f72292bc2c 100644
--- a/c/src/lib/libbsp/i386/pc386/preinstall.am
+++ b/c/src/lib/libbsp/i386/pc386/preinstall.am
@@ -118,10 +118,6 @@ $(PROJECT_INCLUDE)/rtems/ps2_drv.h: console/ps2_drv.h $(PROJECT_INCLUDE)/rtems/$
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/ps2_drv.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/ps2_drv.h
-$(PROJECT_INCLUDE)/rtems/fb_vga.h: console/fb_vga.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/fb_vga.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/fb_vga.h
-
$(PROJECT_INCLUDE)/i386_io.h: ../../i386/shared/comm/i386_io.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/i386_io.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/i386_io.h