#include <acm/acm_endian.h>
int
-acm_set_policy(void *buf, u32 buf_size, int isuserbuffer)
+acm_set_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size, int isuserbuffer)
{
u8 *policy_buffer = NULL;
struct acm_policy_buffer *pol;
return -ENOMEM;
if (isuserbuffer) {
- if (copy_from_user(policy_buffer, buf, buf_size))
+ if (copy_from_guest(policy_buffer, buf, buf_size))
{
printk("%s: Error copying!\n",__func__);
goto error_free;
}
int
-acm_get_policy(void *buf, u32 buf_size)
+acm_get_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size)
{
u8 *policy_buffer;
int ret;
goto error_free_unlock;
bin_pol->len = htonl(ntohl(bin_pol->len) + ret);
- if (copy_to_user(buf, policy_buffer, ntohl(bin_pol->len)))
+ if (copy_to_guest(buf, policy_buffer, ntohl(bin_pol->len)))
goto error_free_unlock;
read_unlock(&acm_bin_pol_rwlock);
}
int
-acm_dump_statistics(void *buf, u16 buf_size)
+acm_dump_statistics(XEN_GUEST_HANDLE(void) buf, u16 buf_size)
{
/* send stats to user space */
u8 *stats_buffer;
memcpy(stats_buffer, &acm_stats, sizeof(struct acm_stats_buffer));
- if (copy_to_user(buf, stats_buffer, sizeof(struct acm_stats_buffer) + len1 + len2))
+ if (copy_to_guest(buf, stats_buffer, sizeof(struct acm_stats_buffer) + len1 + len2))
goto error_lock_free;
read_unlock(&acm_bin_pol_rwlock);
int
-acm_get_ssid(ssidref_t ssidref, u8 *buf, u16 buf_size)
+acm_get_ssid(ssidref_t ssidref, XEN_GUEST_HANDLE(void) buf, u16 buf_size)
{
/* send stats to user space */
u8 *ssid_buffer;
acm_ssid->len += ret;
acm_ssid->secondary_max_types = ret;
- if (copy_to_user(buf, ssid_buffer, acm_ssid->len))
+ if (copy_to_guest(buf, ssid_buffer, acm_ssid->len))
goto error_free_unlock;
read_unlock(&acm_bin_pol_rwlock);
* This makes sure that old versions of acm tools will stop working in a
* well-defined way (rather than crashing the machine, for instance).
*/
-#define ACM_INTERFACE_VERSION 0xAAAA0007
+#define ACM_INTERFACE_VERSION 0xAAAA0008
/************************************************************************/
struct acm_setpolicy {
/* IN */
uint32_t interface_version;
- void *pushcache;
+ XEN_GUEST_HANDLE(void) pushcache;
uint32_t pushcache_size;
};
struct acm_getpolicy {
/* IN */
uint32_t interface_version;
- void *pullcache;
+ XEN_GUEST_HANDLE(void) pullcache;
uint32_t pullcache_size;
};
struct acm_dumpstats {
/* IN */
uint32_t interface_version;
- void *pullcache;
+ XEN_GUEST_HANDLE(void) pullcache;
uint32_t pullcache_size;
};
struct acm_getssid {
/* IN */
uint32_t interface_version;
- enum get_type get_ssid_by;
+ uint32_t get_ssid_by;
union {
domaintype_t domainid;
ssidref_t ssidref;
} id;
- void *ssidbuf;
+ XEN_GUEST_HANDLE(void) ssidbuf;
uint32_t ssidbuf_size;
};
struct acm_getdecision {
/* IN */
uint32_t interface_version;
- enum get_type get_decision_by1;
- enum get_type get_decision_by2;
+ uint32_t get_decision_by1;
+ uint32_t get_decision_by2;
union {
domaintype_t domainid;
ssidref_t ssidref;
domaintype_t domainid;
ssidref_t ssidref;
} id2;
- enum acm_hook_type hook;
+ uint32_t hook;
/* OUT */
- int acm_decision;
+ uint32_t acm_decision;
};
#endif /* __XEN_PUBLIC_ACM_OPS_H__ */