From 93180ea26a1c8a991602b7243e1e68e7f510e381 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 9 Jul 1999 17:16:10 +0000 Subject: Patch from Eric Valette : - The same bug fix that was done on pc386 to prevent interrupt from occuring (never experienced it but who knows as I have 8259 emulation :() - Removed every compiler warning (except wrong ones and ones I can't do anything). - Removed any libc available code in code linked with mcp750 rtems executbale. Unfortunately using newlib functions for linking the bootloader does not work as the compilation options in bootloader (-mrelocatable -fixed-r13) are not compatible with newlib options. => I have put any libc external reference in one single new file (lib.c) that is linked only with the boot loader. Removing the file from ${OBJ} and using -lc crash the bootloader. Added big warning... --- .../powerpc/motorola_powerpc/console/console.c | 11 ++---- .../powerpc/motorola_powerpc/console/consoleLib.S | 29 ---------------- .../libbsp/powerpc/motorola_powerpc/console/inch.c | 4 --- .../powerpc/motorola_powerpc/console/polled_io.c | 40 +++++----------------- 4 files changed, 11 insertions(+), 73 deletions(-) delete mode 100644 c/src/lib/libbsp/powerpc/motorola_powerpc/console/consoleLib.S (limited to 'c/src/lib/libbsp/powerpc/motorola_powerpc/console') diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/console.c b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/console.c index d262c0d7a2..834f960cfc 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/console.c +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/console.c @@ -21,8 +21,11 @@ #include #include +#include + #undef __assert void __assert (const char *file, int line, const char *msg); +extern int close(int fd); #include #include @@ -192,8 +195,6 @@ console_initialize(rtems_device_major_number major, } /* console_initialize */ -static int console_open_count = 0; - static int console_last_close(int major, int minor, void *arg) { BSP_remove_rtems_irq_handler (&console_isr_data); @@ -272,9 +273,6 @@ console_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; - char *buffer = rw_args->buffer; - int count, maximum = rw_args->count; return rtems_termios_read (arg); } /* console_read */ @@ -290,9 +288,6 @@ console_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; - char *buffer = rw_args->buffer; - int count, maximum = rw_args->count; return rtems_termios_write (arg); diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/consoleLib.S b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/consoleLib.S deleted file mode 100644 index b18f018aea..0000000000 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/consoleLib.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * consoleLib.S -- console I/O package utility functions. - * - * Copyright (C) 1999 Eric Valette. valette@crf.canon.fr - * - * The license and distribution terms for this file may be - * found in found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* A few utility functions, some copied from arch/ppc/lib/string.S */ - -#include -#include -#include "asm.h" - - .text - - .globl strlen - .type strlen,@function -strlen: - addi r4,r3,-1 -1: lbzu r0,1(r4) - cmpwi 0,r0,0 - bne 1b - subf r3,r3,r4 - blr diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/inch.c b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/inch.c index 823e7180df..5cd7148e97 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/inch.c +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/inch.c @@ -232,10 +232,6 @@ void _IBMPC_keyboard_isr() rtems_boolean _IBMPC_chrdy(char *c) { - /* FIX ME!!! It doesn't work without something like the following line. - Find out why! */ - printk(""); - /* Check buffer our ISR builds */ if (kbd_first != kbd_last) { diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/polled_io.c b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/polled_io.c index 41f0bd33a9..8c291cad12 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/console/polled_io.c +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/console/polled_io.c @@ -406,31 +406,6 @@ extern console_io* curIo; unsigned long ticks_per_ms = 1000000; /* Decrementer ticks per ms (true for 601) */ -void * memset(void *p, int c, size_t n) { - char *q =p; - for(; n>0; --n) *q++=c; - return p; -} - -void * memcpy(void *dst, const void * src, size_t n) { - u_char *d=dst; - const u_char *s=src; - while(n-- > 0) *d++=*s++; - return dst; -} - -char * strcat(char * dest, const char * src) -{ - char *tmp = dest; - - while (*dest) - dest++; - while ((*dest++ = *src++) != '\0') - ; - - return tmp; -} - /* The decrementer is present on all processors and the RTC on the 601 * has the annoying characteristic of jumping from 1e9 to 0, so we * use the decrementer. @@ -506,7 +481,7 @@ static int global_index = 0; static void *__palloc(int s) { if (global_index ==( STATIC_LOG_DATA_PAGE_NB - 1) ) return (void*) 0; - return (void*) log_page_pool [PAGE_SIZE * global_index++]; + return (void*) &(log_page_pool [PAGE_SIZE * global_index++]); } static void pfree(void* p) @@ -848,17 +823,17 @@ vga_console_functions = { kbd_tstc }; -console_io* curIo = &vacuum_console_functions; +console_io* curIo = (console_io*) &vacuum_console_functions; int select_console(ioType t) { static ioType curType = CONSOLE_VACUUM; switch (t) { - case CONSOLE_VACUUM : curIo = &vacuum_console_functions; break; - case CONSOLE_LOG : curIo = &log_console_functions; break; - case CONSOLE_SERIAL : curIo = &serial_console_functions; break; - case CONSOLE_VGA : curIo = &vga_console_functions; break; - default : curIo = &vacuum_console_functions;break; + case CONSOLE_VACUUM : curIo = (console_io*)&vacuum_console_functions; break; + case CONSOLE_LOG : curIo = (console_io*)&log_console_functions; break; + case CONSOLE_SERIAL : curIo = (console_io*)&serial_console_functions; break; + case CONSOLE_VGA : curIo = (console_io*)&vga_console_functions; break; + default : curIo = (console_io*)&vacuum_console_functions;break; } if (curType == CONSOLE_LOG) flush_log(); curType = t; @@ -882,6 +857,7 @@ static int skip_atoi(const char **s) * bloat has been limited since we basically only need %u, %x, %s and %c. * But we need 64 bit values ! */ +int vsprintf(char *buf, const char *fmt, va_list args); int printk(const char *fmt, ...) { va_list args; -- cgit v1.2.3