#include "types.h"
#include "ctype.h"
#include "asm/processor.h"
+#include "errors.h"
#define READ_BLOCKS_USE_READ 1
if (prom_args.args[2+nargs] != 0)
{
- prom_printf ("method '%s' failed %d\n", method, prom_args.args[2+nargs]);
+ prom_printf ("method '%s' failed %p\n", method, prom_args.args[2+nargs]);
return 0;
}
return prom_args.args[2+nargs+1];
void
prom_vfprintf (prom_handle file, char *fmt, va_list ap)
{
- static char printf_buf[1024];
+ static char printf_buf[1536];
vsprintf (printf_buf, fmt, ap);
prom_puts (file, printf_buf);
}
void
prom_vprintf (char *fmt, va_list ap)
{
- static char printf_buf[1024];
+ static char printf_buf[1536];
vsprintf (printf_buf, fmt, ap);
prom_puts (prom_stdout, printf_buf);
}
va_end (ap);
}
+void
+prom_perror (int error, char *filename)
+{
+ if (error == FILE_ERR_EOF)
+ prom_printf("%s: Unexpected End Of File\n", filename);
+ else if (error == FILE_ERR_NOTFOUND)
+ prom_printf("%s: No such file or directory\n", filename);
+ else if (error == FILE_CANT_SEEK)
+ prom_printf("%s: Seek error\n", filename);
+ else if (error == FILE_IOERR)
+ prom_printf("%s: Input/output error\n", filename);
+ else if (error == FILE_BAD_PATH)
+ prom_printf("%s: Path too long\n", filename);
+ else if (error == FILE_ERR_BAD_TYPE)
+ prom_printf("%s: Not a regular file\n", filename);
+ else if (error == FILE_ERR_NOTDIR)
+ prom_printf("%s: Not a directory\n", filename);
+ else if (error == FILE_ERR_BAD_FSYS)
+ prom_printf("%s: Unknown or corrupt filesystem\n", filename);
+ else if (error == FILE_ERR_SYMLINK_LOOP)
+ prom_printf("%s: Too many levels of symbolic links\n", filename);
+ else if (error == FILE_ERR_LENGTH)
+ prom_printf("%s: File too large\n", filename);
+ else if (error == FILE_ERR_FSBUSY)
+ prom_printf("%s: Filesystem busy\n", filename);
+ else if (error == FILE_ERR_BADDEV)
+ prom_printf("%s: Unable to open file, Invalid device\n", filename);
+ else
+ prom_printf("%s: Unknown error\n", filename);
+}
+
void
prom_readline (char *prompt, char *buf, int len)
{
prom_exit ();
}
+void
+prom_sleep (int seconds)
+{
+ int end;
+ end = (prom_getms() + (seconds * 1000));
+ while (prom_getms() <= end);
+}
+
void *
prom_claim (void *virt, unsigned int size, unsigned int align)
{