XenevaOS
Loading...
Searching...
No Matches
faux.h
Go to the documentation of this file.
1/*
2 * DCL device/faux.h -- faux devices are just allocations.
3 *
4 * vkms_drv.c creates a parentless faux device to hang its connectors off
5 * (mainline routes that through the driver core's faux bus). DCL devices
6 * only matter through devfs, and a faux device never gets a devt, so the
7 * object exists to be stored and destroyed; its size is a fixed stand-in
8 * because vkms only keeps the pointer.
9 */
10#ifndef _LINUX_DEVICE_FAUX_H
11#define _LINUX_DEVICE_FAUX_H
12
13#include <linux/slab.h>
14#include <linux/device.h> /* struct device -- mainline's faux_device
15 * embeds one, and vkms_drv.c takes &dev */
16
18 struct device dev;
19 char _tail[64]; /* stand-in for groups/glue_dir/bus; vkms
20 * only ever takes &dev and destroys it */
21};
22
23static inline struct faux_device *
24faux_device_create(const char *name, void *parent, void *groups)
25{
26 struct faux_device *dev;
27
28 (void)name; (void)parent; (void)groups;
29 dev = (struct faux_device *)kmalloc(sizeof(struct faux_device), 0);
30 if (dev)
31 *dev = (struct faux_device){ 0 };
32 return dev;
33}
34
35static inline void faux_device_destroy(struct faux_device *dev)
36{
37 kfree(dev);
38}
39
40#endif /* _LINUX_DEVICE_FAUX_H */
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
const struct device * dev
Definition drm_print.h:519
void kfree(void)
struct kobject * parent
Definition kobject.h:91
#define kmalloc(size, flags)
Definition slab.h:123
Definition fs.h:255
Definition faux.h:17
struct device dev
Definition faux.h:18
char _tail[64]
Definition faux.h:19