summaryrefslogtreecommitdiff
path: root/system/alpha/console/printf.c
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-11-14 12:32:52 -0500
committerNathan Binkert <binkertn@umich.edu>2003-11-14 12:32:52 -0500
commit492fa2ae5ee7ef9c3f3601ac611ebc9a43ff83eb (patch)
tree4ab3911ab8d1e6fac6b1261c6bb7cc7c5caf1048 /system/alpha/console/printf.c
parentb8612cbda3625e27f109469a1f5416237c97fb41 (diff)
downloadgem5-492fa2ae5ee7ef9c3f3601ac611ebc9a43ff83eb.tar.xz
Get the console code to compile correctly
Add support for some thigns that M5 needs Make this better support Tru64 v5.1 console/Makefile: I couldn't figure out the old build system since I was missing a bunch of tools at the time, so I kinda rewrote it. console/console.c: Get the includes right, and make things compile little bit of cleanup along the way console/paljtokern.s: formatting junk console/printf.c: Formatting get const right h/lib.h: fiddle with the includes that we need console/console.c: Get the BOOTDEVICE_NAME right Add a bit of support for grabbing console environment variables
Diffstat (limited to 'system/alpha/console/printf.c')
-rw-r--r--system/alpha/console/printf.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/system/alpha/console/printf.c b/system/alpha/console/printf.c
index e0dc0426b..24efa802e 100644
--- a/system/alpha/console/printf.c
+++ b/system/alpha/console/printf.c
@@ -79,19 +79,22 @@ static char *rcsid = "$Id: printf.c,v 1.1.1.1 1997/10/30 23:27:12 verghese Exp $
/* The string s is terminated by a '\0' */
-void PutString(char *s)
+void
+PutString(const char *s)
{
while (*s) PutChar(*s++);
}
/* print c count times */
-void PutRepChar(char c, int count)
+void
+PutRepChar(char c, int count)
{
while (count--) PutChar(c);
}
/* put string reverse */
-void PutStringReverse(char *s, int index)
+void
+PutStringReverse(const char *s, int index)
{
while ((index--) > 0) PutChar(s[index]);
}
@@ -103,7 +106,8 @@ void PutStringReverse(char *s, int index)
if width is 0, use whatever is needed
if fill is 0, use ' '
*/
-void PutNumber(sl value, int radix, int width, char fill)
+void
+PutNumber(sl value, int radix, int width, char fill)
{
char buffer[40];
ui bufferindex = 0;
@@ -195,7 +199,8 @@ void putFloat(double a, int fieldwidth, char fill)
PutChar((char)(b % 10) + '0');
}
}
-char *FormatItem(char *f, va_list *ap)
+const char *
+FormatItem(const char *f, va_list *ap)
{
char c;
int fieldwidth = 0;
@@ -222,12 +227,12 @@ char *FormatItem(char *f, va_list *ap)
return(f);
}
case 's': {
- char *a = va_arg(*ap, char *);
+ const char *a = va_arg(*ap, const char *);
- if (leftjust) PutString((char *) a);
- if (fieldwidth > strlen((char *) a))
- PutRepChar(fill, fieldwidth - strlen((char *)a));
- if (!leftjust) PutString((char *) a);
+ if (leftjust) PutString((const char *) a);
+ if (fieldwidth > strlen((const char *) a))
+ PutRepChar(fill, fieldwidth - strlen((const char *)a));
+ if (!leftjust) PutString((const char *) a);
return(f);
}
case 'd': radix = -10;
@@ -260,7 +265,8 @@ char *FormatItem(char *f, va_list *ap)
return(f);
}
-void printf(char *f, ...)
+int
+printf(const char *f, ...)
{
va_list ap;
@@ -277,9 +283,11 @@ void printf(char *f, ...)
}
va_end(ap); /* clean up */
+ return 0;
}
-void panic(char *f, ...)
+void
+panic(const char *f, ...)
{
va_list ap;