diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-08-05 16:51:39 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-08-05 16:51:39 +0000 |
commit | bd8c8b2a855f3219e3c4c73c9e67eb4bd6d473d7 (patch) | |
tree | d9f1b7bf8ee4865c1e485e2b161c5709e2b6b75d /c/src/lib/libbsp/i386/shared | |
parent | changed load address (diff) | |
download | rtems-bd8c8b2a855f3219e3c4c73c9e67eb4bd6d473d7.tar.bz2 |
Patch from Eric Valette <valette@crf.canon.fr> which brings the i386ex BSP
inline with the new IRQ structure.
Diffstat (limited to 'c/src/lib/libbsp/i386/shared')
-rw-r--r-- | c/src/lib/libbsp/i386/shared/Makefile.in | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/io/Makefile.in | 33 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/io/bspIo.h | 38 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/io/printk.c | 99 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.h | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq_init.c | 9 |
6 files changed, 179 insertions, 7 deletions
diff --git a/c/src/lib/libbsp/i386/shared/Makefile.in b/c/src/lib/libbsp/i386/shared/Makefile.in index feab84d468..6fc07991ea 100644 --- a/c/src/lib/libbsp/i386/shared/Makefile.in +++ b/c/src/lib/libbsp/i386/shared/Makefile.in @@ -12,5 +12,5 @@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg # Descend into the $(RTEMS_BSP_FAMILY) directory -SUB_DIRS=irq +SUB_DIRS=irq io diff --git a/c/src/lib/libbsp/i386/shared/io/Makefile.in b/c/src/lib/libbsp/i386/shared/io/Makefile.in new file mode 100644 index 0000000000..01fb16150b --- /dev/null +++ b/c/src/lib/libbsp/i386/shared/io/Makefile.in @@ -0,0 +1,33 @@ +# +# $Id$ +# + +@SET_MAKE@ +srcdir = @srcdir@ +VPATH = @srcdir@ +RTEMS_ROOT = @top_srcdir@ +PROJECT_ROOT = @PROJECT_ROOT@ + +H_FILES = $(srcdir)/bspIo.h + +# +# Equate files are for including from assembly preprocessed by +# gm4 or gasp. No examples are provided except for those for +# other CPUs. The best way to generate them would be to +# provide a program which generates the constants used based +# on the C equivalents. +# + +EQ_FILES = + +SRCS=$(H_FILES) $(EQ_FILES) + +include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg +include $(RTEMS_ROOT)/make/leaf.cfg + +CLEAN_ADDITIONS += +CLOBBER_ADDITIONS += + +preinstall all: $(SRCS) + $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE) + $(INSTALL) -m 444 $(EQ_FILES) $(PROJECT_INCLUDE) diff --git a/c/src/lib/libbsp/i386/shared/io/bspIo.h b/c/src/lib/libbsp/i386/shared/io/bspIo.h new file mode 100644 index 0000000000..337d46a699 --- /dev/null +++ b/c/src/lib/libbsp/i386/shared/io/bspIo.h @@ -0,0 +1,38 @@ +/* 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) (char c); + +extern BSP_output_char_function_type BSP_output_char; +extern BSP_polling_getchar_function_type BSP_poll_char; +extern void BSP_emergency_output_init(); +/* + * 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 new file mode 100644 index 0000000000..c34b20e730 --- /dev/null +++ b/c/src/lib/libbsp/i386/shared/io/printk.c @@ -0,0 +1,99 @@ +/*-------------------------------------------------------------------------+ +| 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 <stdarg.h> + +#include <bspIo.h> + +/*-------------------------------------------------------------------------+ +| 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 int num, int base) +{ + long int n; + + if ((n = num / base) > 0) + printNum(n, base); + BSP_output_char("0123456789ABCDEF"[(int)(num % base)]); +} /* 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; + + va_start(ap, fmt); /* make ap point to 1st unnamed arg */ + for (; *fmt != '\0'; fmt++) + { + lflag = 0; + base = 0; + if (*fmt == '%') + { + if ((c = *++fmt) == 'l') + { + lflag = 1; + c = *++fmt; + } + switch (c) + { + case 'o': case 'O': base = 8; break; + case 'd': case 'D': base = 10; break; + case 'x': case 'X': base = 16; 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); + } + else + { + BSP_output_char(*fmt); + } + } + va_end(ap); /* clean up when done */ +} /* printk */ + diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h index 3fba2db09e..5d628af83b 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq.h +++ b/c/src/lib/libbsp/i386/shared/irq/irq.h @@ -55,8 +55,9 @@ typedef enum { PC386_UART_COM1_IRQ = 4, - PC_386_RT_TIMER1 = 8 - + PC_386_RT_TIMER1 = 8, + + PC_386_RT_TIMER3 = 10 }rtems_irq_symbolic_name; diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c index 3f57cf1107..3521bdd510 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c +++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c @@ -15,6 +15,7 @@ #include <libcpu/cpu.h> #include <irq.h> #include <bsp.h> +#include <bspIo.h> /* * rtems prologue generated in irq_asm.S @@ -137,7 +138,7 @@ void rtems_irq_mngt_init() /* * put something here that will show the failure... */ - _IBMPC_initVideo(); + BSP_emergency_output_init(); printk("Unable to initialize IDT!!! System locked\n"); while (1); } @@ -172,7 +173,7 @@ void rtems_irq_mngt_init() /* * put something here that will show the failure... */ - _IBMPC_initVideo(); + BSP_emergency_output_init(); printk("Unable to initialize RTEMS interrupt Management!!! System locked\n"); while (1); } @@ -187,7 +188,7 @@ void rtems_irq_mngt_init() */ unsigned tmp; - _IBMPC_initVideo(); + BSP_emergency_output_init(); printk("idt_entry_tbl = %x Interrupt_descriptor_table addr = %x\n", idt_entry_tbl, &Interrupt_descriptor_table); @@ -196,7 +197,7 @@ void rtems_irq_mngt_init() tmp, (unsigned) rtems_irq_prologue_0); } printk("i8259s_cache = %x\n", * (unsigned short*) &i8259s_cache); - debugPollingGetChar(); + BSP_wait_polled_input(); #endif asm volatile ("sti"); } |