diff --git a/core/include/mutex.h b/core/include/mutex.h index 182a3ade0e4e6a9e5167641dc0ccbc0237e870d3..bcf72395b45c7fcb56f191cb1378f08cb0a10efa 100644 --- a/core/include/mutex.h +++ b/core/include/mutex.h @@ -57,10 +57,8 @@ int mutex_lock(struct mutex_t *mutex); * @brief Unlocks the mutex. * * @param mutex Mutex-Object to unlock. - * - * @param yield If yield==MUTEX_YIELD, force context-switch after waking up other waiter. */ -void mutex_unlock(struct mutex_t *mutex, int yield); +void mutex_unlock(struct mutex_t *mutex); #define MUTEX_YIELD 1 #define MUTEX_INISR 2 diff --git a/core/mutex.c b/core/mutex.c index 2ed3c95e2980cd82eff13cd344cb45cfd696c3ea..0def398b49831614b025ba850749cdef98bc7f7e 100644 --- a/core/mutex.c +++ b/core/mutex.c @@ -92,7 +92,7 @@ void mutex_wait(struct mutex_t *mutex) /* we were woken up by scheduler. waker removed us from queue. we have the mutex now. */ } -void mutex_unlock(struct mutex_t *mutex, int yield) +void mutex_unlock(struct mutex_t *mutex) { DEBUG("%s: unlocking mutex. val: %u pid: %u\n", active_thread->name, mutex->val, thread_pid); int irqstate = disableIRQ(); diff --git a/cpu/msp430-common/hwtimer_cpu.c b/cpu/msp430-common/hwtimer_cpu.c index db86fb794fc9838e33fcf7f84c946759c50d3ce7..733aea47d7e3bf84d4bc5678db306ab9b039a739 100644 --- a/cpu/msp430-common/hwtimer_cpu.c +++ b/cpu/msp430-common/hwtimer_cpu.c @@ -66,6 +66,7 @@ unsigned long hwtimer_arch_now() void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) { + (void) fcpu; timerA_init(); int_handler = handler; TA0_enable_interrupt(0); diff --git a/cpu/native/hwtimer_cpu.c b/cpu/native/hwtimer_cpu.c index a92519886bafb3af378153d592ab75d935cba4b1..e72aeac17589660d479c39e3ba0c9d84acd72789 100644 --- a/cpu/native/hwtimer_cpu.c +++ b/cpu/native/hwtimer_cpu.c @@ -244,6 +244,7 @@ void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) { DEBUG("hwtimer_arch_init()\n"); + (void) fcpu; hwtimer_arch_disable_interrupt(); int_handler = handler; diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c index 625d4e21669820570753acc556145f052c16a656..7dfd33884b7bb7884909e958d8b0bb7b8bf8401a 100644 --- a/cpu/native/irq_cpu.c +++ b/cpu/native/irq_cpu.c @@ -294,6 +294,7 @@ void native_irq_handler() */ void native_isr_entry(int sig, siginfo_t *info, void *context) { + (void) info; /* unused at the moment */ DEBUG("\n\n\t\tnative_isr_entry\n\n"); if (native_interrupts_enabled == 0) { diff --git a/drivers/cc110x/cc1100_phy.c b/drivers/cc110x/cc1100_phy.c index 28fc4f76bf362c64cb58caeb817d6497e7a13180..230d33cd212869b23bdf75c26cec3b629c8c6cb0 100644 --- a/drivers/cc110x/cc1100_phy.c +++ b/drivers/cc110x/cc1100_phy.c @@ -219,7 +219,7 @@ void cc1100_phy_mutex_lock(void) void cc1100_phy_mutex_unlock(void) { cc1100_mutex_pid = -1; - mutex_unlock(&cc1100_mutex, 0); + mutex_unlock(&cc1100_mutex); } /*---------------------------------------------------------------------------*/ diff --git a/drivers/sht11/sht11.c b/drivers/sht11/sht11.c index 3fb484848feb4e83cbab4b91040921d978c945a7..0ba69d2543b0e63495ee52c0807e5bbd4f1666f7 100644 --- a/drivers/sht11/sht11.c +++ b/drivers/sht11/sht11.c @@ -347,7 +347,7 @@ uint8_t sht11_read_sensor(sht11_val_t *value, sht11_mode_t mode) /* break on error */ if (error != 0) { connection_reset(); - mutex_unlock(&sht11_mutex, 0); + mutex_unlock(&sht11_mutex); return 0; } @@ -363,7 +363,7 @@ uint8_t sht11_read_sensor(sht11_val_t *value, sht11_mode_t mode) } } - mutex_unlock(&sht11_mutex, 0); + mutex_unlock(&sht11_mutex); return 1; } diff --git a/sys/logd/logd.c b/sys/logd/logd.c index 3350b465b97ceff2a305abb25bfcb5404a450a7b..de5ceb66e24b1aea8cfa183a3ab2add230ba1fe8 100644 --- a/sys/logd/logd.c +++ b/sys/logd/logd.c @@ -117,7 +117,7 @@ static void logd_process(void) free(node); } - mutex_unlock(&log_mutex, 0); + mutex_unlock(&log_mutex); } while (m.type != MSG_EXIT && !exit_flag); @@ -184,7 +184,7 @@ bool logd_log(char *str, int str_len) lq->str[str_len] = '\0'; /* add string termination char at end of buffer */ mutex_lock(&log_mutex); list_append(&log_msg_queue, (list_node_t *) lq); - mutex_unlock(&log_mutex, 0); + mutex_unlock(&log_mutex); m.type = MSG_POLL; m.content.ptr = NULL; msg_send(&m, log_pid, false); diff --git a/sys/net/destiny/socket.c b/sys/net/destiny/socket.c index 50999f101c173920e3b731e3a59d1645a3b5a2cd..7bc674706bd3ae2a6d622417d6edac6d7c28b0bd 100644 --- a/sys/net/destiny/socket.c +++ b/sys/net/destiny/socket.c @@ -529,14 +529,14 @@ int connect(int socket, sockaddr6_t *addr, uint32_t addrlen) current_tcp_socket->tcp_control.rcv_irs = 0; mutex_lock(&global_sequence_clunter_mutex); current_tcp_socket->tcp_control.send_iss = global_sequence_counter; - mutex_unlock(&global_sequence_clunter_mutex, 0); + mutex_unlock(&global_sequence_clunter_mutex); current_tcp_socket->tcp_control.state = SYN_SENT; #ifdef TCP_HC /* Choosing random number Context ID */ mutex_lock(&global_context_counter_mutex); current_tcp_socket->tcp_control.tcp_context.context_id = global_context_counter; - mutex_unlock(&global_context_counter_mutex, 0); + mutex_unlock(&global_context_counter_mutex); current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER; @@ -871,7 +871,7 @@ uint8_t read_from_socket(socket_internal_t *current_int_tcp_socket, current_int_tcp_socket->tcp_input_buffer_end); current_int_tcp_socket->tcp_input_buffer_end = 0; current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += read_bytes; - mutex_unlock(¤t_int_tcp_socket->tcp_buffer_mutex, 0); + mutex_unlock(¤t_int_tcp_socket->tcp_buffer_mutex); return read_bytes; } else { @@ -883,7 +883,7 @@ uint8_t read_from_socket(socket_internal_t *current_int_tcp_socket, current_int_tcp_socket->tcp_input_buffer_end = current_int_tcp_socket->tcp_input_buffer_end - len; current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += len; - mutex_unlock(¤t_int_tcp_socket->tcp_buffer_mutex, 0); + mutex_unlock(¤t_int_tcp_socket->tcp_buffer_mutex); return len; } } @@ -1326,7 +1326,7 @@ socket_internal_t *new_tcp_queued_socket(ipv6_hdr_t *ipv6_header, mutex_lock(&global_sequence_clunter_mutex); current_queued_socket->socket_values.tcp_control.send_iss = global_sequence_counter; - mutex_unlock(&global_sequence_clunter_mutex, 0); + mutex_unlock(&global_sequence_clunter_mutex); current_queued_socket->socket_values.tcp_control.state = SYN_RCVD; set_tcp_cb(¤t_queued_socket->socket_values.tcp_control, tcp_header->seq_nr + 1, STATIC_WINDOW, diff --git a/sys/net/destiny/tcp.c b/sys/net/destiny/tcp.c index b164167dcc10d6772d53fb8086d18fc00c3bab38..4145e4f1cba4ba2a578311af9e5175f4447cea15 100644 --- a/sys/net/destiny/tcp.c +++ b/sys/net/destiny/tcp.c @@ -85,7 +85,7 @@ uint8_t handle_payload(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, tcp_socket->socket_values.tcp_control.rcv_wnd = 0; tcp_socket->tcp_input_buffer_end = tcp_socket->tcp_input_buffer_end + tcp_socket->socket_values.tcp_control.rcv_wnd; - mutex_unlock(&tcp_socket->tcp_buffer_mutex, 0); + mutex_unlock(&tcp_socket->tcp_buffer_mutex); } else { mutex_lock(&tcp_socket->tcp_buffer_mutex); @@ -95,7 +95,7 @@ uint8_t handle_payload(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, acknowledged_bytes = tcp_payload_len; tcp_socket->tcp_input_buffer_end = tcp_socket->tcp_input_buffer_end + tcp_payload_len; - mutex_unlock(&tcp_socket->tcp_buffer_mutex, 0); + mutex_unlock(&tcp_socket->tcp_buffer_mutex); } if (thread_getstatus(tcp_socket->recv_pid) == STATUS_RECEIVE_BLOCKED) { diff --git a/sys/net/destiny/tcp_timer.c b/sys/net/destiny/tcp_timer.c index 6566d8116706e529c2f6a4353d735d8866a67c60..c3861c8c2bd0308a06a516eaf01f985cc7dc224b 100644 --- a/sys/net/destiny/tcp_timer.c +++ b/sys/net/destiny/tcp_timer.c @@ -134,11 +134,11 @@ void inc_global_variables(void) { mutex_lock(&global_sequence_clunter_mutex); global_sequence_counter += rand(); - mutex_unlock(&global_sequence_clunter_mutex, 0); + mutex_unlock(&global_sequence_clunter_mutex); #ifdef TCP_HC mutex_lock(&global_context_counter_mutex); global_context_counter += rand(); - mutex_unlock(&global_context_counter_mutex, 0); + mutex_unlock(&global_context_counter_mutex); #endif } diff --git a/sys/net/sixlowpan/bordermultiplex.c b/sys/net/sixlowpan/bordermultiplex.c index 8601f31ca5964698f0890f847839dfbbcd35b688..af10ebdfb5eb68a138ebe4ca53f7e40cc18862d8 100644 --- a/sys/net/sixlowpan/bordermultiplex.c +++ b/sys/net/sixlowpan/bordermultiplex.c @@ -76,7 +76,7 @@ void demultiplex(border_packet_t *packet, int len) context->context.comp, context->context.lifetime ); - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); abr_add_context(context->context.version, &abr_addr, context->context.cid); /* Send router advertisement */ break; diff --git a/sys/net/sixlowpan/rpl/etx_beaconing.c b/sys/net/sixlowpan/rpl/etx_beaconing.c index 533655bf0693e10765a2983a3600421eb0ce2a39..b2f90f17ba82136d25469ecc85d115785295ab3f 100644 --- a/sys/net/sixlowpan/rpl/etx_beaconing.c +++ b/sys/net/sixlowpan/rpl/etx_beaconing.c @@ -187,7 +187,7 @@ void etx_beacon(void) { } cur_round = 0; } - mutex_unlock(&etx_mutex,0); + mutex_unlock(&etx_mutex); } } @@ -378,7 +378,7 @@ void etx_radio(void) { //handle the beacon mutex_lock(&etx_mutex); etx_handle_beacon(&candidate_addr); - mutex_unlock(&etx_mutex,1); + mutex_unlock(&etx_mutex); } p->processing--; diff --git a/sys/net/sixlowpan/rpl/rpl.c b/sys/net/sixlowpan/rpl/rpl.c index bb6f9b4064c0f7957a51344bec4a17b81b8398e8..d3b425e957aee9e3315a45e58d531443199821cf 100644 --- a/sys/net/sixlowpan/rpl/rpl.c +++ b/sys/net/sixlowpan/rpl/rpl.c @@ -280,7 +280,7 @@ void send_DIO(ipv6_addr_t *destination) if (mydodag == NULL) { DEBUG("Error - trying to send DIO without being part of a dodag.\n"); - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); return; } @@ -321,7 +321,7 @@ void send_DIO(ipv6_addr_t *destination) uint16_t plen = ICMPV6_HDR_LEN + DIO_BASE_LEN + opt_hdr_len; rpl_send(destination, (uint8_t *)icmp_send_buf, plen, PROTO_NUM_ICMPV6, NULL); - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); } void send_DIS(ipv6_addr_t *destination) @@ -337,7 +337,7 @@ void send_DIS(ipv6_addr_t *destination) uint16_t plen = ICMPV6_HDR_LEN + DIS_BASE_LEN; rpl_send(destination, (uint8_t *)icmp_send_buf, plen, PROTO_NUM_ICMPV6, NULL); - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); } @@ -366,7 +366,7 @@ void send_DAO(ipv6_addr_t *destination, uint8_t lifetime, bool default_lifetime, icmp_send_buf->checksum = ~icmpv6_csum(PROTO_NUM_ICMPV6); if (my_dodag == NULL) { - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); return; } @@ -428,7 +428,7 @@ void send_DAO(ipv6_addr_t *destination, uint8_t lifetime, bool default_lifetime, uint16_t plen = ICMPV6_HDR_LEN + DAO_BASE_LEN + opt_len; rpl_send(destination, (uint8_t *)icmp_send_buf, plen, PROTO_NUM_ICMPV6, NULL); - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); if (continue_index > 1) { send_DAO(destination, lifetime, default_lifetime, continue_index); @@ -460,7 +460,7 @@ void send_DAO_ACK(ipv6_addr_t *destination) uint16_t plen = ICMPV6_HDR_LEN + DIS_BASE_LEN; rpl_send(destination, (uint8_t *)icmp_send_buf, plen, PROTO_NUM_ICMPV6, NULL); - mutex_unlock(&rpl_send_mutex, 0); + mutex_unlock(&rpl_send_mutex); } void rpl_process(void) @@ -480,30 +480,30 @@ void rpl_process(void) switch(*code) { case (ICMP_CODE_DIS): { recv_rpl_dis(); - mutex_unlock(&rpl_recv_mutex, 0); + mutex_unlock(&rpl_recv_mutex); break; } case (ICMP_CODE_DIO): { recv_rpl_dio(); - mutex_unlock(&rpl_recv_mutex, 0); + mutex_unlock(&rpl_recv_mutex); break; } case (ICMP_CODE_DAO): { recv_rpl_dao(); - mutex_unlock(&rpl_recv_mutex, 0); + mutex_unlock(&rpl_recv_mutex); break; } case (ICMP_CODE_DAO_ACK): { recv_rpl_dao_ack(); - mutex_unlock(&rpl_recv_mutex, 0); + mutex_unlock(&rpl_recv_mutex); break; } default: - mutex_unlock(&rpl_recv_mutex, 0); + mutex_unlock(&rpl_recv_mutex); break; } } diff --git a/sys/net/sixlowpan/semaphore.c b/sys/net/sixlowpan/semaphore.c index d44b3925bce6eb69927b52e8dce12f2e63f35a72..67ac13ca1dece33517dc35dc8f2f115699aa1376 100644 --- a/sys/net/sixlowpan/semaphore.c +++ b/sys/net/sixlowpan/semaphore.c @@ -47,7 +47,7 @@ int sem_signal(sem_t *sem) { if (++(sem->value) > 0 && sem->locked) { sem->locked = !(sem->locked); - mutex_unlock(&(sem->mutex), 0); + mutex_unlock(&(sem->mutex)); } return 0; diff --git a/sys/net/sixlowpan/sixlowmac.c b/sys/net/sixlowpan/sixlowmac.c index cf05a90cf28e2ce9c63d8d0b241a431ecd7e2a83..36f77d6579844b925063d3ed74c66f8070a8cfc3 100644 --- a/sys/net/sixlowpan/sixlowmac.c +++ b/sys/net/sixlowpan/sixlowmac.c @@ -208,7 +208,7 @@ void send_ieee802154_frame(ieee_802154_long_t *addr, uint8_t *payload, memcpy(&buf[hdrlen], frame.payload, frame.payload_len); /* mutex unlock */ - mutex_unlock(&buf_mutex, 0); + mutex_unlock(&buf_mutex); p.length = hdrlen + frame.payload_len; diff --git a/sys/net/sixlowpan/sixlownd.c b/sys/net/sixlowpan/sixlownd.c index 652e8c2018dbc8daa4659a2620133269ccffb836..32abce272eda657577123ddd3cfba9bc99674ff7 100644 --- a/sys/net/sixlowpan/sixlownd.c +++ b/sys/net/sixlowpan/sixlownd.c @@ -423,7 +423,7 @@ void init_rtr_adv(ipv6_addr_t *addr, uint8_t sllao, uint8_t mtu, uint8_t pi, free(contexts); } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); } if (pi == OPT_PI) { @@ -617,7 +617,7 @@ void recv_rtr_adv(void) } } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); if (trigger_ns >= 0) { /* send ns - draft-ietf-6lowpan-nd-15#section-5.5.1 diff --git a/sys/net/sixlowpan/sixlowpan.c b/sys/net/sixlowpan/sixlowpan.c index c557a72d348dfa17baeb59adf919edaf426ee4f3..7c6ac128e243a0b8caca584efdf7eaf0ffbe4275 100644 --- a/sys/net/sixlowpan/sixlowpan.c +++ b/sys/net/sixlowpan/sixlowpan.c @@ -234,7 +234,7 @@ void lowpan_transfer(void) current_buf = packet_fifo; if (current_buf != NULL) { - mutex_unlock(&fifo_mutex, 0); + mutex_unlock(&fifo_mutex); if ((current_buf->packet)[0] == LOWPAN_IPV6_DISPATCH) { ipv6_buf = get_ipv6_buf(); @@ -263,7 +263,7 @@ void lowpan_transfer(void) if (gotosleep == 1) { - mutex_unlock(&fifo_mutex, 0); + mutex_unlock(&fifo_mutex); thread_sleep(); } } @@ -450,7 +450,7 @@ lowpan_reas_buf_t *collect_garbage_fifo(lowpan_reas_buf_t *current_buf) return_buf = my_buf->next; } - mutex_unlock(&fifo_mutex, 0); + mutex_unlock(&fifo_mutex); current_list = current_buf->interval_list_head; temp_list = current_list; @@ -610,7 +610,7 @@ void add_fifo_packet(lowpan_reas_buf_t *current_packet) my_buf->next = current_packet; } - mutex_unlock(&fifo_mutex, 0); + mutex_unlock(&fifo_mutex); current_packet->next = NULL; } @@ -973,7 +973,7 @@ void lowpan_iphc_encoding(ieee_802154_long_t *dest, ipv6_hdr_t *ipv6_buf_extra, } } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); comp_buf[0] = lowpan_iphc[0]; comp_buf[1] = lowpan_iphc[1]; @@ -1160,7 +1160,7 @@ void lowpan_iphc_decoding(uint8_t *data, uint8_t length, } } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); } else { switch(((lowpan_iphc[1] & LOWPAN_IPHC_SAM) >> 4) & 0x03) { @@ -1223,7 +1223,7 @@ void lowpan_iphc_decoding(uint8_t *data, uint8_t length, } // TODO: - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); } else { /* If M=1 and DAC=0: */ @@ -1326,7 +1326,7 @@ void lowpan_iphc_decoding(uint8_t *data, uint8_t length, break; } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); } else { switch((lowpan_iphc[1] & LOWPAN_IPHC_DAM) & 0x03) { @@ -1487,7 +1487,7 @@ void lowpan_context_auto_remove(void) lowpan_context_remove(to_remove[i]); } - mutex_unlock(&lowpan_context_mutex, 0); + mutex_unlock(&lowpan_context_mutex); } } diff --git a/sys/vtimer/vtimer.c b/sys/vtimer/vtimer.c index f4299a28390201633f8b9301030851b63b93f352..4b6176f21cb2ca00b29e7acb5ac6eaad2248ab21 100644 --- a/sys/vtimer/vtimer.c +++ b/sys/vtimer/vtimer.c @@ -79,6 +79,7 @@ static int update_shortterm(void) void vtimer_tick(void *ptr) { + (void) ptr; DEBUG("vtimer_tick()."); seconds += SECONDS_PER_TICK; @@ -111,6 +112,7 @@ static int set_shortterm(vtimer_t *timer) void vtimer_callback(void *ptr) { + (void) ptr; vtimer_t *timer; in_callback = true; hwtimer_id = -1;