Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / qemu-palcode / console.h
1 /* Console Callback Routines.
2
3    Copyright (C) 2011 Richard Henderson
4
5    This file is part of QEMU PALcode.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the text
15    of the GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; see the file COPYING.  If not see
19    <http://www.gnu.org/licenses/>.  */
20
21 #ifndef CONSOLE_H
22 #define CONSOLE_H 1
23
24 #define CRB_GETC                0x01
25 #define CRB_PUTS                0x02
26 #define CRB_RESET_TERM          0x03
27 #define CRB_SET_TERM_INT        0x04
28 #define CRB_SET_TERM_CTL        0x05
29 #define CRB_PROCESS_KEYCODE     0x06
30
31 #define CRB_OPEN                0x10
32 #define CRB_CLOSE               0x11
33 #define CRB_IOCTL               0x12
34 #define CRB_READ                0x13
35 #define CRB_WRITE               0x14
36
37 #define CRB_SET_ENV             0x20
38 #define CRB_RESET_ENV           0x21
39 #define CRB_GET_ENV             0x22
40 #define CRB_SAVE_ENV            0x23
41
42 #define CRB_PSWITCH             0x30
43
44 extern unsigned long crb_getc(long unit);
45 extern unsigned long crb_process_keycode(long unit, long keycode, long again);
46 extern unsigned long crb_puts(long unit, const char *buf, unsigned long length);
47 extern unsigned long crb_reset_term(long unit);
48
49 extern unsigned long crb_open(const char *devstr,  unsigned long length);
50 extern unsigned long crb_close(long channel);
51 extern unsigned long crb_read(long channel, unsigned long length,
52                               char *buf, unsigned long block);
53 extern unsigned long crb_write(long channel, unsigned long length,
54                                const char *buf, unsigned long block);
55
56 extern unsigned long crb_get_env(unsigned long id, char *buf,
57                                  unsigned long length);
58 extern unsigned long crb_set_env(unsigned long id, const char *buf,
59                                  unsigned long length);
60
61 #endif /* CONSOLE_H */