summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-09 12:56:18 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-10 10:17:17 -0500
commit4977f07e6872d7253535a7ec67b153254e1c4088 (patch)
treec70d92497b2b9d60fb0b5e4f89428477f0d9d644 /c/src/lib/libbsp/i386/pc386/console
parentgumstix/include/bsp.h: Do not include libchip/serial to avoid conflicts when ... (diff)
downloadrtems-4977f07e6872d7253535a7ec67b153254e1c4088.tar.bz2
i386/pc386: Eliminate multiple warnings
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console')
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/conscfg.c7
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/keyboard.c99
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/outch.c6
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/rtd316.c3
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/rtd316.h24
5 files changed, 85 insertions, 54 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/conscfg.c b/c/src/lib/libbsp/i386/pc386/console/conscfg.c
index f9ed5d8c2f..f0295ef29e 100644
--- a/c/src/lib/libbsp/i386/pc386/console/conscfg.c
+++ b/c/src/lib/libbsp/i386/pc386/console/conscfg.c
@@ -5,7 +5,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2011.
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -21,6 +21,7 @@
#include "vgacons.h"
#include <bsp/irq.h>
#include <rtems/pci.h>
+#include <bsp/rtd316.h>
#define VGA_CONSOLE_FUNCTIONS &vgacons_fns
#if 0
@@ -39,7 +40,7 @@
#define CLOCK_RATE (115200 * 16)
-uint8_t com_get_register(uint32_t addr, uint8_t i)
+static uint8_t com_get_register(uint32_t addr, uint8_t i)
{
register uint8_t val;
@@ -47,7 +48,7 @@ uint8_t com_get_register(uint32_t addr, uint8_t i)
return val;
}
-void com_set_register(uint32_t addr, uint8_t i, uint8_t val)
+static void com_set_register(uint32_t addr, uint8_t i, uint8_t val)
{
outport_byte( (addr + i),val );
}
diff --git a/c/src/lib/libbsp/i386/pc386/console/keyboard.c b/c/src/lib/libbsp/i386/pc386/console/keyboard.c
index 271c5e3759..3a33c54acc 100644
--- a/c/src/lib/libbsp/i386/pc386/console/keyboard.c
+++ b/c/src/lib/libbsp/i386/pc386/console/keyboard.c
@@ -28,7 +28,7 @@
#define KBD_DEFLOCK 0
#endif
-int set_bit(int nr, unsigned long * addr)
+static int set_bit(int nr, unsigned long * addr)
{
int mask;
int retval;
@@ -43,7 +43,7 @@ int set_bit(int nr, unsigned long * addr)
return retval;
}
-int clear_bit(int nr, unsigned long * addr)
+static int clear_bit(int nr, unsigned long * addr)
{
int mask;
int retval;
@@ -58,7 +58,7 @@ int clear_bit(int nr, unsigned long * addr)
return retval;
}
-int test_bit(int nr, unsigned long * addr)
+static int test_bit(int nr, unsigned long * addr)
{
int mask;
@@ -167,19 +167,20 @@ static int sysrq_pressed;
* string, and in both cases we might assume that it is
* in utf-8 already.
*/
-void to_utf8(ushort c) {
- if (c < 0x80)
- put_queue(c); /* 0******* */
- else if (c < 0x800) {
- put_queue(0xc0 | (c >> 6)); /* 110***** 10****** */
- put_queue(0x80 | (c & 0x3f));
- } else {
- put_queue(0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */
- put_queue(0x80 | ((c >> 6) & 0x3f));
- put_queue(0x80 | (c & 0x3f));
- }
- /* UTF-8 is defined for words of up to 31 bits,
- but we need only 16 bits here */
+static void to_utf8(ushort c)
+{
+ if (c < 0x80)
+ put_queue(c); /* 0******* */
+ else if (c < 0x800) {
+ put_queue(0xc0 | (c >> 6)); /* 110***** 10****** */
+ put_queue(0x80 | (c & 0x3f));
+ } else {
+ put_queue(0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */
+ put_queue(0x80 | ((c >> 6) & 0x3f));
+ put_queue(0x80 | (c & 0x3f));
+ }
+ /* UTF-8 is defined for words of up to 31 bits,
+ but we need only 16 bits here */
}
/*
@@ -333,20 +334,19 @@ void handle_scancode(unsigned char scancode, int down)
static void ( *driver_input_handler_kbd )( void *, unsigned short, unsigned long ) = 0;
/*
*/
-void kbd_set_driver_handler( void ( *handler )( void *, unsigned short, unsigned long ) )
+void kbd_set_driver_handler(
+ void ( *handler )( void *, unsigned short, unsigned long )
+)
{
driver_input_handler_kbd = handler;
}
static void put_queue(int ch)
{
- if( driver_input_handler_kbd )
- {
- driver_input_handler_kbd( ( void *)kbd, (unsigned short)ch, 0 );
- }
- else
- {
- add_to_queue( ch );
+ if ( driver_input_handler_kbd ) {
+ driver_input_handler_kbd( ( void *)kbd, (unsigned short)ch, 0 );
+ } else {
+ add_to_queue( ch );
}
}
@@ -377,7 +377,6 @@ static void enter(void)
if (vc_kbd_mode(kbd,VC_CRLF))
put_queue(10);
-
}
static void caps_toggle(void)
@@ -403,12 +402,10 @@ static void hold(void)
if (rep )
return;
chg_vc_kbd_led(kbd, VC_SCROLLOCK );
-
}
static void num(void)
{
-
if (vc_kbd_mode(kbd,VC_APPLIC))
applkey('P', 1);
else
@@ -771,39 +768,45 @@ static unsigned char ledstate = 0xff; /* undefined */
static unsigned char ledioctl;
unsigned char getledstate(void) {
- return ledstate;
+ return ledstate;
}
void setledstate(struct kbd_struct *kbd, unsigned int led) {
- if (!(led & ~7)) {
- ledioctl = led;
- kbd->ledmode = LED_SHOW_IOCTL;
- } else
+ if (!(led & ~7)) {
+ ledioctl = led;
+ kbd->ledmode = LED_SHOW_IOCTL;
+ } else
;
- kbd->ledmode = LED_SHOW_FLAGS;
- set_leds();
+ kbd->ledmode = LED_SHOW_FLAGS;
+ set_leds();
}
static struct ledptr {
- unsigned int *addr;
- unsigned int mask;
- unsigned char valid:1;
+ unsigned int *addr;
+ unsigned int mask;
+ unsigned char valid:1;
} ledptrs[3];
-void register_leds(int console, unsigned int led,
- unsigned int *addr, unsigned int mask) {
- struct kbd_struct *kbd = kbd_table + console;
+void register_leds(
+ int console,
+ unsigned int led,
+ unsigned int *addr,
+ unsigned int mask
+)
+{
+ struct kbd_struct *kbd = kbd_table + console;
- if (led < 3) {
- ledptrs[led].addr = addr;
- ledptrs[led].mask = mask;
- ledptrs[led].valid = 1;
- kbd->ledmode = LED_SHOW_MEM;
- } else
- kbd->ledmode = LED_SHOW_FLAGS;
+ if (led < 3) {
+ ledptrs[led].addr = addr;
+ ledptrs[led].mask = mask;
+ ledptrs[led].valid = 1;
+ kbd->ledmode = LED_SHOW_MEM;
+ } else
+ kbd->ledmode = LED_SHOW_FLAGS;
}
-static inline unsigned char getleds(void){
+static inline unsigned char getleds(void)
+{
struct kbd_struct *kbd = kbd_table + fg_console;
diff --git a/c/src/lib/libbsp/i386/pc386/console/outch.c b/c/src/lib/libbsp/i386/pc386/console/outch.c
index f0c7599939..90ffedf250 100644
--- a/c/src/lib/libbsp/i386/pc386/console/outch.c
+++ b/c/src/lib/libbsp/i386/pc386/console/outch.c
@@ -239,7 +239,7 @@ int ro,co;
return rval;
}
-void
+static void
clear_screen(void)
{
int i,j;
@@ -308,6 +308,10 @@ _IBMPC_initVideo(void)
} /* _IBMPC_initVideo */
/* for old DOS compatibility n-curses type of applications */
+void gotoxy( int x, int y );
+int whereX( void );
+int whereY( void );
+
void gotoxy( int x, int y )
{
gotorc(y,x);
diff --git a/c/src/lib/libbsp/i386/pc386/console/rtd316.c b/c/src/lib/libbsp/i386/pc386/console/rtd316.c
index e27f128d4f..7219ff68b6 100644
--- a/c/src/lib/libbsp/i386/pc386/console/rtd316.c
+++ b/c/src/lib/libbsp/i386/pc386/console/rtd316.c
@@ -7,7 +7,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2012.
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -26,6 +26,7 @@
#include <rtems/bspIo.h>
#include <bsp/rtd316.h>
#include <rtems/score/i386.h>
+#include <rtems/console_private.h>
#define RTD_CLOCK_RATE (460800 * 32)
diff --git a/c/src/lib/libbsp/i386/pc386/console/rtd316.h b/c/src/lib/libbsp/i386/pc386/console/rtd316.h
index 6c3478cc65..aabad2c263 100644
--- a/c/src/lib/libbsp/i386/pc386/console/rtd316.h
+++ b/c/src/lib/libbsp/i386/pc386/console/rtd316.h
@@ -7,7 +7,7 @@
*/
/*
- * COPYRIGHT (c) 1989-2012.
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -47,6 +47,28 @@ rtems_device_driver rtd316_initialize(
void *arg
);
+/**
+ * @brief RTD316 Obtain Register Helper
+ *
+ * This method is used to read registers on the RTD316.
+ *
+ * @param[in] addr is the base address
+ * @param[in] reg is the register number
+ *
+ * @return This method returns the value of the register.
+ */
+uint8_t rtd316_com_get_register(uint32_t addr, uint8_t reg);
+
+/**
+ * @brief RTD316 Set Register Helper
+ *
+ * This method is used to set registers on the RTD316.
+ *
+ * @param[in] addr is the base address
+ * @param[in] reg is the register number
+ */
+void rtd316_com_set_register(uint32_t addr,uint8_t reg, uint8_t val);
+
#ifdef __cplusplus
}
#endif