From 12b64d7bff417225850e8ff02ab4fd96123a8985 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Jun 2000 16:44:11 +0000 Subject: Removed references to printk as part of moving it to a more shareable location in libc. --- c/src/lib/libbsp/i386/i386ex/console/Makefile.am | 2 +- c/src/lib/libbsp/i386/pc386/console/Makefile.am | 2 +- c/src/lib/libbsp/i386/shared/io/Makefile.am | 13 +-- c/src/lib/libbsp/i386/shared/io/bspIo.h | 37 ------- c/src/lib/libbsp/i386/shared/io/printk.c | 121 --------------------- c/src/lib/libbsp/i386/ts_386ex/console/Makefile.am | 2 +- 6 files changed, 6 insertions(+), 171 deletions(-) delete mode 100644 c/src/lib/libbsp/i386/shared/io/bspIo.h delete mode 100644 c/src/lib/libbsp/i386/shared/io/printk.c diff --git a/c/src/lib/libbsp/i386/i386ex/console/Makefile.am b/c/src/lib/libbsp/i386/i386ex/console/Makefile.am index 4b0c14dbdc..dff7a1f057 100644 --- a/c/src/lib/libbsp/i386/i386ex/console/Makefile.am +++ b/c/src/lib/libbsp/i386/i386ex/console/Makefile.am @@ -9,7 +9,7 @@ VPATH = @srcdir@:@srcdir@/../../shared/io PGM = $(ARCH)/console.rel ## sources -C_FILES = console.c printk.c +C_FILES = console.c console_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.o) diff --git a/c/src/lib/libbsp/i386/pc386/console/Makefile.am b/c/src/lib/libbsp/i386/pc386/console/Makefile.am index c845b25351..6d8f0695d4 100644 --- a/c/src/lib/libbsp/i386/pc386/console/Makefile.am +++ b/c/src/lib/libbsp/i386/pc386/console/Makefile.am @@ -8,7 +8,7 @@ VPATH = @srcdir@:@srcdir@/../../shared/io PGM = $(ARCH)/console.rel -C_FILES = console.c inch.c outch.c printk.c +C_FILES = console.c inch.c outch.c S_FILES = videoAsm.S console_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.o) $(S_FILES:%.S=$(ARCH)/%.o) diff --git a/c/src/lib/libbsp/i386/shared/io/Makefile.am b/c/src/lib/libbsp/i386/shared/io/Makefile.am index f3d98b6b1a..66be6280a8 100644 --- a/c/src/lib/libbsp/i386/shared/io/Makefile.am +++ b/c/src/lib/libbsp/i386/shared/io/Makefile.am @@ -4,19 +4,12 @@ AUTOMAKE_OPTIONS = foreign 1.4 -H_FILES = bspIo.h +H_FILES = -C_FILES = printk.c - -$(PROJECT_INCLUDE): - $(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/%.h: %.h - $(INSTALL_DATA) $< $@ - -PREINSTALL_FILES += $(PROJECT_INCLUDE) $(H_FILES:%.h=$(PROJECT_INCLUDE)/%.h) +C_FILES = all-local: $(PREINSTALL_FILES) -EXTRA_DIST = bspIo.h printk.c +EXTRA_DIST = include $(top_srcdir)/../../../../../automake/local.am diff --git a/c/src/lib/libbsp/i386/shared/io/bspIo.h b/c/src/lib/libbsp/i386/shared/io/bspIo.h deleted file mode 100644 index 0ff070c4c5..0000000000 --- a/c/src/lib/libbsp/i386/shared/io/bspIo.h +++ /dev/null @@ -1,37 +0,0 @@ -/* bspIo.h - * - * This include file contains declaration of interface that - * will be provided by the file contained in this directory. - * - * - * COPYRIGHT (c) 1998 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$ - */ -#ifndef _LIBBSP_I386_SHARED_IO_BSP_IO_H -#define _LIBBSP_I386_SHARED_IO_BSP_IO_H - -/* - * All the functions declared as extern after this comment - * MUST be implemented in each BSP. Using this function, - * this directory contains shared code that export higher level - * functionnality described after the next command. - */ -typedef void (*BSP_output_char_function_type) (char c); -typedef char (*BSP_polling_getchar_function_type) (void); - -extern BSP_output_char_function_type BSP_output_char; -extern BSP_polling_getchar_function_type BSP_poll_char; -/* - * All the function declared as extern after this comment - * are available for each ix86 BSP by compiling and linking - * the files contained in this directory PROVIDED definition - * and initialisation of the previous variable are done. - */ -void printk(char *fmt, ...); - -#endif diff --git a/c/src/lib/libbsp/i386/shared/io/printk.c b/c/src/lib/libbsp/i386/shared/io/printk.c deleted file mode 100644 index 7555fb6262..0000000000 --- a/c/src/lib/libbsp/i386/shared/io/printk.c +++ /dev/null @@ -1,121 +0,0 @@ -/*-------------------------------------------------------------------------+ -| printk.c v1.1 - PC386 BSP - 1997/08/07 -+--------------------------------------------------------------------------+ -| (C) Copyright 1997 - -| - NavIST Group - Real-Time Distributed Systems and Industrial Automation -| -| http://pandora.ist.utl.pt -| -| Instituto Superior Tecnico * Lisboa * PORTUGAL -+--------------------------------------------------------------------------+ -| Disclaimer: -| -| This file is provided "AS IS" without warranty of any kind, either -| expressed or implied. -+--------------------------------------------------------------------------+ -| This code is based on code by: Jose Rufino - IST -| -| $Id$ -+--------------------------------------------------------------------------*/ - - -#include -#include -#include -#include - -/*-------------------------------------------------------------------------+ -| Function: printNum -| Description: print number in a given base. -| Global Variables: None. -| Arguments: num - number to print, base - base used to print the number. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -static void -printNum(long unsigned int num, int base, int sign) -{ - long unsigned int n; - int count; - char toPrint[20]; - - if ( (sign == 1) && ((long)num < 0) ) { - BSP_output_char('-'); - num = -num; - } - - count = 0; - while ((n = num / base) > 0) { - toPrint[count++] = (num - (n*base)); - num = n ; - } - toPrint[count++] = num; - - for (n = 0; n < count; n++){ - BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]); - } -} /* printNum */ - - -/*-------------------------------------------------------------------------+ -| Function: printk -| Description: a simplified version of printf intended for use when the - console is not yet initialized or in ISR's. -| Global Variables: None. -| Arguments: as in printf: fmt - format string, ... - unnamed arguments. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -void -printk(char *fmt, ...) -{ - va_list ap; /* points to each unnamed argument in turn */ - char c, *str; - int lflag, base, sign; - unsigned int level; - - _CPU_ISR_Disable(level); - - va_start(ap, fmt); /* make ap point to 1st unnamed arg */ - for (; *fmt != '\0'; fmt++) - { - lflag = 0; - base = 0; - sign = 0; - if (*fmt == '%') - { - if ((c = *++fmt) == 'l') - { - lflag = 1; - c = *++fmt; - } - switch (c) - { - case 'o': case 'O': base = 8; sign = 0; break; - case 'd': case 'D': base = 10; sign = 1; break; - case 'u': case 'U': base = 10; sign = 0; break; - case 'x': case 'X': base = 16; sign = 0; break; - case 's': - for (str = va_arg(ap, char *); *str; str++) - BSP_output_char(*str); - break; - case 'c': - BSP_output_char(va_arg(ap, char)); - break; - default: - BSP_output_char(c); - break; - } /* switch*/ - - if (base) - printNum(lflag ? va_arg(ap, long int) : (long int)va_arg(ap, int), - base, sign); - } - else - { - BSP_output_char(*fmt); - } - } - va_end(ap); /* clean up when done */ - _CPU_ISR_Enable(level); - -} /* printk */ - diff --git a/c/src/lib/libbsp/i386/ts_386ex/console/Makefile.am b/c/src/lib/libbsp/i386/ts_386ex/console/Makefile.am index 4b0c14dbdc..dff7a1f057 100644 --- a/c/src/lib/libbsp/i386/ts_386ex/console/Makefile.am +++ b/c/src/lib/libbsp/i386/ts_386ex/console/Makefile.am @@ -9,7 +9,7 @@ VPATH = @srcdir@:@srcdir@/../../shared/io PGM = $(ARCH)/console.rel ## sources -C_FILES = console.c printk.c +C_FILES = console.c console_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.o) -- cgit v1.2.3