}
int hypfs_write_leaf(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen)
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen)
{
char *buf;
int ret;
}
int hypfs_write_bool(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen)
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen)
{
bool buf;
}
int hypfs_write_custom(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen)
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen)
{
struct param_hypfs *p;
char *buf;
}
int hypfs_write_deny(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen)
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen)
{
return -EACCES;
}
static int hypfs_write(struct hypfs_entry *entry,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen)
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned long ulen)
{
struct hypfs_entry_leaf *l;
break;
case XEN_HYPFS_OP_write_contents:
- ret = hypfs_write(entry, arg3, arg4);
+ ret = hypfs_write(entry, guest_handle_const_cast(arg3, void), arg4);
break;
default:
type *_x = (hnd).p; \
(XEN_GUEST_HANDLE_PARAM(type)) { _x }; \
})
+/* Same for casting to a const type. */
+#define guest_handle_const_cast(hnd, type) ({ \
+ const type *p_ = (hnd).p; \
+ (XEN_GUEST_HANDLE_PARAM(const_##type)) { p_ }; \
+})
/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
#define guest_handle_to_param(hnd, type) ({ \
int (*read)(const struct hypfs_entry *entry,
XEN_GUEST_HANDLE_PARAM(void) uaddr);
int (*write)(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen);
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr, unsigned int ulen);
unsigned int (*getsize)(const struct hypfs_entry *entry);
struct hypfs_entry *(*findentry)(const struct hypfs_entry_dir *dir,
const char *name, unsigned int name_len);
int hypfs_read_leaf(const struct hypfs_entry *entry,
XEN_GUEST_HANDLE_PARAM(void) uaddr);
int hypfs_write_deny(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen);
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen);
int hypfs_write_leaf(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen);
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen);
int hypfs_write_bool(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen);
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen);
int hypfs_write_custom(struct hypfs_entry_leaf *leaf,
- XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned int ulen);
+ XEN_GUEST_HANDLE_PARAM(const_void) uaddr,
+ unsigned int ulen);
unsigned int hypfs_getsize(const struct hypfs_entry *entry);
struct hypfs_entry *hypfs_leaf_findentry(const struct hypfs_entry_dir *dir,
const char *name,