Changes in uspace/srv/bd/rd/rd.c [b7fd2a0:1558d85] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/rd/rd.c
rb7fd2a0 r1558d85 48 48 #include <stdbool.h> 49 49 #include <errno.h> 50 #include <str_error.h>51 50 #include <async.h> 52 51 #include <fibril_synch.h> … … 67 66 static const size_t block_size = 512; 68 67 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 *);68 static int rd_open(bd_srvs_t *, bd_srv_t *); 69 static int rd_close(bd_srv_t *); 70 static int rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 71 static int rd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t); 72 static int rd_get_block_size(bd_srv_t *, size_t *); 73 static int rd_get_num_blocks(bd_srv_t *, aoff64_t *); 75 74 76 75 /** This rwlock protects the ramdisk's data. … … 100 99 101 100 /** Open device. */ 102 static errno_t rd_open(bd_srvs_t *bds, bd_srv_t *bd)101 static int rd_open(bd_srvs_t *bds, bd_srv_t *bd) 103 102 { 104 103 return EOK; … … 106 105 107 106 /** Close device. */ 108 static errno_t rd_close(bd_srv_t *bd)107 static int rd_close(bd_srv_t *bd) 109 108 { 110 109 return EOK; … … 112 111 113 112 /** Read blocks from the device. */ 114 static errno_t rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,113 static int rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf, 115 114 size_t size) 116 115 { … … 128 127 129 128 /** Write blocks to the device. */ 130 static errno_t rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,129 static int rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, 131 130 const void *buf, size_t size) 132 131 { … … 147 146 { 148 147 sysarg_t size; 149 errno_t ret = sysinfo_get_value("rd.size", &size);148 int ret = sysinfo_get_value("rd.size", &size); 150 149 if ((ret != EOK) || (size == 0)) { 151 150 printf("%s: No RAM disk found\n", NAME); … … 180 179 ret = loc_server_register(NAME); 181 180 if (ret != EOK) { 182 printf("%s: Unable to register driver : %s\n", NAME, str_error(ret));181 printf("%s: Unable to register driver (%d)\n", NAME, ret); 183 182 return false; 184 183 } … … 197 196 198 197 /** Get device block size. */ 199 static errno_t rd_get_block_size(bd_srv_t *bd, size_t *rsize)198 static int rd_get_block_size(bd_srv_t *bd, size_t *rsize) 200 199 { 201 200 *rsize = block_size; … … 204 203 205 204 /** Get number of blocks on device. */ 206 static errno_t rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)205 static int rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 207 206 { 208 207 *rnb = rd_size / block_size;
Note:
See TracChangeset
for help on using the changeset viewer.