mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
2003-04-10 Till Straumann <strauman@slac.stanford.edu>
PR 379/bsps * console/polled_io.c: libcpu provides 'printk' already. Therefore, the implementation in this file was removed (still used for the bootloader, though). It now provides BSP_output_char() for libcpu's printk(). * console/uart.c, console/uart.h: BSP_output_char_via_serial() prototype changed to match the BSP_output_char_function_type. Note that the motorola BSPs use polled-io for the output_char routine, not the uart.c version. The latter can be used be other BSPs however (e.g. SVGM). * console/console.c, console/consoleIo.h, console/polled_io.c, irq/irq_init.c, openpic/openpic.c, pci/detect_raven_bridge.c: Unfortunately, the supported 'printk' format string subset of the polled-io and libcpu implementations are different - hence, a few format strings in the ppc/shared BSP were changed.
This commit is contained in:
@@ -1,3 +1,21 @@
|
|||||||
|
2003-04-10 Till Straumann <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
PR 379/bsps
|
||||||
|
* console/polled_io.c: libcpu provides 'printk' already.
|
||||||
|
Therefore, the implementation in this file was removed (still
|
||||||
|
used for the bootloader, though). It now provides BSP_output_char()
|
||||||
|
for libcpu's printk().
|
||||||
|
* console/uart.c, console/uart.h: BSP_output_char_via_serial()
|
||||||
|
prototype changed to match the BSP_output_char_function_type. Note
|
||||||
|
that the motorola BSPs use polled-io for the output_char routine, not
|
||||||
|
the uart.c version. The latter can be used be other BSPs however
|
||||||
|
(e.g. SVGM).
|
||||||
|
* console/console.c, console/consoleIo.h, console/polled_io.c,
|
||||||
|
irq/irq_init.c, openpic/openpic.c, pci/detect_raven_bridge.c:
|
||||||
|
Unfortunately, the supported 'printk' format string subset of the
|
||||||
|
polled-io and libcpu implementations are different - hence, a few
|
||||||
|
format strings in the ppc/shared BSP were changed.
|
||||||
|
|
||||||
2003-04-10 Joel Sherrill <joel@OARcorp.com>
|
2003-04-10 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
PR 383/bsps
|
PR 383/bsps
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ extern int close(int fd);
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <bsp/uart.h>
|
#include <bsp/uart.h>
|
||||||
#include <bsp/consoleIo.h>
|
|
||||||
#include <rtems/bspIo.h> /* printk */
|
#include <rtems/bspIo.h> /* printk */
|
||||||
|
|
||||||
/* Definitions for BSPConsolePort */
|
/* Definitions for BSPConsolePort */
|
||||||
@@ -120,7 +119,7 @@ console_initialize(rtems_device_major_number major,
|
|||||||
status = rtems_io_register_name ((nm=ttyS[minor].name), major, minor);
|
status = rtems_io_register_name ((nm=ttyS[minor].name), major, minor);
|
||||||
if ( RTEMS_SUCCESSFUL==status && BSPConsolePort == minor)
|
if ( RTEMS_SUCCESSFUL==status && BSPConsolePort == minor)
|
||||||
{
|
{
|
||||||
printk("Registering /dev/console as minor %i (==%s)\n",
|
printk("Registering /dev/console as minor %d (==%s)\n",
|
||||||
minor,
|
minor,
|
||||||
ttyS[minor].name);
|
ttyS[minor].name);
|
||||||
/* also register an alias */
|
/* also register an alias */
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ extern board_memory_map *ptr_mem_map;
|
|||||||
extern int select_console(ioType t);
|
extern int select_console(ioType t);
|
||||||
/* extern int printk(const char *, ...) __attribute__((format(printf, 1, 2))); */
|
/* extern int printk(const char *, ...) __attribute__((format(printf, 1, 2))); */
|
||||||
extern void debug_putc(const unsigned char c);
|
extern void debug_putc(const unsigned char c);
|
||||||
|
extern void debug_putc_onlcr(const char c);
|
||||||
extern int debug_getc(void);
|
extern int debug_getc(void);
|
||||||
extern int debug_tstc(void);
|
extern int debug_tstc(void);
|
||||||
int kbdreset(void);
|
int kbdreset(void);
|
||||||
|
|||||||
@@ -43,13 +43,18 @@
|
|||||||
extern void boot_udelay();
|
extern void boot_udelay();
|
||||||
void * __palloc(u_long);
|
void * __palloc(u_long);
|
||||||
void pfree(void *);
|
void pfree(void *);
|
||||||
|
#else
|
||||||
|
#include <rtems/bspIo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef unsigned long long u64;
|
typedef unsigned long long u64;
|
||||||
typedef long long s64;
|
typedef long long s64;
|
||||||
typedef unsigned int u32;
|
typedef unsigned int u32;
|
||||||
|
|
||||||
|
#ifndef __BOOT__
|
||||||
|
BSP_output_char_function_type BSP_output_char = debug_putc_onlcr;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_KBD_SUPPORT
|
#ifdef USE_KBD_SUPPORT
|
||||||
unsigned short plain_map[NR_KEYS] = {
|
unsigned short plain_map[NR_KEYS] = {
|
||||||
0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036,
|
0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036,
|
||||||
@@ -430,6 +435,15 @@ void debug_putc(const u_char c)
|
|||||||
curIo->putc(c);
|
curIo->putc(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* const char arg to be compatible with BSP_output_char decl. */
|
||||||
|
void
|
||||||
|
debug_putc_onlcr(const char c)
|
||||||
|
{
|
||||||
|
if ('\n'==c)
|
||||||
|
debug_putc('\r');
|
||||||
|
debug_putc(c);
|
||||||
|
}
|
||||||
|
|
||||||
int debug_getc(void)
|
int debug_getc(void)
|
||||||
{
|
{
|
||||||
return curIo->getc();
|
return curIo->getc();
|
||||||
@@ -440,8 +454,6 @@ int debug_tstc(void)
|
|||||||
return curIo->tstc();
|
return curIo->tstc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define vidmem ((__io_ptr)(ptr_mem_map->isa_mem_base+0xb8000))
|
#define vidmem ((__io_ptr)(ptr_mem_map->isa_mem_base+0xb8000))
|
||||||
|
|
||||||
void vacuum_putc(u_char c) {
|
void vacuum_putc(u_char c) {
|
||||||
@@ -528,9 +540,7 @@ void puts(const u_char *s)
|
|||||||
char c;
|
char c;
|
||||||
|
|
||||||
while ( ( c = *s++ ) != '\0' ) {
|
while ( ( c = *s++ ) != '\0' ) {
|
||||||
debug_putc(c);
|
debug_putc_onlcr((const char)c);
|
||||||
if ( c == '\n' )
|
|
||||||
debug_putc('\r');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,6 +885,10 @@ int select_console(ioType t) {
|
|||||||
#define is_digit(c) ((c) >= '0' && (c) <= '9')
|
#define is_digit(c) ((c) >= '0' && (c) <= '9')
|
||||||
|
|
||||||
|
|
||||||
|
/* provide this for the bootloader only; otherwise
|
||||||
|
* use libcpu implementation
|
||||||
|
*/
|
||||||
|
#if defined(__BOOT__)
|
||||||
static int skip_atoi(const char **s)
|
static int skip_atoi(const char **s)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
@@ -903,6 +917,8 @@ int printk(const char *fmt, ...) {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Necessary to avoid including a library, and GCC won't do this inline. */
|
/* Necessary to avoid including a library, and GCC won't do this inline. */
|
||||||
#define div10(num, rmd) \
|
#define div10(num, rmd) \
|
||||||
do { u32 t1, t2, t3; \
|
do { u32 t1, t2, t3; \
|
||||||
@@ -942,6 +958,7 @@ do { u32 t1, t2, t3; \
|
|||||||
#define LONG 64 /* long argument */
|
#define LONG 64 /* long argument */
|
||||||
#define LLONG 128 /* 64 bit argument */
|
#define LLONG 128 /* 64 bit argument */
|
||||||
|
|
||||||
|
#if defined(__BOOT__)
|
||||||
static char * number(char * str, int size, int type, u64 num)
|
static char * number(char * str, int size, int type, u64 num)
|
||||||
{
|
{
|
||||||
char fill,sign,tmp[24];
|
char fill,sign,tmp[24];
|
||||||
@@ -1107,3 +1124,4 @@ int k_vsprintf(char *buf, const char *fmt, va_list args)
|
|||||||
*str = '\0';
|
*str = '\0';
|
||||||
return str-buf;
|
return str-buf;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ BSP_uart_polled_write(int uart, int val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BSP_output_char_via_serial(int val)
|
BSP_output_char_via_serial(const char val)
|
||||||
{
|
{
|
||||||
BSP_uart_polled_write(BSPConsolePort, val);
|
BSP_uart_polled_write(BSPConsolePort, val);
|
||||||
if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
|
if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ int BSP_uart_get_break_cb(int uart, rtems_libio_ioctl_args_t *arg);
|
|||||||
int BSP_uart_set_break_cb(int uart, rtems_libio_ioctl_args_t *arg);
|
int BSP_uart_set_break_cb(int uart, rtems_libio_ioctl_args_t *arg);
|
||||||
|
|
||||||
extern unsigned BSP_poll_char_via_serial(void);
|
extern unsigned BSP_poll_char_via_serial(void);
|
||||||
extern void BSP_output_char_via_serial(int val);
|
extern void BSP_output_char_via_serial(const char val);
|
||||||
extern int BSPConsolePort;
|
extern int BSPConsolePort;
|
||||||
extern int BSPBaseBaud;
|
extern int BSPBaseBaud;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp/consoleIo.h>
|
|
||||||
#include <libcpu/io.h>
|
#include <libcpu/io.h>
|
||||||
#include <libcpu/spr.h>
|
#include <libcpu/spr.h>
|
||||||
#include <bsp/pci.h>
|
#include <bsp/pci.h>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/bspIo.h>
|
#include <rtems/bspIo.h>
|
||||||
#include <bsp/openpic.h>
|
#include <bsp/openpic.h>
|
||||||
#include <bsp/pci.h>
|
#include <bsp/pci.h>
|
||||||
#include <bsp/consoleIo.h>
|
|
||||||
#include <libcpu/io.h>
|
#include <libcpu/io.h>
|
||||||
#include <libcpu/byteorder.h>
|
#include <libcpu/byteorder.h>
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
@@ -69,7 +68,7 @@ static unsigned int NumSources;
|
|||||||
printk("openpic.c:%d: illegal priority %d\n", __LINE__, pri);
|
printk("openpic.c:%d: illegal priority %d\n", __LINE__, pri);
|
||||||
#define check_arg_irq(irq) \
|
#define check_arg_irq(irq) \
|
||||||
if (irq < 0 || irq >= NumSources) \
|
if (irq < 0 || irq >= NumSources) \
|
||||||
printk("openpic.c:%d: illegal irq %d from %p,[%p],[[%p]]\n", \
|
printk("openpic.c:%d: illegal irq %d from 0x%08x,[0x%08x],[[0x%08x]]\n", \
|
||||||
__LINE__, irq, __builtin_return_address(0), \
|
__LINE__, irq, __builtin_return_address(0), \
|
||||||
__builtin_return_address(1), __builtin_return_address(2) \
|
__builtin_return_address(1), __builtin_return_address(2) \
|
||||||
);
|
);
|
||||||
@@ -222,7 +221,7 @@ void openpic_init(int main_pic, unsigned char *polarities, unsigned char *senses
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at %p\n", version,
|
printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at 0x%08x\n", version,
|
||||||
NumProcessors, NumSources, OpenPIC);
|
NumProcessors, NumSources, OpenPIC);
|
||||||
|
|
||||||
printk("OpenPIC Vendor %d (%s), Device %d (%s), Stepping %d\n", vendorid,
|
printk("OpenPIC Vendor %d (%s), Device %d (%s), Stepping %d\n", vendorid,
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void detect_host_bridge()
|
|||||||
printk("Raven MPIC is accessed via memory Space Access at address : %x\n", tmp);
|
printk("Raven MPIC is accessed via memory Space Access at address : %x\n", tmp);
|
||||||
#endif
|
#endif
|
||||||
OpenPIC=(volatile struct OpenPIC *) (tmp + PREP_ISA_MEM_BASE);
|
OpenPIC=(volatile struct OpenPIC *) (tmp + PREP_ISA_MEM_BASE);
|
||||||
printk("OpenPIC found at %p.\n",
|
printk("OpenPIC found at %x.\n",
|
||||||
OpenPIC);
|
OpenPIC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user