XWOS API
4.0
XWOS C/C++ API参考手册
|
玄武设备栈:设备基类 更多...
#include <xwcd/ds/standard.h>
#include <xwos/lib/xwaop.h>
#include <xwos/lib/bclst.h>
#include <xwos/osal/lock/mtx.h>
#include <xwcd/ds/object.h>
结构体 | |
struct | xwds_virtual_operation |
基本操作的虚函数表(类似C++的虚函数表) 更多... | |
struct | xwds_driver |
基本驱动函数表(所有设备驱动的基类) 更多... | |
struct | xwds_device |
设备(所有设备的基类) 更多... | |
宏定义 | |
#define | xwds_itr_next_device(ds, p) |
向前迭代每个设备 | |
#define | xwds_itr_prev_device(ds, p) |
向后迭代每个设备 | |
#define | xwds_itr_next_device_safe(ds, p, n) |
向前迭代每个设备(可安全删除设备) | |
#define | xwds_itr_prev_device_safe(ds, p, n) |
向后迭代每个设备(可安全删除设备) | |
#define | __IOC_NRBITS 8 |
#define | __IOC_TYPEBITS 8 |
#define | __IOC_SIZEBITS 14 |
#define | __IOC_DIRBITS 2 |
#define | __IOC_NRMASK ((1 << __IOC_NRBITS) - 1) |
#define | __IOC_TYPEMASK ((1 << __IOC_TYPEBITS) - 1) |
#define | __IOC_SIZEMASK ((1 << __IOC_SIZEBITS) - 1) |
#define | __IOC_DIRMASK ((1 << __IOC_DIRBITS) - 1) |
#define | __IOC_NRSHIFT 0 |
#define | __IOC_TYPESHIFT (__IOC_NRSHIFT + __IOC_NRBITS) |
#define | __IOC_SIZESHIFT (__IOC_TYPESHIFT + __IOC_TYPEBITS) |
#define | __IOC_DIRSHIFT (__IOC_SIZESHIFT + __IOC_SIZEBITS) |
#define | __IOC_CTRL 0U |
#define | __IOC_WRITE 1U |
#define | __IOC_READ 2U |
#define | __IOC(dir, type, nr, size) |
函数 | |
xwer_t | xwds_device_vop_probe (struct xwds_device *dev) |
设备基本操作函数:探测设备 | |
xwer_t | xwds_device_vop_remove (struct xwds_device *dev) |
设备基本操作函数:删除设备 | |
xwer_t | xwds_device_vop_start (struct xwds_device *dev) |
设备基本操作函数:启动设备 | |
xwer_t | xwds_device_vop_stop (struct xwds_device *dev) |
设备基本操作函数:停止设备 | |
xwer_t | xwds_device_vop_suspend (struct xwds_device *dev) |
设备基本操作函数:暂停设备 | |
xwer_t | xwds_device_vop_resume (struct xwds_device *dev) |
设备基本操作函数:继续设备 | |
void | xwds_device_construct (struct xwds_device *dev) |
XWDS API:设备的构造函数 | |
void | xwds_device_destruct (struct xwds_device *dev) |
XWDS API:设备的析构函数 | |
xwer_t | xwds_device_probe (struct xwds *ds, struct xwds_device *dev, xwobj_gc_f gcfunc) |
XWDS API:探测设备 | |
xwer_t | xwds_device_remove (struct xwds_device *dev) |
XWDS API:删除设备 | |
xwer_t | xwds_device_start (struct xwds_device *dev) |
XWDS API:启动设备 | |
xwer_t | xwds_device_stop (struct xwds_device *dev) |
XWDS API:停止设备 | |
xwer_t | xwds_device_suspend (struct xwds_device *dev) |
XWDS API:暂停设备 | |
xwer_t | xwds_device_resume (struct xwds_device *dev) |
XWDS API:继续设备 | |
xwer_t | xwds_device_suspend_all (struct xwds *ds, bool ign_err) |
XWDS API:暂停所有设备 | |
xwer_t | xwds_device_resume_all (struct xwds *ds, bool ign_err) |
XWDS API:继续所有设备 | |
static xwsq_t | xwds_device_get_tik (struct xwds_device *dev) |
XWDS API:获取设备对象的标签 | |
static xwer_t | xwds_device_grab (struct xwds_device *dev) |
XWDS API:增加对象的引用计数 | |
static xwer_t | xwds_device_put (struct xwds_device *dev) |
XWDS API:减少对象的引用计数 | |
static xwsq_t | xwds_device_get_refcnt (struct xwds_device *dev) |
XWDS API:得到对象的引用计数 | |
玄武设备栈:设备基类
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
在文件 device.h 中定义.