59184481c057f48714d3c07faf99969e0907a7ee
[FUZIX.git] / Kernel / dev / devrd.h
1 #ifndef __DEVRD_DOT_H__
2 #define __DEVRD_DOT_H__
3
4 /* minor device numbers */
5 #define RD_MINOR_ROM     0
6 #define RD_MINOR_RAM     1
7 #define NUM_DEV_RD       2
8
9 /* public interface */
10 int rd_open(uint8_t minor, uint16_t flags);
11 int rd_read(uint8_t minor, uint8_t rawflag, uint8_t flag);
12 int rd_write(uint8_t minor, uint8_t rawflag, uint8_t flag);
13 int rd_transfer(uint8_t minor, uint8_t rawflag, uint8_t flag);
14
15 #ifdef DEVRD_PRIVATE
16 /* The basic operation supported by devrd_hw is a memory copy
17  * Source is expressed as:
18  *   rd_src_address   -- 32-bit absolute address in physical memory
19  * Destination is expressed as:
20  *   rd_dst_userspace -- boolean, false: process memory (userspace), true: kernel memory
21  *   rd_dst_address   -- 16-bit address in target memory space
22  * Size and direction expressed as:
23  *   rd_cpy_count     -- number of bytes to copy
24  *   rd_reverse       -- reverse direction of the copy operation, ie dst->src rather than src->dst
25  */
26
27 extern uint32_t rd_src_address;
28 extern uint16_t rd_dst_address;
29 extern bool     rd_dst_userspace;
30 extern uint16_t rd_cpy_count;
31 extern uint8_t  rd_reverse;      /* reverse the copy direction: false=read, true=write */
32 void rd_platform_copy(void);     /* platform code provides this function */
33 #endif
34
35 #endif /* __DEVRD_DOT_H__ */