vhost.h (ab27c07f607253f928cbc8c64d9c0d273df09e6b) | vhost.h (7d82410950aa74adccf035c332e409af2bb93e92) |
---|---|
1#ifndef _VHOST_H 2#define _VHOST_H 3 4#include <linux/eventfd.h> 5#include <linux/vhost.h> 6#include <linux/mm.h> 7#include <linux/mutex.h> 8#include <linux/poll.h> --- 161 unchanged lines hidden (view full) --- 170 171static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) 172{ 173 return vq->acked_features & (1ULL << bit); 174} 175 176static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) 177{ | 1#ifndef _VHOST_H 2#define _VHOST_H 3 4#include <linux/eventfd.h> 5#include <linux/vhost.h> 6#include <linux/mm.h> 7#include <linux/mutex.h> 8#include <linux/poll.h> --- 161 unchanged lines hidden (view full) --- 170 171static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) 172{ 173 return vq->acked_features & (1ULL << bit); 174} 175 176static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) 177{ |
178 return vhost_has_feature(vq, VIRTIO_F_VERSION_1); | 178 return vhost_has_feature(vq, VIRTIO_F_VERSION_1) || 179 virtio_legacy_is_little_endian(); |
179} 180 181/* Memory accessors */ 182static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) 183{ 184 return __virtio16_to_cpu(vhost_is_little_endian(vq), val); 185} 186 --- 25 unchanged lines hidden --- | 180} 181 182/* Memory accessors */ 183static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) 184{ 185 return __virtio16_to_cpu(vhost_is_little_endian(vq), val); 186} 187 --- 25 unchanged lines hidden --- |