summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/shared/io/printk.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-27 06:17:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-27 06:17:44 +0000
commit2d354ea6a562761a1417bed71dfe8e722ef16409 (patch)
tree85f2250aac8208be0365caae8e27cfc583fa67ca /c/src/lib/libbsp/arm/shared/io/printk.c
parentPort of RTEMS to the ARM processor family by Eric Valette (diff)
downloadrtems-2d354ea6a562761a1417bed71dfe8e722ef16409.tar.bz2
Minor problems addressed with the merger and with the arm_bare_bsp.
That BSP now has a stub clock driver so the tests can link even if they won't execute. A handful of Makefiles had to be updated and we had to account for printk.c being a shared file now.
Diffstat (limited to 'c/src/lib/libbsp/arm/shared/io/printk.c')
-rw-r--r--c/src/lib/libbsp/arm/shared/io/printk.c113
1 files changed, 0 insertions, 113 deletions
diff --git a/c/src/lib/libbsp/arm/shared/io/printk.c b/c/src/lib/libbsp/arm/shared/io/printk.c
deleted file mode 100644
index d53699a3de..0000000000
--- a/c/src/lib/libbsp/arm/shared/io/printk.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-------------------------------------------------------------------------+
-| printk.c - ARM BSP
-+--------------------------------------------------------------------------+
-|
-| COPYRIGHT (c) 2000 Canon Research France SA.
-| Emmanuel Raguet, mailto:raguet@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$
-+--------------------------------------------------------------------------*/
-
-
-#include <stdarg.h>
-#include <stdio.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 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;
-
- _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 */
-