Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4233
b: refs/heads/master
c: 70b234a
h: refs/heads/master
i:
  4231: 10fcd25
v: v3
  • Loading branch information
Milton Miller authored and Linus Torvalds committed Jul 8, 2005
1 parent 09277d6 commit 4a3ca6f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 030ffad23fb28fc29608a3bc21f0c3b88bf28592
refs/heads/master: 70b234a40107596a713e9981c643f2717e31463f
19 changes: 2 additions & 17 deletions trunk/arch/ppc64/kernel/hvconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,14 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
unsigned long got;

if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
(unsigned long *)buf, (unsigned long *)buf+1) == H_Success) {
/*
* Work around a HV bug where it gives us a null
* after every \r. -- paulus
*/
if (got > 0) {
int i;
for (i = 1; i < got; ++i) {
if (buf[i] == 0 && buf[i-1] == '\r') {
--got;
if (i < got)
memmove(&buf[i], &buf[i+1],
got - i);
}
}
}
(unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
return got;
}
return 0;
}

EXPORT_SYMBOL(hvc_get_chars);


/**
* hvc_put_chars: send characters to firmware for denoted vterm adapter
* @vtermno: The vtermno or unit_address of the adapter from which the data
Expand Down
24 changes: 23 additions & 1 deletion trunk/drivers/char/hvc_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,30 @@ static struct vio_device_id hvc_driver_table[] __devinitdata = {
};
MODULE_DEVICE_TABLE(vio, hvc_driver_table);

static int filtered_get_chars(uint32_t vtermno, char *buf, int count)
{
unsigned long got;
int i;

got = hvc_get_chars(vtermno, buf, count);

/*
* Work around a HV bug where it gives us a null
* after every \r. -- paulus
*/
for (i = 1; i < got; ++i) {
if (buf[i] == 0 && buf[i-1] == '\r') {
--got;
if (i < got)
memmove(&buf[i], &buf[i+1],
got - i);
}
}
return got;
}

static struct hv_ops hvc_get_put_ops = {
.get_chars = hvc_get_chars,
.get_chars = filtered_get_chars,
.put_chars = hvc_put_chars,
};

Expand Down

0 comments on commit 4a3ca6f

Please sign in to comment.