[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] mini-os: build fixes for lwip 1.3.2
# HG changeset patch # User David Vrabel <david.vrabel@xxxxxxxxxx> # Date 1359542317 28800 # Node ID 01cf32ca87001ef2d54423f30a6978c288f64f7a # Parent 12859b96ac9bb0ce009e12faaf9c3ac7e6ca3795 mini-os: build fixes for lwip 1.3.2 Various fixes to mini-os needed to build lwip 1.3.2: - Don't build the tests. - Add BSD-style endianness macros to endian.h. - free() is called via a function pointer so it needs to be a real function. Do the same for malloc() and realloc(). Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx> Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> Committed-by: Keir Fraser <keir@xxxxxxx> --- diff -r 12859b96ac9b -r 01cf32ca8700 extras/mini-os/Makefile --- a/extras/mini-os/Makefile Wed Jan 30 02:36:40 2013 -0800 +++ b/extras/mini-os/Makefile Wed Jan 30 02:38:37 2013 -0800 @@ -136,7 +136,7 @@ arch_lib: ifeq ($(CONFIG_LWIP),y) # lwIP library -LWC := $(shell find $(LWIPDIR)/ -type f -name '*.c') +LWC := $(shell find $(LWIPDIR)/src -type f -name '*.c') LWC := $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC)) LWO := $(patsubst %.c,%.o,$(LWC)) LWO += $(OBJ_DIR)/lwip-arch.o diff -r 12859b96ac9b -r 01cf32ca8700 extras/mini-os/README --- a/extras/mini-os/README Wed Jan 30 02:36:40 2013 -0800 +++ b/extras/mini-os/README Wed Jan 30 02:38:37 2013 -0800 @@ -19,7 +19,7 @@ This includes: - to build it just type make. -- to build it with TCP/IP support, download LWIP 1.3 source code and type +- to build it with TCP/IP support, download LWIP 1.3.2 source code and type make LWIPDIR=/path/to/lwip/source diff -r 12859b96ac9b -r 01cf32ca8700 extras/mini-os/include/endian.h --- a/extras/mini-os/include/endian.h Wed Jan 30 02:36:40 2013 -0800 +++ b/extras/mini-os/include/endian.h Wed Jan 30 02:38:37 2013 -0800 @@ -12,4 +12,8 @@ #include <arch_wordsize.h> +#define BYTE_ORDER __BYTE_ORDER +#define BIG_ENDIAN __BIG_ENDIAN +#define LITTLE_ENDIAN __LITTLE_ENDIAN + #endif /* endian.h */ diff -r 12859b96ac9b -r 01cf32ca8700 extras/mini-os/include/xmalloc.h --- a/extras/mini-os/include/xmalloc.h Wed Jan 30 02:36:40 2013 -0800 +++ b/extras/mini-os/include/xmalloc.h Wed Jan 30 02:38:37 2013 -0800 @@ -14,16 +14,16 @@ #include <limits.h> #define DEFAULT_ALIGN (sizeof(unsigned long)) -#define malloc(size) _xmalloc(size, DEFAULT_ALIGN) -#define free(ptr) xfree(ptr) -#define realloc(ptr, size) _realloc(ptr, size) -/* Free any of the above. */ +extern void *malloc(size_t size); +extern void *realloc(void *ptr, size_t size); +extern void free(void *ptr); + +/* Free memory from any xmalloc*() call. */ extern void xfree(const void *); /* Underlying functions */ extern void *_xmalloc(size_t size, size_t align); -extern void *_realloc(void *ptr, size_t size); #endif diff -r 12859b96ac9b -r 01cf32ca8700 extras/mini-os/lib/xmalloc.c --- a/extras/mini-os/lib/xmalloc.c Wed Jan 30 02:36:40 2013 -0800 +++ b/extras/mini-os/lib/xmalloc.c Wed Jan 30 02:38:37 2013 -0800 @@ -267,7 +267,12 @@ void xfree(const void *p) /* spin_unlock_irqrestore(&freelist_lock, flags); */ } -void *_realloc(void *ptr, size_t size) +void *malloc(size_t size) +{ + return _xmalloc(size, DEFAULT_ALIGN); +} + +void *realloc(void *ptr, size_t size) { void *new; struct xmalloc_hdr *hdr; @@ -296,6 +301,11 @@ void *_realloc(void *ptr, size_t size) return new; } + +void free(void *ptr) +{ + xfree(ptr); +} #endif /* _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |