Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milestone 1 0 fixes #90

Merged
merged 7 commits into from
Aug 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ifneq (,$(findstring uart0,$(USEMODULE)))
endif

ifneq (,$(findstring cc110x,$(USEMODULE)))
ifeq (,$(findstring protocol-multiplex,$(USEMODULE)))
USEMODULE += protocol-multiplex
ifeq (,$(findstring protocol_multiplex,$(USEMODULE)))
USEMODULE += protocol_multiplex
endif
endif

Expand Down
4 changes: 1 addition & 3 deletions core/include/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions core/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* @ingroup kernel_msg
* @{
* @file
* @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
* @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @}
*/

Expand Down Expand Up @@ -80,6 +82,7 @@ int msg_send(msg_t *m, unsigned int target_pid, bool block)
queue_node_t n;
n.priority = active_thread->priority;
n.data = (unsigned int) active_thread;
n.next = NULL;
DEBUG("%s: Adding node to msg_waiters:\n", active_thread->name);

queue_priority_add(&(target->msg_waiters), &n);
Expand Down
2 changes: 1 addition & 1 deletion core/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions cpu/msp430-common/hwtimer_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions cpu/native/hwtimer_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions cpu/native/irq_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/cc110x/cc1100_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*---------------------------------------------------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions drivers/sht11/sht11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ endif
ifneq (,$(findstring net_help,$(USEMODULE)))
DIRS += net/net_help
endif
ifneq (,$(findstring protocol-multiplex,$(USEMODULE)))
ifneq (,$(findstring protocol_multiplex,$(USEMODULE)))
DIRS += net/protocol-multiplex
endif
ifneq (,$(findstring sixlowpan,$(USEMODULE)))
DIRS += net/sixlowpan
endif
ifneq (,$(findstring rpl,$(USEMODULE)))
DIRS += net/sixlowpan/rpl
DIRS += net/rpl
endif
ifneq (,$(findstring ieee802154,$(USEMODULE)))
DIRS += net/ieee802154
Expand Down
4 changes: 2 additions & 2 deletions sys/logd/logd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions sys/net/destiny/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(&current_int_tcp_socket->tcp_buffer_mutex, 0);
mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex);
return read_bytes;
}
else {
Expand All @@ -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(&current_int_tcp_socket->tcp_buffer_mutex, 0);
mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex);
return len;
}
}
Expand Down Expand Up @@ -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(&current_queued_socket->socket_values.tcp_control,
tcp_header->seq_nr + 1, STATIC_WINDOW,
Expand Down
4 changes: 2 additions & 2 deletions sys/net/destiny/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions sys/net/destiny/tcp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion sys/net/protocol-multiplex/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
MODULE:=protocol_multiplex
INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include

include $(RIOTBASE)/Makefile.base
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void etx_beacon(void) {
}
cur_round = 0;
}
mutex_unlock(&etx_mutex,0);
mutex_unlock(&etx_mutex);
}
}

Expand Down Expand Up @@ -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--;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
*/
#define ETX_RANK_MULTIPLIER (0x80)

rpl_of_t *rpl_get_of_mrhof();
rpl_of_t *rpl_get_of_mrhof(void);
22 changes: 11 additions & 11 deletions sys/net/sixlowpan/rpl/rpl.c → sys/net/rpl/rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand All @@ -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);
}


Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -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;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ typedef struct rpl_of_t {
void (*reset)(rpl_dodag_t *);
void (*parent_state_callback)(rpl_parent_t *, int, int);
void (*init) (void); //OF specific init function
void (*process_dio) (); //DIO processing callback (acc. to OF0 spec, chpt 5)
void (*process_dio) (void); //DIO processing callback (acc. to OF0 spec, chpt 5)
} rpl_of_t;

typedef struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <math.h>
#include "inttypes.h"
#include "trickle.h"
#include "sixlowpan/rpl/rpl.h"
#include "rpl/rpl.h"

//TODO in pointer umwandeln, speicher mit malloc holen
char * timer_over_buf;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion sys/net/sixlowpan/bordermultiplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/sixlowpan/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/sixlowpan/sixlowmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading