Skip to content

Commit

Permalink
Fixed to be compilable with current changes in storm.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlun committed Aug 23, 2015
1 parent 66cc98e commit 41f245b
Showing 1 changed file with 13 additions and 25 deletions.
38 changes: 13 additions & 25 deletions servers/network/ipv4/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void interface_add(ipv4_interface_type *interface,
mutex_wait(interface_list_mutex);
entry->next = (struct ipv4_interface_list_type *) interface_list;
interface_list = entry;
mutex_signal(interface_list_mutex);
mutex_signal(&interface_list_mutex);
}

/* Get the interface matching the given identification. */
Expand All @@ -83,14 +83,14 @@ static ipv4_interface_type *interface_get(char *identification)
{
if (string_compare(entry->interface->identification, identification) == 0)
{
mutex_signal(interface_list_mutex);
mutex_signal(&interface_list_mutex);
return entry->interface;
}

entry = (ipv4_interface_list_type *) entry->next;
}

mutex_signal(interface_list_mutex);
mutex_signal(&interface_list_mutex);

return NULL;
}
Expand All @@ -111,7 +111,7 @@ static unsigned int interface_get_amount(void)
entry = (ipv4_interface_list_type *) entry->next;
}

mutex_signal(interface_list_mutex);
mutex_signal(&interface_list_mutex);

return counter;
}
Expand All @@ -132,7 +132,7 @@ static ipv4_interface_type *interface_get_number(unsigned int number)
entry = (ipv4_interface_list_type *) entry->next;
}

mutex_signal(interface_list_mutex);
mutex_signal(&interface_list_mutex);
if (entry == NULL)
{
return NULL;
Expand Down Expand Up @@ -211,8 +211,10 @@ void ipv4_header_create(u32 destination_address, u32 source_address,

/* Handle an IPC connection request. */

static void handle_connection(mailbox_id_type reply_mailbox_id)
static void handle_connection(mailbox_id_type *reply_mailbox_id)
{
system_thread_name_set("Handling connection");

message_parameter_type message_parameter;
ipc_structure_type ipc_structure;
bool done = FALSE;
Expand All @@ -224,7 +226,7 @@ static void handle_connection(mailbox_id_type reply_mailbox_id)

/* Accept the connection. */

ipc_structure.output_mailbox_id = reply_mailbox_id;
ipc_structure.output_mailbox_id = *reply_mailbox_id;
ipc_connection_establish(&ipc_structure);

while (!done)
Expand Down Expand Up @@ -482,7 +484,7 @@ static void handle_connection(mailbox_id_type reply_mailbox_id)

/* Handle the connection to the ethernet service. */

static bool handle_ethernet(mailbox_id_type mailbox_id)
static bool handle_ethernet(mailbox_id_type *mailbox_id)
{
ipc_structure_type *ethernet_structure;
ipc_structure_type **ethernet_structure_pointer = &ethernet_structure;
Expand All @@ -506,7 +508,7 @@ static bool handle_ethernet(mailbox_id_type mailbox_id)

/* Connect to the ethernet service. */

ethernet_structure->output_mailbox_id = mailbox_id;
ethernet_structure->output_mailbox_id = *mailbox_id;
if (ipc_service_connection_request(ethernet_structure) !=
IPC_RETURN_SUCCESS)
{
Expand Down Expand Up @@ -682,17 +684,7 @@ int main(void)
{
// system_sleep (2000);

if (system_thread_create() == SYSTEM_RETURN_THREAD_NEW)
{
if (handle_ethernet(mailbox_id[index]))
{
return 0;
}
else
{
return -1;
}
}
system_thread_create((thread_entry_point_type *) handle_ethernet, &mailbox_id[index]);
}
}

Expand All @@ -719,11 +711,7 @@ int main(void)
ipc_service_connection_wait(&ipc_structure);
reply_mailbox_id = ipc_structure.output_mailbox_id;

if (system_thread_create() == SYSTEM_RETURN_THREAD_NEW)
{
system_thread_name_set("Handling connection");
handle_connection(reply_mailbox_id);
}
system_thread_create((thread_entry_point_type *) handle_connection, &reply_mailbox_id);
}

return 0;
Expand Down

0 comments on commit 41f245b

Please sign in to comment.