|
@@ -29,10 +29,10 @@
|
|
|
#define VISOR_DRV_NAME "visorchannel"
|
|
|
|
|
|
#define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
|
|
|
- UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \
|
|
|
- 0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2)
|
|
|
+ GUID_INIT(0x3cd6e705, 0xd6a2, 0x4aa5, \
|
|
|
+ 0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2)
|
|
|
|
|
|
-static const uuid_le visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
|
|
|
+static const guid_t visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
|
|
|
|
|
|
struct visorchannel {
|
|
|
u64 physaddr;
|
|
@@ -40,7 +40,7 @@ struct visorchannel {
|
|
|
void *mapped;
|
|
|
bool requested;
|
|
|
struct channel_header chan_hdr;
|
|
|
- uuid_le guid;
|
|
|
+ guid_t guid;
|
|
|
/*
|
|
|
* channel creator knows if more than one
|
|
|
* thread will be inserting or removing
|
|
@@ -50,8 +50,8 @@ struct visorchannel {
|
|
|
spinlock_t insert_lock;
|
|
|
/* protect tail writes in chan_hdr */
|
|
|
spinlock_t remove_lock;
|
|
|
- uuid_le type;
|
|
|
- uuid_le inst;
|
|
|
+ guid_t type;
|
|
|
+ guid_t inst;
|
|
|
};
|
|
|
|
|
|
void visorchannel_destroy(struct visorchannel *channel)
|
|
@@ -76,7 +76,7 @@ ulong visorchannel_get_nbytes(struct visorchannel *channel)
|
|
|
return channel->nbytes;
|
|
|
}
|
|
|
|
|
|
-char *visorchannel_uuid_id(uuid_le *guid, char *s)
|
|
|
+char *visorchannel_guid_id(const guid_t *guid, char *s)
|
|
|
{
|
|
|
sprintf(s, "%pUL", guid);
|
|
|
return s;
|
|
@@ -84,12 +84,12 @@ char *visorchannel_uuid_id(uuid_le *guid, char *s)
|
|
|
|
|
|
char *visorchannel_id(struct visorchannel *channel, char *s)
|
|
|
{
|
|
|
- return visorchannel_uuid_id(&channel->guid, s);
|
|
|
+ return visorchannel_guid_id(&channel->guid, s);
|
|
|
}
|
|
|
|
|
|
char *visorchannel_zoneid(struct visorchannel *channel, char *s)
|
|
|
{
|
|
|
- return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
|
|
|
+ return visorchannel_guid_id(&channel->chan_hdr.zone_guid, s);
|
|
|
}
|
|
|
|
|
|
u64 visorchannel_get_clientpartition(struct visorchannel *channel)
|
|
@@ -105,16 +105,16 @@ int visorchannel_set_clientpartition(struct visorchannel *channel,
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * visorchannel_get_uuid() - queries the UUID of the designated channel
|
|
|
+ * visorchannel_get_guid() - queries the GUID of the designated channel
|
|
|
* @channel: the channel to query
|
|
|
*
|
|
|
- * Return: the UUID of the provided channel
|
|
|
+ * Return: the GUID of the provided channel
|
|
|
*/
|
|
|
-uuid_le visorchannel_get_uuid(struct visorchannel *channel)
|
|
|
+const guid_t *visorchannel_get_guid(struct visorchannel *channel)
|
|
|
{
|
|
|
- return channel->guid;
|
|
|
+ return &channel->guid;
|
|
|
}
|
|
|
-EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
|
|
|
+EXPORT_SYMBOL_GPL(visorchannel_get_guid);
|
|
|
|
|
|
int visorchannel_read(struct visorchannel *channel, ulong offset, void *dest,
|
|
|
ulong nbytes)
|
|
@@ -365,7 +365,7 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue,
|
|
|
* back-end), in which case the actual channel size will be
|
|
|
* read from the channel header in memory
|
|
|
* @gfp: gfp_t to use when allocating memory for the data struct
|
|
|
- * @guid: uuid that identifies channel type; this may 0 if the channel
|
|
|
+ * @guid: GUID that identifies channel type; this may 0 if the channel
|
|
|
* has already been initialized in memory (which is true for all
|
|
|
* channels provided to guest environments by the s-Par
|
|
|
* back-end), in which case the actual channel guid will be
|
|
@@ -380,7 +380,7 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue,
|
|
|
static struct visorchannel *visorchannel_create_guts(
|
|
|
u64 physaddr,
|
|
|
unsigned long channel_bytes,
|
|
|
- gfp_t gfp, uuid_le guid,
|
|
|
+ gfp_t gfp, const guid_t *guid,
|
|
|
bool needs_lock)
|
|
|
{
|
|
|
struct visorchannel *channel;
|
|
@@ -406,7 +406,7 @@ static struct visorchannel *visorchannel_create_guts(
|
|
|
* release later on.
|
|
|
*/
|
|
|
channel->requested = request_mem_region(physaddr, size, VISOR_DRV_NAME);
|
|
|
- if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
|
|
|
+ if (!channel->requested && !guid_equal(guid, &visor_video_guid))
|
|
|
/* we only care about errors if this is not the video channel */
|
|
|
goto err_destroy_channel;
|
|
|
|
|
@@ -427,8 +427,8 @@ static struct visorchannel *visorchannel_create_guts(
|
|
|
/* we had better be a CLIENT of this channel */
|
|
|
if (channel_bytes == 0)
|
|
|
channel_bytes = (ulong)channel->chan_hdr.size;
|
|
|
- if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
|
|
|
- guid = channel->chan_hdr.chtype;
|
|
|
+ if (guid_is_null(guid))
|
|
|
+ guid = &channel->chan_hdr.chtype;
|
|
|
|
|
|
memunmap(channel->mapped);
|
|
|
if (channel->requested)
|
|
@@ -436,7 +436,7 @@ static struct visorchannel *visorchannel_create_guts(
|
|
|
channel->mapped = NULL;
|
|
|
channel->requested = request_mem_region(channel->physaddr,
|
|
|
channel_bytes, VISOR_DRV_NAME);
|
|
|
- if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
|
|
|
+ if (!channel->requested && !guid_equal(guid, &visor_video_guid))
|
|
|
/* we only care about errors if this is not the video channel */
|
|
|
goto err_destroy_channel;
|
|
|
|
|
@@ -448,7 +448,7 @@ static struct visorchannel *visorchannel_create_guts(
|
|
|
}
|
|
|
|
|
|
channel->nbytes = channel_bytes;
|
|
|
- channel->guid = guid;
|
|
|
+ guid_copy(&channel->guid, guid);
|
|
|
return channel;
|
|
|
|
|
|
err_destroy_channel:
|
|
@@ -458,7 +458,7 @@ err_destroy_channel:
|
|
|
|
|
|
struct visorchannel *visorchannel_create(u64 physaddr,
|
|
|
unsigned long channel_bytes,
|
|
|
- gfp_t gfp, uuid_le guid)
|
|
|
+ gfp_t gfp, const guid_t *guid)
|
|
|
{
|
|
|
return visorchannel_create_guts(physaddr, channel_bytes, gfp, guid,
|
|
|
false);
|
|
@@ -466,7 +466,7 @@ struct visorchannel *visorchannel_create(u64 physaddr,
|
|
|
|
|
|
struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
|
|
|
unsigned long channel_bytes,
|
|
|
- gfp_t gfp, uuid_le guid)
|
|
|
+ gfp_t gfp, const guid_t *guid)
|
|
|
{
|
|
|
return visorchannel_create_guts(physaddr, channel_bytes, gfp, guid,
|
|
|
true);
|