On 3/3/23 7:06 PM, Elliot Berman wrote:
@@ -129,6 +131,7 @@ struct gh_rm_connection {
* @cache: cache for allocating Tx messages
* @send_lock: synchronization to allow only one request to be sent at a time
* @nh: notifier chain for clients interested in RM notification messages
+ * @miscdev: /dev/gunyah
*/
struct gh_rm {
struct device *dev;
@@ -145,6 +148,8 @@ struct gh_rm {
struct kmem_cache *cache;
struct mutex send_lock;
struct blocking_notifier_head nh;
+
+ struct miscdevice miscdev;
};
/**
@@ -593,6 +598,21 @@ void gh_rm_put(struct gh_rm *rm)
}
EXPORT_SYMBOL_GPL(gh_rm_put);
I feel like /dev/gunyah code would more appropriately be found
in "vm_mgr.c". All gh_dev_ioctl() does is call the function
defined there, and it's therefore a VM-oriented rather than
resource-oriented device.
+
+static long gh_dev_ioctl_create_vm(struct gh_rm *rm, unsigned long arg)
+{
+ struct gh_vm *ghvm;
+ struct file *file;
+ int fd, err;
+
+ /* arg reserved for future use. */
Do you have a clear idea of how this might be used in the future?
I was thinking you could silently ignore the argument value, but
I suppose if it *does* get used in the future, you want the caller
to know it's being ignored. (Is that right?)