XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
chip.c
浏览该文件的文档.
1
21#include <xwcd/ds/standard.h>
22#include <xwcd/ds/misc/chip.h>
23
24static __xwds_vop
26
27static __xwds_vop
29
30static __xwds_vop
32
33static __xwds_vop
35
36#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
37static __xwds_vop
39
40static __xwds_vop
42#endif
43
45 .probe = (void *)xwds_misc_vop_probe,
47 .start = (void *)xwds_misc_vop_start,
48 .stop = (void *)xwds_misc_vop_stop,
49#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
50 .suspend = (void *)xwds_misc_vop_suspend,
52#endif
53};
54
55/******** ******** ******** constructor & destructor ******** ******** ********/
57void xwds_misc_construct(struct xwds_misc * misc)
58{
60 misc->dev.vop = &xwds_misc_vop;
61}
62
64void xwds_misc_destruct(struct xwds_misc * misc)
65{
67}
68
71{
72 return xwds_device_grab(&misc->dev);
73}
74
77{
78 return xwds_device_put(&misc->dev);
79}
80
81/******** ******** base virtual operations ******** ********/
86static __xwds_vop
88{
89 xwer_t rc;
90
91 rc = xwds_device_vop_probe(&misc->dev);
92 return rc;
93}
94
100static __xwds_vop
102{
103 xwer_t rc;
104
105 rc = xwds_device_vop_remove(&misc->dev);
106 return rc;
107}
108
113static __xwds_vop
115{
116 xwer_t rc;
117
118 rc = xwds_device_vop_start(&misc->dev);
119 return rc;
120}
121
126static __xwds_vop
128{
129 xwer_t rc;
130
131 rc = xwds_device_vop_stop(&misc->dev);
132 return rc;
133}
134
135#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
136/******** ******** pm ******** ********/
141static __xwds_vop
143{
144 xwer_t rc;
145
146 rc = xwds_device_vop_suspend(&misc->dev);
147 return rc;
148}
149
154static __xwds_vop
156{
157 xwer_t rc;
158
159 rc = xwds_device_vop_resume(&misc->dev);
160 return rc;
161}
162#endif
static xwer_t xwds_device_grab(struct xwds_device *dev)
XWDS API:增加对象的引用计数
Definition device.h:268
xwer_t xwds_device_vop_start(struct xwds_device *dev)
设备基本操作函数:启动设备
Definition device.c:105
void xwds_device_construct(struct xwds_device *dev)
XWDS API:设备的构造函数
Definition device.c:48
void xwds_device_destruct(struct xwds_device *dev)
XWDS API:设备的析构函数
Definition device.c:56
static xwer_t xwds_device_put(struct xwds_device *dev)
XWDS API:减少对象的引用计数
Definition device.h:281
xwer_t xwds_device_vop_stop(struct xwds_device *dev)
设备基本操作函数:停止设备
Definition device.c:124
xwer_t xwds_device_vop_remove(struct xwds_device *dev)
设备基本操作函数:删除设备
Definition device.c:86
xwer_t xwds_device_vop_resume(struct xwds_device *dev)
设备基本操作函数:继续设备
Definition device.c:163
xwer_t xwds_device_vop_probe(struct xwds_device *dev)
设备基本操作函数:探测设备
Definition device.c:67
xwer_t xwds_device_vop_suspend(struct xwds_device *dev)
设备基本操作函数:暂停设备
Definition device.c:144
xwer_t xwds_misc_put(struct xwds_misc *misc)
XWDS API:减少对象的引用计数
Definition chip.c:76
xwer_t xwds_misc_grab(struct xwds_misc *misc)
XWDS API:增加对象的引用计数
Definition chip.c:70
void xwds_misc_destruct(struct xwds_misc *misc)
XWDS API:MISC设备对象的析构函数
Definition chip.c:64
void xwds_misc_construct(struct xwds_misc *misc)
XWDS API:MISC设备的构造函数
Definition chip.c:57
#define __xwds_vop
Definition standard.h:36
#define __xwds_api
Definition standard.h:33
#define __xwds_rodata
Definition standard.h:38
signed long xwer_t
Definition type.h:554
static xwer_t xwds_misc_vop_stop(struct xwds_misc *misc)
XWDS VOP:停止MISC设备
Definition chip.c:127
static xwer_t xwds_misc_vop_probe(struct xwds_misc *misc)
XWDS VOP:探测MISC设备
Definition chip.c:87
static xwer_t xwds_misc_vop_start(struct xwds_misc *misc)
XWDS VOP:启动MISC设备
Definition chip.c:114
static xwer_t xwds_misc_vop_resume(struct xwds_misc *misc)
XWDS VOP:继续MISC设备
Definition chip.c:155
const struct xwds_virtual_operation xwds_misc_vop
Definition chip.c:44
static xwer_t xwds_misc_vop_remove(struct xwds_misc *misc)
XWDS VOP:移除MISC设备
Definition chip.c:101
static xwer_t xwds_misc_vop_suspend(struct xwds_misc *misc)
XWDS VOP:暂停MISC设备
Definition chip.c:142
玄武设备栈:MISC设备
const struct xwds_virtual_operation * vop
Definition device.h:138
MISC设备
Definition chip.h:45
struct xwds_device dev
Definition chip.h:46
基本操作的虚函数表(类似C++的虚函数表)
Definition device.h:99
xwer_t(* stop)(struct xwds_device *)
Definition device.h:103
xwer_t(* remove)(struct xwds_device *)
Definition device.h:101
xwer_t(* probe)(struct xwds_device *)
Definition device.h:100
xwer_t(* resume)(struct xwds_device *)
Definition device.h:106
玄武设备栈:顶级头文件