XenevaOS
Loading...
Searching...
No Matches
XenevaOS
BaseHdr
linux
device
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
17
struct
faux_device
{
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
23
static
inline
struct
faux_device
*
24
faux_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
35
static
inline
void
faux_device_destroy(
struct
faux_device
*
dev
)
36
{
37
kfree
(
dev
);
38
}
39
40
#endif
/* _LINUX_DEVICE_FAUX_H */
device.h
name
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition
drm_crtc.h:1242
dev
const struct device * dev
Definition
drm_print.h:519
kfree
void kfree(void)
parent
struct kobject * parent
Definition
kobject.h:91
slab.h
kmalloc
#define kmalloc(size, flags)
Definition
slab.h:123
device
Definition
fs.h:255
faux_device
Definition
faux.h:17
faux_device::dev
struct device dev
Definition
faux.h:18
faux_device::_tail
char _tail[64]
Definition
faux.h:19
Generated by
1.9.8