aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/hvconsole.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-14 01:30:17 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-14 01:30:17 -0500
commit7568cb4ef6c507164b65b01f972a3bd026898ae1 (patch)
treeba608f4c84d8765d5a1491c345f6dc265b5ec4ea /arch/powerpc/platforms/pseries/hvconsole.c
parentc55377ee73f6efeb373ae06f6e918d87660b4852 (diff)
powerpc: Move most remaining ppc64 files over to arch/powerpc
Also deletes files in arch/ppc64 that are no longer used now that we don't compile with ARCH=ppc64 any more. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/hvconsole.c')
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
new file mode 100644
index 000000000000..138e128a3886
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -0,0 +1,74 @@
1/*
2 * hvconsole.c
3 * Copyright (C) 2004 Hollis Blanchard, IBM Corporation
4 * Copyright (C) 2004 IBM Corporation
5 *
6 * Additional Author(s):
7 * Ryan S. Arnold <rsa@us.ibm.com>
8 *
9 * LPAR console support.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26#include <linux/kernel.h>
27#include <linux/module.h>
28#include <asm/hvcall.h>
29#include <asm/hvconsole.h>
30
31/**
32 * hvc_get_chars - retrieve characters from firmware for denoted vterm adatper
33 * @vtermno: The vtermno or unit_address of the adapter from which to fetch the
34 * data.
35 * @buf: The character buffer into which to put the character data fetched from
36 * firmware.
37 * @count: not used?
38 */
39int hvc_get_chars(uint32_t vtermno, char *buf, int count)
40{
41 unsigned long got;
42
43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
44 (unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
45 return got;
46 return 0;
47}
48
49EXPORT_SYMBOL(hvc_get_chars);
50
51
52/**
53 * hvc_put_chars: send characters to firmware for denoted vterm adapter
54 * @vtermno: The vtermno or unit_address of the adapter from which the data
55 * originated.
56 * @buf: The character buffer that contains the character data to send to
57 * firmware.
58 * @count: Send this number of characters.
59 */
60int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
61{
62 unsigned long *lbuf = (unsigned long *) buf;
63 long ret;
64
65 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
66 lbuf[1]);
67 if (ret == H_Success)
68 return count;
69 if (ret == H_Busy)
70 return 0;
71 return -EIO;
72}
73
74EXPORT_SYMBOL(hvc_put_chars);