[RFC PATCH v3 1/6] uapi: add goldfish_address_space userspace ABI header
From: Wenzhao Liao <hidden>
Date: 2026-04-06 16:51:37
Also in:
linux-pci, lkml, rust-for-linux
Subsystem:
the rest · Maintainer:
Linus Torvalds
The external goldfish address-space driver exposes its userspace contract through a dedicated header. Land the ioctl definitions in include/uapi/linux so the Rust driver can depend on an in-tree UAPI surface instead of carrying an external private header. This RFC intentionally narrows the first upstream step to the open/release/ioctl ABI subset. Userspace mmap and PING_WITH_DATA stay out of this series until they have their own review and validation story. Signed-off-by: Wenzhao Liao <redacted> --- MAINTAINERS | 8 +++ include/uapi/linux/goldfish_address_space.h | 54 +++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 include/uapi/linux/goldfish_address_space.h
diff --git a/MAINTAINERS b/MAINTAINERS
index a62f6af55c3a..800b2fe0e648 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS@@ -1882,6 +1882,14 @@ S: Supported F: Documentation/devicetree/bindings/interrupt-controller/google,goldfish-pic.yaml F: drivers/irqchip/irq-goldfish-pic.c +ANDROID GOLDFISH ADDRESS SPACE DRIVER +M: Wenzhao Liao <wenzhaoliao@ruc.edu.cn> +L: linux-kernel@vger.kernel.org +L: linux-pci@vger.kernel.org +L: rust-for-linux@vger.kernel.org +S: Maintained +F: include/uapi/linux/goldfish_address_space.h + ANDROID GOLDFISH RTC DRIVER M: Jiaxun Yang <jiaxun.yang@flygoat.com> S: Supported
diff --git a/include/uapi/linux/goldfish_address_space.h b/include/uapi/linux/goldfish_address_space.h
new file mode 100644
index 000000000000..b782d82f53df
--- /dev/null
+++ b/include/uapi/linux/goldfish_address_space.h@@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _UAPI_LINUX_GOLDFISH_ADDRESS_SPACE_H +#define _UAPI_LINUX_GOLDFISH_ADDRESS_SPACE_H + +#include <linux/ioctl.h> +#include <linux/types.h> + +#define GOLDFISH_ADDRESS_SPACE_DEVICE_NAME "goldfish_address_space" + +struct goldfish_address_space_allocate_block { + __u64 size; + __u64 offset; + __u64 phys_addr; +}; + +struct goldfish_address_space_ping { + __u64 offset; + __u64 size; + __u64 metadata; + __u32 version; + __u32 wait_fd; + __u32 wait_flags; + __u32 direction; +}; + +struct goldfish_address_space_claim_shared { + __u64 offset; + __u64 size; +}; + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_MAGIC 'G' + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_OP(OP, T) \ + _IOWR(GOLDFISH_ADDRESS_SPACE_IOCTL_MAGIC, OP, T) + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_ALLOCATE_BLOCK \ + GOLDFISH_ADDRESS_SPACE_IOCTL_OP(10, \ + struct goldfish_address_space_allocate_block) + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_DEALLOCATE_BLOCK \ + GOLDFISH_ADDRESS_SPACE_IOCTL_OP(11, __u64) + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_PING \ + GOLDFISH_ADDRESS_SPACE_IOCTL_OP(12, \ + struct goldfish_address_space_ping) + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_CLAIM_SHARED \ + GOLDFISH_ADDRESS_SPACE_IOCTL_OP(13, \ + struct goldfish_address_space_claim_shared) + +#define GOLDFISH_ADDRESS_SPACE_IOCTL_UNCLAIM_SHARED \ + GOLDFISH_ADDRESS_SPACE_IOCTL_OP(14, __u64) + +#endif /* _UAPI_LINUX_GOLDFISH_ADDRESS_SPACE_H */
--
2.34.1