source: mainline/kernel/generic/include/console/console.h@ a801688b

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since a801688b was a801688b, checked in by Jakub Jermar <jakub@…>, 13 years ago

Make the SYS_KLOG interface more generic.

  • Define klog methods KLOG_WRITE, KLOG_UPDATE and KLOG_COMMAND.
  • KLOG_COMMAND is to be used to feed commands to the kconsole thread.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Copyright (c) 2005 Jakub Jermar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup genericconsole
30 * @{
31 */
32/** @file
33 */
34
35#ifndef KERN_CONSOLE_H_
36#define KERN_CONSOLE_H_
37
38#include <typedefs.h>
39#include <print.h>
40#include <console/chardev.h>
41
42#define PAGING(counter, increment, before, after) \
43 do { \
44 (counter) += (increment); \
45 if ((counter) > 23) { \
46 before; \
47 printf(" -- Press any key to continue -- "); \
48 indev_pop_character(stdin); \
49 after; \
50 printf("\n"); \
51 (counter) = 0; \
52 } \
53 } while (0)
54
55extern indev_t *stdin;
56extern outdev_t *stdout;
57
58extern void early_putchar(wchar_t);
59
60extern indev_t *stdin_wire(void);
61extern void stdout_wire(outdev_t *outdev);
62extern void console_init(void);
63
64extern void klog_init(void);
65extern void klog_update(void *);
66
67extern wchar_t getc(indev_t *indev);
68extern size_t gets(indev_t *indev, char *buf, size_t buflen);
69extern sysarg_t sys_klog(int cmd, const void *buf, size_t size);
70
71extern void grab_console(void);
72extern void release_console(void);
73
74extern sysarg_t sys_debug_activate_console(void);
75
76#endif /* KERN_CONSOLE_H_ */
77
78/** @}
79 */
Note: See TracBrowser for help on using the repository browser.