projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[POWERPC] clean up pseries hcall interfaces
[powerpc.git]
/
arch
/
powerpc
/
platforms
/
pseries
/
hvconsole.c
diff --git
a/arch/powerpc/platforms/pseries/hvconsole.c
b/arch/powerpc/platforms/pseries/hvconsole.c
index
138e128
..
3f6a89b
100644
(file)
--- a/
arch/powerpc/platforms/pseries/hvconsole.c
+++ b/
arch/powerpc/platforms/pseries/hvconsole.c
@@
-27,6
+27,7
@@
#include <linux/module.h>
#include <asm/hvcall.h>
#include <asm/hvconsole.h>
#include <linux/module.h>
#include <asm/hvcall.h>
#include <asm/hvconsole.h>
+#include "plpar_wrappers.h"
/**
* hvc_get_chars - retrieve characters from firmware for denoted vterm adatper
/**
* hvc_get_chars - retrieve characters from firmware for denoted vterm adatper
@@
-40,9
+41,9
@@
int hvc_get_chars(uint32_t vtermno, char *buf, int count)
{
unsigned long got;
{
unsigned long got;
- if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
- (unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
+ if (plpar_get_term_char(vtermno, &got, buf) == H_SUCCESS)
return got;
return got;
+
return 0;
}
return 0;
}
@@
-62,11
+63,16
@@
int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
unsigned long *lbuf = (unsigned long *) buf;
long ret;
unsigned long *lbuf = (unsigned long *) buf;
long ret;
+
+ /* hcall will ret H_PARAMETER if 'count' exceeds firmware max.*/
+ if (count > MAX_VIO_PUT_CHARS)
+ count = MAX_VIO_PUT_CHARS;
+
ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
lbuf[1]);
ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
lbuf[1]);
- if (ret == H_S
uccess
)
+ if (ret == H_S
UCCESS
)
return count;
return count;
- if (ret == H_B
usy
)
+ if (ret == H_B
USY
)
return 0;
return -EIO;
}
return 0;
return -EIO;
}