custom message for SHMGET
[minix3.git] / include / minix / bdev.h
blob0aca2887a42d9a2651e83d698642bfc4c63a2c66
1 #ifndef _MINIX_BDEV_H
2 #define _MINIX_BDEV_H
4 /* Common API. */
5 extern void bdev_driver(dev_t dev, char *label);
7 /* Synchronous API. */
8 extern int bdev_open(dev_t dev, int access);
9 extern int bdev_close(dev_t dev);
11 extern ssize_t bdev_read(dev_t dev, u64_t pos, char *buf, size_t count,
12 int flags);
13 extern ssize_t bdev_write(dev_t dev, u64_t pos, char *buf, size_t count,
14 int flags);
15 extern ssize_t bdev_gather(dev_t dev, u64_t pos, iovec_t *vec, int count,
16 int flags);
17 extern ssize_t bdev_scatter(dev_t dev, u64_t pos, iovec_t *vec, int count,
18 int flags);
19 extern int bdev_ioctl(dev_t dev, int request, void *buf,
20 endpoint_t user_endpt);
22 /* Asynchronous API. */
23 typedef int bdev_id_t;
24 typedef void *bdev_param_t;
26 typedef void (*bdev_callback_t)(dev_t dev, bdev_id_t id, bdev_param_t param,
27 int result);
29 extern void bdev_flush_asyn(dev_t dev);
31 extern bdev_id_t bdev_read_asyn(dev_t dev, u64_t pos, char *buf, size_t count,
32 int flags, bdev_callback_t callback, bdev_param_t param);
33 extern bdev_id_t bdev_write_asyn(dev_t dev, u64_t pos, char *buf, size_t count,
34 int flags, bdev_callback_t callback, bdev_param_t param);
35 extern bdev_id_t bdev_gather_asyn(dev_t dev, u64_t pos, iovec_t *vec,
36 int count, int flags, bdev_callback_t callback, bdev_param_t param);
37 extern bdev_id_t bdev_scatter_asyn(dev_t dev, u64_t pos, iovec_t *vec,
38 int count, int flags, bdev_callback_t callback, bdev_param_t param);
39 extern bdev_id_t bdev_ioctl_asyn(dev_t dev, int request, void *buf,
40 endpoint_t user_endpt, bdev_callback_t callback, bdev_param_t param);
42 extern int bdev_wait_asyn(bdev_id_t id);
44 extern void bdev_reply_asyn(message *m);
46 #endif /* _MINIX_BDEV_H */