1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 23:41:18 +01:00

Merge pull request #3390 from thomaseichinger/pr/fix_warning_errors_freebsd

native: fix warning errors freebsd
This commit is contained in:
Thomas Eichinger 2015-07-23 10:11:29 +02:00
commit e416937398
3 changed files with 9 additions and 8 deletions

View File

@ -25,6 +25,10 @@
#ifndef NATIVENET_H
#define NATIVENET_H
#if defined(__FreeBSD__)
#include <sys/types.h>
#endif
#include <net/ethernet.h>
#include "radio/types.h"

View File

@ -96,7 +96,7 @@ void thread_print_stack(void)
char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stacksize)
{
unsigned int *stk;
char *stk;
ucontext_t *p;
VALGRIND_STACK_REGISTER(stack_start, (char *) stack_start + stacksize);
@ -104,16 +104,10 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
DEBUG("thread_stack_init\n");
stk = (unsigned int *)stack_start;
stk = stack_start;
#ifdef NATIVESPONTOP
p = (ucontext_t *)stk;
stk += sizeof(ucontext_t) / sizeof(void *);
stacksize -= sizeof(ucontext_t);
#else
p = (ucontext_t *)(stk + ((stacksize - sizeof(ucontext_t)) / sizeof(void *)));
stacksize -= sizeof(ucontext_t);
#endif
if (getcontext(p) == -1) {
err(EXIT_FAILURE, "thread_stack_init: getcontext");

View File

@ -72,6 +72,8 @@ const ng_netdev_driver_t ng_netdev_eth_driver = {
_isr_event,
};
/* These functions are not used */
#if !(defined(__FreeBSD__) || defined(__MACH__))
/* internal function definitions */
static inline bool _is_addr_broadcast(uint8_t *addr)
{
@ -84,6 +86,7 @@ static inline bool _is_addr_multicast(uint8_t *addr)
/* source: http://ieee802.org/secmail/pdfocSP2xXA6d.pdf */
return (addr[0] & 0x01);
}
#endif
/* build Ethernet packet from pkt */
static int _marshall_ethernet(ng_netdev_eth_t *dev, uint8_t *buffer, ng_pktsnip_t *pkt);