Changeset b7fd2a0 in mainline for uspace/srv/bd/rd/rd.c
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/rd/rd.c
r36f0738 rb7fd2a0 67 67 static const size_t block_size = 512; 68 68 69 static int rd_open(bd_srvs_t *, bd_srv_t *);70 static int rd_close(bd_srv_t *);71 static int rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);72 static int rd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);73 static int rd_get_block_size(bd_srv_t *, size_t *);74 static int rd_get_num_blocks(bd_srv_t *, aoff64_t *);69 static errno_t rd_open(bd_srvs_t *, bd_srv_t *); 70 static errno_t rd_close(bd_srv_t *); 71 static errno_t rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 72 static errno_t rd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t); 73 static errno_t rd_get_block_size(bd_srv_t *, size_t *); 74 static errno_t rd_get_num_blocks(bd_srv_t *, aoff64_t *); 75 75 76 76 /** This rwlock protects the ramdisk's data. … … 100 100 101 101 /** Open device. */ 102 static int rd_open(bd_srvs_t *bds, bd_srv_t *bd)102 static errno_t rd_open(bd_srvs_t *bds, bd_srv_t *bd) 103 103 { 104 104 return EOK; … … 106 106 107 107 /** Close device. */ 108 static int rd_close(bd_srv_t *bd)108 static errno_t rd_close(bd_srv_t *bd) 109 109 { 110 110 return EOK; … … 112 112 113 113 /** Read blocks from the device. */ 114 static int rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,114 static errno_t rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf, 115 115 size_t size) 116 116 { … … 128 128 129 129 /** Write blocks to the device. */ 130 static int rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,130 static errno_t rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, 131 131 const void *buf, size_t size) 132 132 { … … 147 147 { 148 148 sysarg_t size; 149 int ret = sysinfo_get_value("rd.size", &size);149 errno_t ret = sysinfo_get_value("rd.size", &size); 150 150 if ((ret != EOK) || (size == 0)) { 151 151 printf("%s: No RAM disk found\n", NAME); … … 197 197 198 198 /** Get device block size. */ 199 static int rd_get_block_size(bd_srv_t *bd, size_t *rsize)199 static errno_t rd_get_block_size(bd_srv_t *bd, size_t *rsize) 200 200 { 201 201 *rsize = block_size; … … 204 204 205 205 /** Get number of blocks on device. */ 206 static int rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)206 static errno_t rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 207 207 { 208 208 *rnb = rd_size / block_size;
Note:
See TracChangeset
for help on using the changeset viewer.