Changeset b16e77d in mainline
- Timestamp:
- 2012-06-01T19:14:43Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50ad3f3
- Parents:
- 1038a9c
- Location:
- uspace/srv/bd
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r1038a9c rb16e77d 191 191 } 192 192 193 printf( NAME ": Accepting connections\n");193 printf("%s: Accepting connections\n", NAME); 194 194 task_retval(0); 195 195 async_manager(); … … 243 243 static int ata_bd_init(void) 244 244 { 245 async_set_client_connection(ata_bd_connection); 246 int rc = loc_server_register(NAME); 247 if (rc != EOK) { 248 printf("%s: Unable to register driver.\n", NAME); 249 return rc; 250 } 251 245 252 void *vaddr; 246 int rc;247 248 async_set_client_connection(ata_bd_connection);249 rc = loc_server_register(NAME);250 if (rc < 0) {251 printf(NAME ": Unable to register driver.\n");252 return rc;253 }254 255 253 rc = pio_enable((void *) cmd_physical, sizeof(ata_cmd_t), &vaddr); 256 254 if (rc != EOK) { 257 printf( NAME ": Could not initialize device I/O space.\n");255 printf("%s: Could not initialize device I/O space.\n", NAME); 258 256 return rc; 259 257 } 260 258 261 259 cmd = vaddr; 262 260 263 261 rc = pio_enable((void *) ctl_physical, sizeof(ata_ctl_t), &vaddr); 264 262 if (rc != EOK) { 265 printf( NAME ": Could not initialize device I/O space.\n");263 printf("%s: Could not initialize device I/O space.\n", NAME); 266 264 return rc; 267 265 } 268 266 269 267 ctl = vaddr; 270 271 268 272 269 return EOK; 273 270 } -
uspace/srv/bd/file_bd/file_bd.c
r1038a9c rb16e77d 119 119 rc = loc_service_register(device_name, &service_id); 120 120 if (rc != EOK) { 121 printf( NAME ": Unable to register device '%s'.\n",122 121 printf("%s: Unable to register device '%s'.\n", 122 NAME, device_name); 123 123 return rc; 124 124 } 125 126 printf( NAME ": Accepting connections\n");125 126 printf("%s: Accepting connections\n", NAME); 127 127 task_retval(0); 128 128 async_manager(); 129 129 130 130 /* Not reached */ 131 131 return 0; … … 139 139 static int file_bd_init(const char *fname) 140 140 { 141 int rc;142 long img_size;143 144 141 async_set_client_connection(file_bd_connection); 145 rc = loc_server_register(NAME);146 if (rc < 0) {147 printf( NAME ": Unable to register driver.\n");142 int rc = loc_server_register(NAME); 143 if (rc != EOK) { 144 printf("%s: Unable to register driver.\n", NAME); 148 145 return rc; 149 146 } 150 147 151 148 img = fopen(fname, "rb+"); 152 149 if (img == NULL) 153 150 return EINVAL; 154 151 155 152 if (fseek(img, 0, SEEK_END) != 0) { 156 153 fclose(img); 157 154 return EIO; 158 155 } 159 160 img_size = ftell(img);156 157 off64_t img_size = ftell(img); 161 158 if (img_size < 0) { 162 159 fclose(img); 163 160 return EIO; 164 161 } 165 162 166 163 num_blocks = img_size / block_size; 167 164 168 165 fibril_mutex_initialize(&dev_lock); 169 166 170 167 return EOK; 171 168 } -
uspace/srv/bd/gxe_bd/gxe_bd.c
r1038a9c rb16e77d 122 122 static int gxe_bd_init(void) 123 123 { 124 async_set_client_connection(gxe_bd_connection); 125 int rc = loc_server_register(NAME); 126 if (rc != EOK) { 127 printf("%s: Unable to register driver.\n", NAME); 128 return rc; 129 } 130 124 131 void *vaddr; 125 int rc, i;126 char name[16];127 128 async_set_client_connection(gxe_bd_connection);129 rc = loc_server_register(NAME);130 if (rc < 0) {131 printf(NAME ": Unable to register driver.\n");132 return rc;133 }134 135 132 rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr); 136 133 if (rc != EOK) { 137 printf( NAME ": Could not initialize device I/O space.\n");134 printf("%s: Could not initialize device I/O space.\n", NAME); 138 135 return rc; 139 136 } 140 137 141 138 dev = vaddr; 142 143 for (i = 0; i < MAX_DISKS; i++) { 144 snprintf(name, 16, "%s/disk%d", NAMESPACE, i); 139 140 for (unsigned int i = 0; i < MAX_DISKS; i++) { 141 char name[16]; 142 143 snprintf(name, 16, "%s/disk%u", NAMESPACE, i); 145 144 rc = loc_service_register(name, &service_id[i]); 146 145 if (rc != EOK) { 147 printf(NAME ": Unable to register device %s.\n", name); 146 printf("%s: Unable to register device %s.\n", NAME, 147 name); 148 148 return rc; 149 149 } 150 150 151 fibril_mutex_initialize(&dev_lock[i]); 151 152 } 152 153 153 154 return EOK; 154 155 } -
uspace/srv/bd/part/guid_part/guid_part.c
r1038a9c rb16e77d 170 170 return rc; 171 171 } 172 172 173 173 /* 174 174 * Create partition devices. -
uspace/srv/bd/rd/rd.c
r1038a9c rb16e77d 237 237 async_set_client_connection(rd_connection); 238 238 ret = loc_server_register(NAME); 239 if (ret < 0) {239 if (ret != EOK) { 240 240 printf("%s: Unable to register driver (%d)\n", NAME, ret); 241 241 return false;
Note:
See TracChangeset
for help on using the changeset viewer.