freebsd-dev/sys/powerpc/pseries
Brandon Bergren 5001c579ba [PowerPC64LE] pseries: Fix input buffering logic.
In uart_phyp_get(), when the internal buffer is empty, we make a
hypercall to retrieve up to 16 bytes of input data from the
hypervisor. As this is specified to be returned in BE format, we need
to do a 64-bit byte swap on the first and second half of the data.

If the buffer being passed in was insufficient to return the fetched
data, we store the remainder in the internal buffer and use it to
satisfy the following calls to uart_phyp_get() until it is drained.

However, in this case, we were accidentally byteswapping the internal
buffer again.

Move the byteswapping code to just after the hypercall so it only gets
swapped when we're filling the buffer.

Fixes arrow keys in qemu on pseries, among other console oddities.

Sponsored by:	Tag1 Consulting, Inc.
MFC after:	3 days
2021-02-25 14:50:13 -06:00
..
mmu_phyp.c Implement superpages for PowerPC64 (HPT) 2020-11-06 14:12:45 +00:00
phyp_console.c [PowerPC64LE] pseries: Fix input buffering logic. 2021-02-25 14:50:13 -06:00
phyp_dbg.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
phyp_llan.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
phyp_vscsi.c [PowerPC64LE] Fix endianness issues in phyp_vscsi. 2020-09-23 00:13:58 +00:00
phyp-hvcall.h [PowerPC64LE] Tell the hypervisor to switch interrupts to LE at CHRP attach. 2020-09-23 00:03:35 +00:00
phyp-hvcall.S Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
platform_chrp.c [PowerPC64LE] Tell the hypervisor to switch interrupts to LE at CHRP attach. 2020-09-23 00:03:35 +00:00
plpar_iommu.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
plpar_iommu.h powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
plpar_pcibus.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
rtas_dev.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
rtas_pci.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
vdevice.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
xics.c powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00