Rev 4534 | Rev 4557 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4534 | Rev 4545 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | static dev_handle_t dev_handle; |
58 | static dev_handle_t dev_handle; |
59 | static atomic_t dev_futex = FUTEX_INITIALIZER; |
59 | static atomic_t dev_futex = FUTEX_INITIALIZER; |
60 | 60 | ||
61 | static int file_bd_init(const char *fname); |
61 | static int file_bd_init(const char *fname); |
62 | static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall); |
62 | static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall); |
63 | static int file_bd_read(off_t blk_idx, off_t size, void *buf); |
63 | static int file_bd_read(off_t blk_idx, size_t size, void *buf); |
64 | static int file_bd_write(off_t blk_idx, off_t size, void *buf); |
64 | static int file_bd_write(off_t blk_idx, size_t size, void *buf); |
65 | 65 | ||
66 | int main(int argc, char **argv) |
66 | int main(int argc, char **argv) |
67 | { |
67 | { |
68 | int rc; |
68 | int rc; |
69 | 69 | ||
Line 116... | Line 116... | ||
116 | ipc_call_t call; |
116 | ipc_call_t call; |
117 | ipcarg_t method; |
117 | ipcarg_t method; |
118 | int flags; |
118 | int flags; |
119 | int retval; |
119 | int retval; |
120 | off_t idx; |
120 | off_t idx; |
121 | off_t size; |
121 | size_t size; |
122 | 122 | ||
123 | /* Answer the IPC_M_CONNECT_ME_TO call. */ |
123 | /* Answer the IPC_M_CONNECT_ME_TO call. */ |
124 | ipc_answer_0(iid, EOK); |
124 | ipc_answer_0(iid, EOK); |
125 | 125 | ||
126 | if (!ipc_share_out_receive(&callid, &comm_size, &flags)) { |
126 | if (!ipc_share_out_receive(&callid, &comm_size, &flags)) { |
Line 163... | Line 163... | ||
163 | } |
163 | } |
164 | ipc_answer_0(callid, retval); |
164 | ipc_answer_0(callid, retval); |
165 | } |
165 | } |
166 | } |
166 | } |
167 | 167 | ||
168 | static int file_bd_read(off_t blk_idx, off_t size, void *buf) |
168 | static int file_bd_read(off_t blk_idx, size_t size, void *buf) |
169 | { |
169 | { |
170 | size_t n_rd; |
170 | size_t n_rd; |
171 | 171 | ||
172 | printf("file_bd_read\n"); |
172 | printf("file_bd_read\n"); |
173 | futex_down(&dev_futex); |
173 | futex_down(&dev_futex); |
Line 191... | Line 191... | ||
191 | return EINVAL; /* Read beyond end of disk */ |
191 | return EINVAL; /* Read beyond end of disk */ |
192 | 192 | ||
193 | return EOK; |
193 | return EOK; |
194 | } |
194 | } |
195 | 195 | ||
196 | static int file_bd_write(off_t blk_idx, off_t size, void *buf) |
196 | static int file_bd_write(off_t blk_idx, size_t size, void *buf) |
197 | { |
197 | { |
198 | size_t n_wr; |
198 | size_t n_wr; |
199 | 199 | ||
200 | futex_down(&dev_futex); |
200 | futex_down(&dev_futex); |
201 | 201 |