WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_device

函数

void osal_pm_lowpower_enter (void)
 Invoke the low-power callback function of all devices.
 
void osal_pm_lowpower_exit (void)
 Invoke the low-power-exit callback function of all devices.
 
osal_devosal_dev_create (const char *name)
 Returns a pointer of the osal_dev type for which memory is applied.
 
int osal_dev_destroy (osal_dev *dev)
 Free the dev's memory.
 
int osal_dev_register (osal_dev *dev)
 register device.
 
void osal_dev_unregister (osal_dev *dev)
 unregister device.
 
void osal_device_set_async (unsigned int minor)
 Set the device to wake up asynchronously.
 
void osal_poll_wait (osal_poll *table, osal_wait *wait)
 Adds the current process to the wait list specified by the wait parameter.
 
void osal_notify_poll (osal_wait *wait)
 Wakes up the current process from the wait list specified by the wait parameter.
 
int osal_remap_pfn_range (osal_vm *vm, unsigned long addr, unsigned long pfn, unsigned long size)
 remap kernel memory to userspace.
 
int osal_try_to_freeze (void)
 try to freeze the current task.
 
int osal_set_freezable (void)
 make current task freezable and try to freeze the current task.
 
int osal_kobject_uevent_env (osal_dev *dev, osal_kobject_action action, char *envp[])
 send an uevent with environmental data.
 
int osal_fasync_helper (int fd, void *filp, int mode, void **fapp)
 Setting up the character device driver's fasync queue.
 
void osal_fasync_notify (void **fapp, int sig, int band)
 Send asynchronous notifications.
 
void osal_pgprot_noncached (osal_vm *vm)
 get nocached prot_page.
 
void osal_pgprot_cached (osal_vm *vm)
 get cached prot_page.
 
void osal_pgprot_writecombine (osal_vm *vm)
 get writecombine prot_page.
 
void osal_smccc_smc (const osal_smccc_info *info, osal_smccc_res *res)
 make SMC calls.
 
int osal_opendev (const char *path, int flag,...)
 open_device.
 
int osal_closedev (int fd)
 close device.
 
int osal_readdev (int fd, void *buf, unsigned long count)
 read device.
 
int osal_writedev (int fd, const void *buf, unsigned long count)
 write device.
 
int osal_ioctldev (int fd, unsigned int cmd,...)
 Perform other operations on the device.
 
int osal_init (void)
 osal linux userspace init.
 
void osal_exit (void)
 osal linux userspace exit.
 

详细描述

函数说明

◆ osal_closedev()

int osal_closedev ( int  fd)

close device.

Description:
Call the callback function release given by caller.
返回
OSAL_SUCCESS/OSAL_FAILURE
Support System:
linux(userspace).

◆ osal_dev_create()

osal_dev * osal_dev_create ( const char *  name)

Returns a pointer of the osal_dev type for which memory is applied.

注意
Must be freed with osal_dev_destroy.
参数
name[in] The name of device.
返回
Pointer to osal_dev.
Support System:
linux liteos freertos.

◆ osal_dev_destroy()

int osal_dev_destroy ( osal_dev dev)

Free the dev's memory.

Description:
Free the dev's memory that created by osal_dev_create.
参数
dev[in] The result of osal_dev_create.
注意
this api may free dev,it should be from osal_dev_create.caller should set NULL to dev after call api
返回
OSAL_SUCCESS/OSAL_FAILURE
Support System:
linux liteos freertos.

◆ osal_dev_register()

int osal_dev_register ( osal_dev dev)

register device.

注意
The input pool parameter must be created by func osal_dev_create.
返回
OSAL_SUCCESS/OSAL_FAILURE
Support System:
linux liteos freertos.

◆ osal_dev_unregister()

void osal_dev_unregister ( osal_dev dev)

unregister device.

注意
The input pool parameter must be created by func osal_dev_create.
Support System:
linux liteos freertos.

◆ osal_device_set_async()

void osal_device_set_async ( unsigned int  minor)

Set the device to wake up asynchronously.

Description:
Set the device to wake up asynchronously.
参数
minor[in] The minor of device.
Support System:
linux.

◆ osal_exit()

void osal_exit ( void  )

osal linux userspace exit.

Description:
osal linux userspace exit.
Support System:
linux(userspace).

◆ osal_fasync_helper()

int osal_fasync_helper ( int  fd,
void *  filp,
int  mode,
void **  fapp 
)

Setting up the character device driver's fasync queue.

Description:
Setting up the character device driver's fasync queue.
返回
It returns negative on error, 0 if it did no changes and positive if it added/deleted the entry.
Support System:
linux.

◆ osal_fasync_notify()

void osal_fasync_notify ( void **  fapp,
int  sig,
int  band 
)

Send asynchronous notifications.

Description:
The SIGIO signal is sent to the application layer, and the application layer triggers the function corresponding to the SIGIO signal.
Support System:
linux.

◆ osal_init()

int osal_init ( void  )

osal linux userspace init.

Description:
osal linux userspace init.
返回
OSAL_SUCCESS/OSAL_FAILURE
Support System:
linux(userspace).

◆ osal_ioctldev()

int osal_ioctldev ( int  fd,
unsigned int  cmd,
  ... 
)

Perform other operations on the device.

Description:
Call the callback function osal_ioctl_cmd->handler given by caller.
返回
return the callback functon's return value, or -1 when fd is incorrect.
Support System:
linux(userspace).

◆ osal_kobject_uevent_env()

int osal_kobject_uevent_env ( osal_dev dev,
osal_kobject_action  action,
char *  envp[] 
)

send an uevent with environmental data.

返回
Returns 0 if kobject_uevent_env() is completed with success or the corresponding error when it fails.
Support System:
linux liteos.

◆ osal_notify_poll()

void osal_notify_poll ( osal_wait wait)

Wakes up the current process from the wait list specified by the wait parameter.

Support System:
liteos.

◆ osal_opendev()

int osal_opendev ( const char *  path,
int  flag,
  ... 
)

open_device.

Description:
Invoke the callback function open set by the caller.
返回
return the device file's fd.
Support System:
linux(userspace).

◆ osal_pgprot_cached()

void osal_pgprot_cached ( osal_vm vm)

get cached prot_page.

Description:
get cached prot_page.
Support System:
linux.

◆ osal_pgprot_noncached()

void osal_pgprot_noncached ( osal_vm vm)

get nocached prot_page.

Description:
get nocached prot_page.
Support System:
linux.

◆ osal_pgprot_writecombine()

void osal_pgprot_writecombine ( osal_vm vm)

get writecombine prot_page.

Description:
get writecombine prot_page.
Support System:
linux.

◆ osal_pm_lowpower_enter()

void osal_pm_lowpower_enter ( void  )

Invoke the low-power callback function of all devices.

Description:
Invoke the low-power callback function of all devices,
Support System:
linux.

◆ osal_pm_lowpower_exit()

void osal_pm_lowpower_exit ( void  )

Invoke the low-power-exit callback function of all devices.

Description:
Invoke the low-power-exit callback function of all devices.
Support System:
linux.

◆ osal_poll_wait()

void osal_poll_wait ( osal_poll table,
osal_wait wait 
)

Adds the current process to the wait list specified by the wait parameter.

Support System:
linux liteos.

◆ osal_readdev()

int osal_readdev ( int  fd,
void *  buf,
unsigned long  count 
)

read device.

Description:
Call the callback function read given by caller.
返回
return the callback functon's return value, or -1 when fd is incorrect.
Support System:
linux(userspace).

◆ osal_remap_pfn_range()

int osal_remap_pfn_range ( osal_vm vm,
unsigned long  addr,
unsigned long  pfn,
unsigned long  size 
)

remap kernel memory to userspace.

返回
The value 0 indicates success, and other values indicate failure.
Support System:
linux liteos.

◆ osal_set_freezable()

int osal_set_freezable ( void  )

make current task freezable and try to freeze the current task.

返回
True is returned for success and false is returned for failure.
Support System:
linux liteos.

◆ osal_smccc_smc()

void osal_smccc_smc ( const osal_smccc_info info,
osal_smccc_res res 
)

make SMC calls.

Description:
This function is used to make SMC calls following SMC Calling Convention.
Support System:
linux.

◆ osal_try_to_freeze()

int osal_try_to_freeze ( void  )

try to freeze the current task.

返回
True is returned for success and false is returned for failure.
Support System:
linux liteos.

◆ osal_writedev()

int osal_writedev ( int  fd,
const void *  buf,
unsigned long  count 
)

write device.

Description:
Call the callback function write given by caller.
返回
return the callback functon's return value, or -1 when fd is incorrect.
Support System:
linux(userspace).