summaryrefslogtreecommitdiff
path: root/deva/output.h
diff options
context:
space:
mode:
authormarcus <marcus>2004-10-28 04:12:17 +0000
committermarcus <marcus>2004-10-28 04:12:17 +0000
commit363029cb103fc990e4696333f41e34bb9b7e9fd0 (patch)
tree0da4268e175269b1c08b04a0a0df15be3b15831b /deva/output.h
parent9eea2a623a79c362ed88954c68fce82361758150 (diff)
2004-10-28 Marcus Brinkmann <marcus@gnu.org>
* deva: New directory. * configure.ac (AC_CONFIG_FILES): Add deva/Makefile. * Makefile.am (SUBDIRS): Add deva. deva/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * Initial check-in. physmem/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * physmem.c (get_task_cap): Removed. (bootstrap_final): New function. (main): Call bootstrap_final, not get_task_cap. task/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * task.c (bootstrap_final): New function. (main): Call bootstrap_final. wortel/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * wortel.h: Include <stdbool.h>. (WORTEL_MSG_GET_TASK_CAP): Renamed into WORTEL_MSG_BOOTSTRAP_FINAL. (WORTEL_MSG_GET_DEVA_CAP_REQUEST, WORTEL_MSG_GET_DEVA_CAP_REPLY): Define new macros. (wortel_get_deva_cap_request, wortel_get_deva_cap_reply, wortel_bootstrap_final): New functions. (wortel_get_task_cap): Removed. * wortel.c (start_elf, start_deva): New functions. (start_task): Bunch of it is now in start_elf. (serve_bootstrap_requests): Handle WORTEL_MSG_BOOTSTRAP_FINAL, not WORTEL_MSG_GET_TASK_CAP. Implement support for starting deva. Implement WORTEL_MSG_GET_DEVA_CAP_REQUEST and WORTEL_MSG_GET_DEVA_CAP_REPLY. * wortel-intern.h (struct wortel_module): New member deva.
Diffstat (limited to 'deva/output.h')
-rw-r--r--deva/output.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/deva/output.h b/deva/output.h
new file mode 100644
index 0000000..be117e3
--- /dev/null
+++ b/deva/output.h
@@ -0,0 +1,60 @@
+/* output.h - Output routines interfaces.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Marcus Brinkmann.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
+
+#ifndef _OUTPUT_H
+#define _OUTPUT_H 1
+
+
+/* Print the single character CHR on the output device. */
+int putchar (int chr);
+
+int puts (const char *str);
+
+int printf (const char *fmt, ...);
+
+/* This is not an output function, but it is part of the panic()
+ macro. */
+void __attribute__((__noreturn__)) shutdown (void);
+
+
+/* True if debug mode is enabled. */
+extern int output_debug;
+
+/* Print a debug message. */
+#define debug(...) \
+ ({ \
+ if (output_debug) \
+ printf (__VA_ARGS__); \
+ })
+
+
+/* The program name. */
+extern char program_name[];
+
+/* Print an error message and fail. */
+#define panic(...) \
+ ({ \
+ printf ("%s: %s: error: ", program_name, __func__); \
+ printf (__VA_ARGS__); \
+ putchar ('\n'); \
+ shutdown (); \
+ })
+
+#endif /* _OUTPUT_H */