Changeset 3bacee1 in mainline for uspace/srv
- Timestamp:
- 2018-04-12T16:27:17Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- uspace/srv
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_data.c
r76d0981d r3bacee1 103 103 * @return valid pointer to data link structure, NULL on failure. 104 104 */ 105 static inline audio_data_link_t * 105 static inline audio_data_link_t *audio_data_link_list_instance(link_t *l) 106 106 { 107 107 return l ? list_get_instance(l, audio_data_link_t, link) : NULL; … … 144 144 * @return pointer to the beginning of data buffer. 145 145 */ 146 static inline const void * 146 static inline const void *audio_data_link_start(audio_data_link_t *alink) 147 147 { 148 148 assert(alink); -
uspace/srv/audio/hound/hound_ctx.c
r76d0981d r3bacee1 209 209 fibril_mutex_lock(&stream->guard); 210 210 if (stream->allowed_size && 211 (audio_pipe_bytes(&stream->fifo) + adata->size 212 >stream->allowed_size)) {211 (audio_pipe_bytes(&stream->fifo) + adata->size > 212 stream->allowed_size)) { 213 213 fibril_mutex_unlock(&stream->guard); 214 214 return EOVERFLOW; … … 246 246 */ 247 247 hound_ctx_stream_t *hound_ctx_create_stream(hound_ctx_t *ctx, int flags, 248 248 pcm_format_t format, size_t buffer_size) 249 249 { 250 250 assert(ctx); … … 308 308 while (stream->allowed_size && 309 309 (audio_pipe_bytes(&stream->fifo) + size > stream->allowed_size)) { 310 310 fibril_condvar_wait(&stream->change, &stream->guard); 311 311 312 312 } … … 336 336 fibril_mutex_lock(&stream->guard); 337 337 while (audio_pipe_bytes(&stream->fifo) < size) { 338 338 fibril_condvar_wait(&stream->change, &stream->guard); 339 339 } 340 340 … … 466 466 if (ret != EOK) 467 467 log_error("Failed to push data to stream: %s", 468 468 str_error(ret)); 469 469 } 470 470 audio_data_unref(adata); -
uspace/srv/fs/cdfs/cdfs_ops.c
r76d0981d r3bacee1 282 282 typedef struct { 283 283 service_id_t service_id; 284 284 fs_index_t index; 285 285 } ht_key_t; 286 286 287 287 static size_t nodes_key_hash(void *k) 288 288 { 289 ht_key_t *key = (ht_key_t *)k;289 ht_key_t *key = (ht_key_t *)k; 290 290 return hash_combine(key->service_id, key->index); 291 291 } … … 300 300 { 301 301 cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link); 302 ht_key_t *key = (ht_key_t *)k;302 ht_key_t *key = (ht_key_t *)k; 303 303 304 304 return key->service_id == node->fs->service_id && key->index == node->index; … … 1208 1208 static bool rm_service_id_nodes(ht_link_t *item, void *arg) 1209 1209 { 1210 service_id_t service_id = *(service_id_t *)arg;1210 service_id_t service_id = *(service_id_t *)arg; 1211 1211 cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link); 1212 1212 … … 1345 1345 static bool cache_remove_closed(ht_link_t *item, void *arg) 1346 1346 { 1347 size_t *premove_cnt = (size_t *)arg;1347 size_t *premove_cnt = (size_t *)arg; 1348 1348 1349 1349 /* Some nodes were requested to be removed from the cache. */ -
uspace/srv/hid/input/input.c
r76d0981d r3bacee1 308 308 /* Mutual exclusion of active clients */ 309 309 list_foreach(clients, link, client_t, client) 310 310 client->active = ((active) && (client == active_client)); 311 311 312 312 /* Notify clients about the arbitration */ -
uspace/srv/hid/output/port/kfb.c
r76d0981d r3bacee1 490 490 size_t word_size = sizeof(unsigned long); 491 491 492 if (((word_size % kfb.pixel_bytes) == 0) 493 && ((FONT_WIDTH * kfb.pixel_bytes) % word_size == 0)494 && ((vp->x * kfb.pixel_bytes) % word_size == 0)495 &&(kfb.scanline % word_size == 0))492 if (((word_size % kfb.pixel_bytes) == 0) && 493 ((FONT_WIDTH * kfb.pixel_bytes) % word_size == 0) && 494 ((vp->x * kfb.pixel_bytes) % word_size == 0) && 495 (kfb.scanline % word_size == 0)) 496 496 kfb_vp->draw_char = draw_char_aligned; 497 497 else -
uspace/srv/loader/main.c
r76d0981d r3bacee1 145 145 } 146 146 147 char *name = malloc(namesize);147 char *name = malloc(namesize); 148 148 errno_t rc = async_data_write_finalize(write_chandle, name, namesize); 149 149 if (rc != EOK) { … … 248 248 } 249 249 250 char *name = malloc(namesize);250 char *name = malloc(namesize); 251 251 errno_t rc = async_data_write_finalize(write_chandle, name, namesize); 252 252 if (rc != EOK) { -
uspace/srv/locsrv/locsrv.c
r76d0981d r3bacee1 217 217 218 218 list_foreach(services_list, services, loc_service_t, service) { 219 if ((str_cmp(service->namespace->name, ns_name) == 0) 220 &&(str_cmp(service->name, name) == 0))219 if ((str_cmp(service->namespace->name, ns_name) == 0) && 220 (str_cmp(service->name, name) == 0)) 221 221 return service; 222 222 } -
uspace/srv/net/dnsrsrv/dns_msg.c
r76d0981d r3bacee1 383 383 question->qtype = dns_uint16_t_decode(pdu->data + name_eoff, 384 384 pdu->size - name_eoff); 385 question->qclass = dns_uint16_t_decode(pdu->data + sizeof(uint16_t) 386 +name_eoff, pdu->size - sizeof(uint16_t) - name_eoff);385 question->qclass = dns_uint16_t_decode(pdu->data + sizeof(uint16_t) + 386 name_eoff, pdu->size - sizeof(uint16_t) - name_eoff); 387 387 *eoff = name_eoff + 2 * sizeof(uint16_t); 388 388 … … 449 449 450 450 log_msg(LOG_DEFAULT, LVL_DEBUG2, "dns_rr_decode: rtype=0x%x, rclass=0x%x, ttl=0x%x", 451 rr->rtype, rr->rclass, rr->ttl 451 rr->rtype, rr->rclass, rr->ttl); 452 452 453 453 rdlength = dns_uint16_t_decode(bp, bsz); … … 510 510 (msg->rd ? BIT_V(uint16_t, OPB_RD) : 0) | 511 511 (msg->ra ? BIT_V(uint16_t, OPB_RA) : 0) | 512 msg->rcode 513 ); 512 msg->rcode); 514 513 515 514 hdr.qd_count = host2uint16_t_be(list_count(&msg->question)); -
uspace/srv/net/ethip/pdu.c
r76d0981d r3bacee1 124 124 125 125 switch (packet->opcode) { 126 case aop_request: fopcode = AOP_REQUEST; break; 127 case aop_reply: fopcode = AOP_REPLY; break; 126 case aop_request: 127 fopcode = AOP_REQUEST; 128 break; 129 case aop_reply: 130 fopcode = AOP_REPLY; 131 break; 128 132 default: 129 133 assert(false); … … 187 191 188 192 switch (uint16_t_be2host(pfmt->opcode)) { 189 case AOP_REQUEST: packet->opcode = aop_request; break; 190 case AOP_REPLY: packet->opcode = aop_reply; break; 193 case AOP_REQUEST: 194 packet->opcode = aop_request; 195 break; 196 case AOP_REPLY: 197 packet->opcode = aop_reply; 198 break; 191 199 default: 192 200 log_msg(LOG_DEFAULT, LVL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")", -
uspace/srv/net/inetsrv/pdu.c
r76d0981d r3bacee1 72 72 73 73 for (i = 0; i < words; i++) { 74 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];74 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 75 75 sum = inet_ocadd16(sum, w); 76 76 } 77 77 78 78 if (size % 2 != 0) { 79 w = ((uint16_t)bdata[2 *words] << 8);79 w = ((uint16_t)bdata[2 * words] << 8); 80 80 sum = inet_ocadd16(sum, w); 81 81 } -
uspace/srv/net/slip/slip.c
r76d0981d r3bacee1 284 284 */ 285 285 286 pass:286 pass: 287 287 rc = iplink_ev_recv(&slip_iplink, &sdu, ip_v4); 288 288 if (rc != EOK) { … … 374 374 if (rc != EOK) { 375 375 log_msg(LOG_DEFAULT, LVL_ERROR, 376 "Failed to register service %s",377 linkstr);376 "Failed to register service %s", 377 linkstr); 378 378 goto fail; 379 379 } -
uspace/srv/net/tcp/conn.c
r76d0981d r3bacee1 156 156 157 157 /* Initialize retransmission queue */ 158 if (tcp_tqueue_init(&conn->retransmit, conn, &tcp_conn_tqueue_cb) 159 !=EOK) {158 if (tcp_tqueue_init(&conn->retransmit, conn, &tcp_conn_tqueue_cb) != 159 EOK) { 160 160 goto error; 161 161 } -
uspace/srv/net/tcp/inet.c
r76d0981d r3bacee1 97 97 if (hdr_size < sizeof(tcp_header_t)) { 98 98 log_msg(LOG_DEFAULT, LVL_WARN, "hdr_size = %zu < sizeof(tcp_header_t) = %zu", 99 hdr_size, sizeof(tcp_header_t)); return EINVAL; 99 hdr_size, sizeof(tcp_header_t)); 100 return EINVAL; 100 101 } 101 102 -
uspace/srv/net/tcp/pdu.c
r76d0981d r3bacee1 73 73 74 74 for (i = 0; i < words; i++) { 75 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];75 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 76 76 sum = tcp_ocadd16(sum, w); 77 77 } 78 78 79 79 if (size % 2 != 0) { 80 w = ((uint16_t)bdata[2 *words] << 8);80 w = ((uint16_t)bdata[2 * words] << 8); 81 81 sum = tcp_ocadd16(sum, w); 82 82 } -
uspace/srv/net/tcp/seq_no.c
r76d0981d r3bacee1 170 170 171 171 /* Beginning of segment is inside window */ 172 b_in = seq_no_le_lt(conn->rcv_nxt, seg->seq, conn->rcv_nxt 173 +conn->rcv_wnd);172 b_in = seq_no_le_lt(conn->rcv_nxt, seg->seq, conn->rcv_nxt + 173 conn->rcv_wnd); 174 174 175 175 /* End of segment is inside window */ -
uspace/srv/net/tcp/test/conn.c
r76d0981d r3bacee1 139 139 140 140 while (conn->cstate == st_syn_sent) 141 141 fibril_condvar_wait(&conn->cstate_cv, &conn->lock); 142 142 143 143 PCUT_ASSERT_INT_EQUALS(st_closed, conn->cstate); … … 194 194 /* Wait for client-side state to transition */ 195 195 while (cconn->cstate == st_syn_sent) 196 196 fibril_condvar_wait(&cconn->cstate_cv, &cconn->lock); 197 197 198 198 PCUT_ASSERT_INT_EQUALS(st_established, cconn->cstate); … … 203 203 tcp_conn_lock(sconn); 204 204 while (sconn->cstate == st_listen || sconn->cstate == st_syn_received) 205 205 fibril_condvar_wait(&sconn->cstate_cv, &sconn->lock); 206 206 207 207 PCUT_ASSERT_INT_EQUALS(st_established, sconn->cstate); -
uspace/srv/net/tcp/test/rqueue.c
r76d0981d r3bacee1 107 107 seg_cnt = 0; 108 108 109 109 inet_ep2_init(&epp); 110 110 111 111 tcp_rqueue_fibril_start(); -
uspace/srv/net/tcp/test/seq_no.c
r76d0981d r3bacee1 130 130 conn->rcv_wnd = (uint32_t) -10; 131 131 132 PCUT_ASSERT_FALSE(seq_no_in_rcv_wnd(conn, 19));132 PCUT_ASSERT_FALSE(seq_no_in_rcv_wnd(conn, 19)); 133 133 PCUT_ASSERT_TRUE(seq_no_in_rcv_wnd(conn, 20)); 134 134 PCUT_ASSERT_TRUE(seq_no_in_rcv_wnd(conn, 21)); -
uspace/srv/net/udp/pdu.c
r76d0981d r3bacee1 72 72 73 73 for (i = 0; i < words; i++) { 74 w = ((uint16_t)bdata[2 *i] << 8) | bdata[2*i + 1];74 w = ((uint16_t)bdata[2 * i] << 8) | bdata[2 * i + 1]; 75 75 sum = udp_ocadd16(sum, w); 76 76 } 77 77 78 78 if (size % 2 != 0) { 79 w = ((uint16_t)bdata[2 *words] << 8);79 w = ((uint16_t)bdata[2 * words] << 8); 80 80 sum = udp_ocadd16(sum, w); 81 81 } -
uspace/srv/vfs/vfs_register.c
r76d0981d r3bacee1 382 382 fstypes->size = size; 383 383 384 size = 0; count = 0; 384 size = 0; 385 count = 0; 385 386 list_foreach(fs_list, fs_link, fs_info_t, fs) { 386 387 l = str_size(fs->vfs_info.name) + 1;
Note:
See TracChangeset
for help on using the changeset viewer.