Changeset 135486d in mainline for uspace/srv/bd
- Timestamp:
- 2012-08-15T14:44:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- affaf2e, b546231
- Parents:
- 4802dd7
- Location:
- uspace/srv/bd
- Files:
-
- 9 edited
-
ata_bd/ata_bd.c (modified) (5 diffs)
-
ata_bd/ata_bd.h (modified) (1 diff)
-
file_bd/file_bd.c (modified) (4 diffs)
-
gxe_bd/gxe_bd.c (modified) (5 diffs)
-
part/guid_part/guid_part.c (modified) (5 diffs)
-
part/mbr_part/mbr_part.c (modified) (5 diffs)
-
rd/rd.c (modified) (3 diffs)
-
sata_bd/sata_bd.c (modified) (4 diffs)
-
sata_bd/sata_bd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r4802dd7 r135486d 104 104 static void ata_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *); 105 105 106 static int ata_bd_open(bd_srv _t *);106 static int ata_bd_open(bd_srvs_t *, bd_srv_t *); 107 107 static int ata_bd_close(bd_srv_t *); 108 108 static int ata_bd_read_blocks(bd_srv_t *, uint64_t ba, size_t cnt, void *buf, … … 146 146 static disk_t *bd_srv_disk(bd_srv_t *bd) 147 147 { 148 return (disk_t *)bd-> arg;148 return (disk_t *)bd->srvs->sarg; 149 149 } 150 150 … … 312 312 } 313 313 314 bd_conn(iid, icall, &ata_disk[disk_id].bd );314 bd_conn(iid, icall, &ata_disk[disk_id].bds); 315 315 } 316 316 … … 336 336 fibril_mutex_initialize(&d->lock); 337 337 338 bd_srv _init(&d->bd);339 d->bd .ops = &ata_bd_ops;340 d->bd .arg = d;338 bd_srvs_init(&d->bds); 339 d->bds.ops = &ata_bd_ops; 340 d->bds.sarg = d; 341 341 342 342 /* Try identify command. */ … … 467 467 } 468 468 469 static int ata_bd_open(bd_srv _t *bd)469 static int ata_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 470 470 { 471 471 return EOK; -
uspace/srv/bd/ata_bd/ata_bd.h
r4802dd7 r135486d 119 119 service_id_t service_id; 120 120 int disk_id; 121 bd_srv _t bd;121 bd_srvs_t bds; 122 122 } disk_t; 123 123 -
uspace/srv/bd/file_bd/file_bd.c
r4802dd7 r135486d 62 62 63 63 static service_id_t service_id; 64 static bd_srv _t bd_srv;64 static bd_srvs_t bd_srvs; 65 65 static fibril_mutex_t dev_lock; 66 66 … … 69 69 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *); 70 70 71 static int file_bd_open(bd_srv _t *);71 static int file_bd_open(bd_srvs_t *, bd_srv_t *); 72 72 static int file_bd_close(bd_srv_t *); 73 73 static int file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 154 154 static int file_bd_init(const char *fname) 155 155 { 156 bd_srv _init(&bd_srv);157 bd_srv .ops = &file_bd_ops;156 bd_srvs_init(&bd_srvs); 157 bd_srvs.ops = &file_bd_ops; 158 158 159 159 async_set_client_connection(file_bd_connection); … … 188 188 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 189 189 { 190 bd_conn(iid, icall, &bd_srv );190 bd_conn(iid, icall, &bd_srvs); 191 191 } 192 192 193 193 /** Open device. */ 194 static int file_bd_open(bd_srv _t *bd)194 static int file_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 195 195 { 196 196 return EOK; -
uspace/srv/bd/gxe_bd/gxe_bd.c
r4802dd7 r135486d 88 88 /** GXE block device soft state */ 89 89 typedef struct { 90 /** Block device serv erstructure */91 bd_srv _t bd;90 /** Block device service structure */ 91 bd_srvs_t bds; 92 92 int disk_id; 93 93 } gxe_bd_t; … … 109 109 static int gxe_bd_write_block(int disk_id, uint64_t ba, const void *buf); 110 110 111 static int gxe_bd_open(bd_srv _t *);111 static int gxe_bd_open(bd_srvs_t *, bd_srv_t *); 112 112 static int gxe_bd_close(bd_srv_t *); 113 113 static int gxe_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 127 127 static gxe_bd_t *bd_srv_gxe(bd_srv_t *bd) 128 128 { 129 return (gxe_bd_t *)bd-> arg;129 return (gxe_bd_t *)bd->srvs->sarg; 130 130 } 131 131 … … 166 166 char name[16]; 167 167 168 bd_srv _init(&gxe_bd[i].bd);169 gxe_bd[i].bd .ops = &gxe_bd_ops;170 gxe_bd[i].bd .arg = (void *)&gxe_bd[i];168 bd_srvs_init(&gxe_bd[i].bds); 169 gxe_bd[i].bds.ops = &gxe_bd_ops; 170 gxe_bd[i].bds.sarg = (void *)&gxe_bd[i]; 171 171 172 172 snprintf(name, 16, "%s/disk%u", NAMESPACE, i); … … 203 203 } 204 204 205 bd_conn(iid, icall, &gxe_bd[disk_id].bd );205 bd_conn(iid, icall, &gxe_bd[disk_id].bds); 206 206 } 207 207 208 208 /** Open device. */ 209 static int gxe_bd_open(bd_srv _t *bd)209 static int gxe_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 210 210 { 211 211 return EOK; -
uspace/srv/bd/part/guid_part/guid_part.c
r4802dd7 r135486d 83 83 /** Service representing the partition (outbound device) */ 84 84 service_id_t dsid; 85 /** Block device serv erstructure */86 bd_srv _t bd;85 /** Block device service structure */ 86 bd_srvs_t bds; 87 87 /** Points to next partition structure. */ 88 88 struct part *next; … … 104 104 static int gpt_bsa_translate(part_t *p, aoff64_t ba, size_t cnt, aoff64_t *gba); 105 105 106 static int gpt_bd_open(bd_srv _t *);106 static int gpt_bd_open(bd_srvs_t *, bd_srv_t *); 107 107 static int gpt_bd_close(bd_srv_t *); 108 108 static int gpt_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 122 122 static part_t *bd_srv_part(bd_srv_t *bd) 123 123 { 124 return (part_t *)bd-> arg;124 return (part_t *)bd->srvs->sarg; 125 125 } 126 126 … … 325 325 } 326 326 327 bd_srv _init(&part->bd);328 part->bd .ops = &gpt_bd_ops;329 part->bd .arg = part;327 bd_srvs_init(&part->bds); 328 part->bds.ops = &gpt_bd_ops; 329 part->bds.sarg = part; 330 330 331 331 part->dsid = 0; … … 357 357 assert(part->present == true); 358 358 359 bd_conn(iid, icall, &part->bd );359 bd_conn(iid, icall, &part->bds); 360 360 } 361 361 362 362 /** Open device. */ 363 static int gpt_bd_open(bd_srv _t *bd)363 static int gpt_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 364 364 { 365 365 return EOK; -
uspace/srv/bd/part/mbr_part/mbr_part.c
r4802dd7 r135486d 100 100 /** Device representing the partition (outbound device) */ 101 101 service_id_t dsid; 102 /** Block device serv er structure */103 bd_srv _t bd;102 /** Block device service sturcture */ 103 bd_srvs_t bds; 104 104 /** Points to next partition structure. */ 105 105 struct part *next; … … 154 154 static int mbr_bsa_translate(part_t *p, uint64_t ba, size_t cnt, uint64_t *gba); 155 155 156 static int mbr_bd_open(bd_srv _t *);156 static int mbr_bd_open(bd_srvs_t *, bd_srv_t *); 157 157 static int mbr_bd_close(bd_srv_t *); 158 158 static int mbr_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 172 172 static part_t *bd_srv_part(bd_srv_t *bd) 173 173 { 174 return (part_t *)bd-> arg;174 return (part_t *)bd->srvs->sarg; 175 175 } 176 176 … … 402 402 part->present = (pte->ptype != PT_UNUSED) ? true : false; 403 403 404 bd_srv _init(&part->bd);405 part->bd .ops = &mbr_bd_ops;406 part->bd .arg = part;404 bd_srvs_init(&part->bds); 405 part->bds.ops = &mbr_bd_ops; 406 part->bds.sarg = part; 407 407 408 408 part->dsid = 0; … … 433 433 434 434 assert(part->present == true); 435 bd_conn(iid, icall, &part->bd );435 bd_conn(iid, icall, &part->bds); 436 436 } 437 437 438 438 /** Open device. */ 439 static int mbr_bd_open(bd_srv _t *bd)439 static int mbr_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 440 440 { 441 441 return EOK; -
uspace/srv/bd/rd/rd.c
r4802dd7 r135486d 68 68 static const size_t block_size = 512; 69 69 70 static int rd_open(bd_srv _t *);70 static int rd_open(bd_srvs_t *, bd_srv_t *); 71 71 static int rd_close(bd_srv_t *); 72 72 static int rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 93 93 }; 94 94 95 static bd_srv _t bd_srv;95 static bd_srvs_t bd_srvs; 96 96 97 97 static void rd_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 98 98 { 99 bd_conn(iid, icall, &bd_srv );99 bd_conn(iid, icall, &bd_srvs); 100 100 } 101 101 102 102 /** Open device. */ 103 static int rd_open(bd_srv _t *bd)103 static int rd_open(bd_srvs_t *bds, bd_srv_t *bd) 104 104 { 105 105 return EOK; … … 175 175 (void *) addr_phys, size); 176 176 177 bd_srv _init(&bd_srv);178 bd_srv .ops = &rd_bd_ops;177 bd_srvs_init(&bd_srvs); 178 bd_srvs.ops = &rd_bd_ops; 179 179 180 180 async_set_client_connection(rd_client_conn); -
uspace/srv/bd/sata_bd/sata_bd.c
r4802dd7 r135486d 57 57 static int disk_count; 58 58 59 static int sata_bd_open(bd_srv _t *);59 static int sata_bd_open(bd_srvs_t *, bd_srv_t *); 60 60 static int sata_bd_close(bd_srv_t *); 61 61 static int sata_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); … … 75 75 static sata_bd_dev_t *bd_srv_sata(bd_srv_t *bd) 76 76 { 77 return (sata_bd_dev_t *)bd-> arg;77 return (sata_bd_dev_t *)bd->srvs->sarg; 78 78 } 79 79 … … 104 104 ahci_get_num_blocks(disk[disk_count].sess, &disk[disk_count].blocks); 105 105 106 bd_srv _init(&disk[disk_count].bd);107 disk[disk_count].bd .ops = &sata_bd_ops;108 disk[disk_count].bd .arg = &disk[disk_count];106 bd_srvs_init(&disk[disk_count].bds); 107 disk[disk_count].bds.ops = &sata_bd_ops; 108 disk[disk_count].bds.sarg = &disk[disk_count]; 109 109 110 110 printf("Device %s - %s , blocks: %lu, block_size: %lu\n", … … 183 183 } 184 184 185 bd_conn(iid, icall, &disk[disk_id].bd );185 bd_conn(iid, icall, &disk[disk_id].bds); 186 186 } 187 187 188 188 /** Open device. */ 189 static int sata_bd_open(bd_srv _t *bd)189 static int sata_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 190 190 { 191 191 return EOK; -
uspace/srv/bd/sata_bd/sata_bd.h
r4802dd7 r135486d 58 58 size_t block_size; 59 59 /** Block device server structure */ 60 bd_srv _t bd;60 bd_srvs_t bds; 61 61 } sata_bd_dev_t; 62 62
Note:
See TracChangeset
for help on using the changeset viewer.
