uapi headers: simplify the <linux/compiler.h> stuff.
We don't really need <linux/compiler.h> and <linux/compiler_types.h>. We
already have a mechanism to remove unused macros, so let's do that. We
don't currently have a way to remove unused #includes, so we still need
<linux/compiler.h> and <linux/compiler_types.h> files (but I've clarified
the comments in them).
I've kept the empty definitions of `__user` and `__force` for source
compatibility. (We had one security test at least that was assuming
a kernel struct definition will "just work".)
Bug: http://b/262917450
Test: treehugger
Change-Id: Iacbbbc1aeef9a4fac52dabd7811ab875cc267d4f
diff --git a/libc/kernel/uapi/xen/gntdev.h b/libc/kernel/uapi/xen/gntdev.h
index 1e78ac3..eada73c 100644
--- a/libc/kernel/uapi/xen/gntdev.h
+++ b/libc/kernel/uapi/xen/gntdev.h
@@ -55,7 +55,7 @@
};
struct gntdev_grant_copy_segment {
union {
- void __user * virt;
+ void * virt;
struct {
grant_ref_t ref;
__u16 offset;
@@ -69,7 +69,7 @@
#define IOCTL_GNTDEV_GRANT_COPY _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
struct ioctl_gntdev_grant_copy {
unsigned int count;
- struct gntdev_grant_copy_segment __user * segments;
+ struct gntdev_grant_copy_segment * segments;
};
#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
#define UNMAP_NOTIFY_SEND_EVENT 0x2
diff --git a/libc/kernel/uapi/xen/privcmd.h b/libc/kernel/uapi/xen/privcmd.h
index 145446b..21d9f84 100644
--- a/libc/kernel/uapi/xen/privcmd.h
+++ b/libc/kernel/uapi/xen/privcmd.h
@@ -33,13 +33,13 @@
struct privcmd_mmap {
int num;
domid_t dom;
- struct privcmd_mmap_entry __user * entry;
+ struct privcmd_mmap_entry * entry;
};
struct privcmd_mmapbatch {
int num;
domid_t dom;
__u64 addr;
- xen_pfn_t __user * arr;
+ xen_pfn_t * arr;
};
#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
@@ -47,17 +47,17 @@
unsigned int num;
domid_t dom;
__u64 addr;
- const xen_pfn_t __user * arr;
- int __user * err;
+ const xen_pfn_t * arr;
+ int * err;
};
struct privcmd_dm_op_buf {
- void __user * uptr;
+ void * uptr;
size_t size;
};
struct privcmd_dm_op {
domid_t dom;
__u16 num;
- const struct privcmd_dm_op_buf __user * ubufs;
+ const struct privcmd_dm_op_buf * ubufs;
};
struct privcmd_mmap_resource {
domid_t dom;