orca-software
device.h
1 #define SEEK_SET 0
2 #define SEEK_CUR 1
3 #define SEEK_END 2
4 
5 struct device {
6  int32_t (*dev_open)(uint32_t flags);
7  int32_t (*dev_read)(void *buf, uint32_t size); /* size is ignored for block devices */
8  int32_t (*dev_write)(void *buf, uint32_t size);
9  int32_t (*dev_close)(void);
10  int32_t (*dev_ioctl)(uint32_t request, void *pval);
11  void *ptr; /* pointer to device specific data
12  (e.g struct fs_blkdevice, struct blk_device
13  or struct chr_device) */
14 };
15 
16 int32_t hf_dev_open(struct device *dev, uint32_t flags);
17 int32_t hf_dev_read(struct device *dev, void *buf, uint32_t size);
18 int32_t hf_dev_write(struct device *dev, void *buf, uint32_t size);
19 int32_t hf_dev_close(struct device *dev);
20 int32_t hf_dev_ioctl(struct device *dev, uint32_t request, void *pval);
Definition: device.h:5