9#ifndef __OSAL_DEVICE_H__
10#define __OSAL_DEVICE_H__
20#define OSAL_POLLIN 0x0001U
21#define OSAL_POLLPRI 0x0002U
22#define OSAL_POLLOUT 0x0004U
23#define OSAL_POLLERR 0x0008U
24#define OSAL_POLLHUP 0x0010U
25#define OSAL_POLLNVAL 0x0020U
26#define OSAL_POLLRDNORM 0x0040U
27#define OSAL_POLLRDBAND 0x0080U
28#define OSAL_POLLWRNORM 0x0100U
37 int (*
handler)(
unsigned int cmd,
void *arg,
void *private_data);
45 int (*
open)(
void *private_data);
46 int (*
read)(
char *buf,
int size,
long *offset,
void *private_data);
47 int (*
write)(
const char *buf,
int size,
long *offset,
void *private_data);
48 long (*
llseek)(
long offset,
int whence,
void *private_data);
51 int (*
mmap)(
osal_vm *vm,
unsigned long start,
unsigned long end,
unsigned long vm_pgoff,
void *private_data);
52 int (*
fasync)(
int fd,
void *filp,
int mode);
67#define OSAL_DEV_NAME_LEN 32
void osal_fasync_notify(void **fapp, int sig, int band)
Send asynchronous notifications.
void osal_pm_lowpower_enter(void)
Invoke the low-power callback function of all devices.
void osal_pgprot_noncached(osal_vm *vm)
get nocached prot_page.
void osal_pm_lowpower_exit(void)
Invoke the low-power-exit callback function of all devices.
int osal_kobject_uevent_env(osal_dev *dev, osal_kobject_action action, char *envp[])
send an uevent with environmental data.
void osal_device_set_async(unsigned int minor)
Set the device to wake up asynchronously.
int osal_closedev(int fd)
close device.
int osal_writedev(int fd, const void *buf, unsigned long count)
write device.
int osal_fasync_helper(int fd, void *filp, int mode, void **fapp)
Setting up the character device driver's fasync queue.
void osal_pgprot_writecombine(osal_vm *vm)
get writecombine prot_page.
osal_dev * osal_dev_create(const char *name)
Returns a pointer of the osal_dev type for which memory is applied.
int osal_try_to_freeze(void)
try to freeze the current task.
void osal_notify_poll(osal_wait *wait)
Wakes up the current process from the wait list specified by the wait parameter.
int osal_ioctldev(int fd, unsigned int cmd,...)
Perform other operations on the device.
void osal_pgprot_cached(osal_vm *vm)
get cached prot_page.
int osal_dev_destroy(osal_dev *dev)
Free the dev's memory.
int osal_remap_pfn_range(osal_vm *vm, unsigned long addr, unsigned long pfn, unsigned long size)
remap kernel memory to userspace.
void osal_smccc_smc(const osal_smccc_info *info, osal_smccc_res *res)
make SMC calls.
int osal_set_freezable(void)
make current task freezable and try to freeze the current task.
int osal_dev_register(osal_dev *dev)
register device.
void osal_dev_unregister(osal_dev *dev)
unregister device.
int osal_readdev(int fd, void *buf, unsigned long count)
read device.
int osal_init(void)
osal linux userspace init.
int osal_opendev(const char *path, int flag,...)
open_device.
void osal_exit(void)
osal linux userspace exit.
void osal_poll_wait(osal_poll *table, osal_wait *wait)
Adds the current process to the wait list specified by the wait parameter.
struct osal_ioctl_cmd_ osal_ioctl_cmd
#define OSAL_DEV_NAME_LEN
Definition osal_device.h:67
osal_kobject_action_
Definition osal_device.h:81
@ OSAL_KOBJ_BIND
Definition osal_device.h:88
@ OSAL_KOBJ_UNBIND
Definition osal_device.h:89
@ OSAL_KOBJ_REMOVE
Definition osal_device.h:83
@ OSAL_KOBJ_OFFLINE
Definition osal_device.h:87
@ OSAL_KOBJ_CHANGE
Definition osal_device.h:84
@ OSAL_KOBJ_ADD
Definition osal_device.h:82
@ OSAL_KOBJ_MAX
Definition osal_device.h:90
@ OSAL_KOBJ_ONLINE
Definition osal_device.h:86
@ OSAL_KOBJ_MOVE
Definition osal_device.h:85
struct osal_fileops_ osal_fileops
struct osal_dev_ osal_dev
enum osal_kobject_action_ osal_kobject_action
struct osal_pmops_ osal_pmops
struct osal_poll_ osal_poll
Definition osal_device.h:68
void * owner
Definition osal_device.h:75
osal_fileops * fops
Definition osal_device.h:72
char name[32]
Definition osal_device.h:69
unsigned int parent_minor
Definition osal_device.h:71
void * dev
Definition osal_device.h:74
osal_pmops * pmops
Definition osal_device.h:73
int minor
Definition osal_device.h:70
Definition osal_device.h:44
int(* mmap)(osal_vm *vm, unsigned long start, unsigned long end, unsigned long vm_pgoff, void *private_data)
Definition osal_device.h:51
int(* release)(void *private_data)
Definition osal_device.h:49
int(* read)(char *buf, int size, long *offset, void *private_data)
Definition osal_device.h:46
long(* llseek)(long offset, int whence, void *private_data)
Definition osal_device.h:48
int(* open)(void *private_data)
Definition osal_device.h:45
int(* fasync)(int fd, void *filp, int mode)
Definition osal_device.h:52
unsigned int cmd_cnt
Definition osal_device.h:54
unsigned int(* poll)(osal_poll *osal_poll, void *private_data)
Definition osal_device.h:50
int(* write)(const char *buf, int size, long *offset, void *private_data)
Definition osal_device.h:47
osal_ioctl_cmd * cmd_list
Definition osal_device.h:53
Definition osal_device.h:35
unsigned int cmd
Definition osal_device.h:36
int(* handler)(unsigned int cmd, void *arg, void *private_data)
Definition osal_device.h:37
Definition osal_device.h:57
int(* pm_lowpower_exit)(void *private_data)
Definition osal_device.h:62
int(* pm_poweroff)(void *private_data)
Definition osal_device.h:63
int(* pm_resume_early)(void *private_data)
Definition osal_device.h:59
int(* pm_resume)(void *private_data)
Definition osal_device.h:60
int(* pm_lowpower_enter)(void *private_data)
Definition osal_device.h:61
int(* pm_suspend)(void *private_data)
Definition osal_device.h:58
void * private_data
Definition osal_device.h:64
Definition osal_device.h:30
void * data
Definition osal_device.h:32
void * poll_table
Definition osal_device.h:31
Definition osal_device.h:312
unsigned long a4
Definition osal_device.h:317
unsigned long a0
Definition osal_device.h:313
unsigned long a3
Definition osal_device.h:316
unsigned long a7
Definition osal_device.h:320
unsigned long a5
Definition osal_device.h:318
unsigned long a1
Definition osal_device.h:314
unsigned long a6
Definition osal_device.h:319
unsigned long a2
Definition osal_device.h:315
Definition osal_device.h:323
unsigned long a2
Definition osal_device.h:326
unsigned long a3
Definition osal_device.h:327
unsigned long a0
Definition osal_device.h:324
unsigned long a1
Definition osal_device.h:325
Definition osal_device.h:40
void * vm
Definition osal_device.h:41
Definition osal_wait.h:21