goldfish: enable 64 bit goldfish TTY device
Enable the 64 bit TTY device emulation in the goldfish platform.
Change-Id: I03a715c1f98426f13fba6fb2eb8e72557f062c6b
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
diff --git a/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT b/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
index 88220e8..6c40a3a 100644
--- a/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
+++ b/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
@@ -302,6 +302,9 @@
0x10 DATA_PTR W: Write kernel buffer address.
0x14 DATA_LEN W: Write kernel buffer size.
+ # For 64-bit guest CPUs only:
+ 0x18 DATA_PTR_HIGH W: Write high 32 bits of kernel buffer address.
+
This is the first case of a multi-instance goldfish device in this document.
Each instance implements a virtual serial port that contains a small internal
buffer where incoming data is stored until the kernel fetches it.
@@ -322,6 +325,9 @@
if (len == 0) return; // Nothing to do.
available = get_buffer(len, &buffer); // Get address of buffer and its size.
+ #if 64BIT_GUEST_CPU
+ IO_WRITE(DATA_PTR_HIGH, buffer >> 32);
+ #endif
IO_WRITE(DATA_PTR, buffer); // Write buffer address to device.
IO_WRITE(DATA_LEN, available); // Write buffer length to device.
IO_WRITE(CMD, CMD_READ_BUFFER); // Read the data into kernel buffer.
@@ -340,6 +346,9 @@
Or use the mode efficient sequence:
+ #if 64BIT_GUEST_CPU
+ IO_WRITE(DATA_PTR_HIGH, buffer >> 32)
+ #endif
IO_WRITE(DATA_PTR, buffer)
IO_WRITE(DATA_LEN, buffer_len)
IO_WRITE(CMD, CMD_WRITE_BUFFER)