freebsd-skq/sys/powerpc
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
..
aim Add a VA_IS_CLEANMAP() macro. 2021-02-17 16:32:11 -08:00
amigaone powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
booke Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
conf powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 2021-02-06 03:21:55 +01:00
cpufreq powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
fpu powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
include [PowerPC] Floating-point exception trap followup 2020-12-13 03:58:43 +00:00
mambo Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
mikrotik powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
mpc85xx Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
ofw Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
powermac powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
powernv [POWERPC64LE] fix sysctl dev.opal_sensor.* on little-endian kernel 2020-12-30 22:00:28 -03:00
powerpc gdb: only return signal values for powerpc's gdb_cpu_signal() 2021-01-22 15:01:49 -04:00
ps3 Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
pseries [PowerPC64LE] pseries: Fix input buffering logic. 2021-02-25 14:50:13 -06:00
psim powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00