From a66c230722ae7a75f7c23fb1a0b141446eb7209f Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Tue, 3 Sep 2013 11:40:20 +0300 Subject: [PATCH] more header cleanup, remove dupes from --- arch/x86/mm.c | 3 ++- arch/x86/setup.c | 3 ++- arch/x86/traps.c | 2 ++ blkfront.c | 4 ++++ console/console.c | 3 +++ console/xenbus.c | 7 +++++- console/xencons_ring.c | 6 ++++- gntmap.c | 2 ++ gnttab.c | 2 ++ include/mini-os/lib.h | 46 --------------------------------------- include/mini-os/xmalloc.h | 1 - kernel.c | 2 ++ lib/memalloc.c | 2 ++ lib/printf.c | 3 +++ lib/string.c | 3 +-- mm.c | 2 ++ netfront.c | 8 +++---- rumphyper_base.c | 3 +++ rumphyper_net.c | 4 +++- rumphyper_synch.c | 4 +++- rumpkern_demo.c | 6 ++--- xenbus/xenbus.c | 4 ++++ 22 files changed, 58 insertions(+), 62 deletions(-) diff --git a/arch/x86/mm.c b/arch/x86/mm.c index 76742b4..5258145 100644 --- a/arch/x86/mm.c +++ b/arch/x86/mm.c @@ -39,9 +39,10 @@ #include #include #include -#include #include +#include + #ifdef MM_DEBUG #define DEBUG(_f, _a...) \ printk("MINI_OS(file=mm.c, line=%d) " _f "\n", __LINE__, ## _a) diff --git a/arch/x86/setup.c b/arch/x86/setup.c index 923901e..238243c 100644 --- a/arch/x86/setup.c +++ b/arch/x86/setup.c @@ -27,7 +27,8 @@ */ #include -#include /* for printk, memcpy */ + +#include /* * Shared page for communicating with the hypervisor. diff --git a/arch/x86/traps.c b/arch/x86/traps.c index 516d133..f2ee81e 100644 --- a/arch/x86/traps.c +++ b/arch/x86/traps.c @@ -6,6 +6,8 @@ #include #include +#include + /* * These are assembler stubs in entry.S. * They are the actual entry points for virtual exceptions. diff --git a/blkfront.c b/blkfront.c index a7eaaaf..159bb1f 100644 --- a/blkfront.c +++ b/blkfront.c @@ -17,6 +17,10 @@ #include #include +#include +#include +#include + /* Note: we generally don't need to disable IRQs since we hardly do anything in * the interrupt handler. */ diff --git a/console/console.c b/console/console.c index 7c85c6f..3756220 100644 --- a/console/console.c +++ b/console/console.c @@ -44,6 +44,9 @@ #include #include +#include +#include + /* Copies all print output to the Xen emergency console apart of standard dom0 handled console */ diff --git a/console/xenbus.c b/console/xenbus.c index bf03ed0..b3b7f3e 100644 --- a/console/xenbus.c +++ b/console/xenbus.c @@ -11,7 +11,12 @@ #include #include #include -#include "console.h" + +#include + +#include +#include +#include void free_consfront(struct consfront_dev *dev) { diff --git a/console/xencons_ring.c b/console/xencons_ring.c index 0a35fbf..5eae429 100644 --- a/console/xencons_ring.c +++ b/console/xencons_ring.c @@ -11,7 +11,11 @@ #include #include #include -#include "console.h" + +#include + +#include +#include DECLARE_WAIT_QUEUE_HEAD(console_queue); diff --git a/gntmap.c b/gntmap.c index 22ed450..e050ca3 100644 --- a/gntmap.c +++ b/gntmap.c @@ -38,6 +38,8 @@ #include #include +#include + #define DEFAULT_MAX_GRANTS 128 struct gntmap_entry { diff --git a/gnttab.c b/gnttab.c index ebfa8ac..32a5794 100644 --- a/gnttab.c +++ b/gnttab.c @@ -20,6 +20,8 @@ #include #include +#include + #define NR_RESERVED_ENTRIES 8 /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ diff --git a/include/mini-os/lib.h b/include/mini-os/lib.h index ab47490..2f7bcfd 100644 --- a/include/mini-os/lib.h +++ b/include/mini-os/lib.h @@ -48,56 +48,10 @@ #ifndef _LIB_H_ #define _LIB_H_ -#include -#include #include #include -#include #include "gntmap.h" - -int sprintf(char *, const char *, ...); -int snprintf(char *, size_t, const char *, ...); -void vprintf(const char *, va_list); -int vsprintf(char *, const char *, va_list); -int vsnprintf(char *, size_t, const char *, va_list); -unsigned long strtoul(const char *, char **, int); - -/* string and memory manipulation */ - -/* - * From: - * @(#)libkern.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD$ - */ -int memcmp(const void *b1, const void *b2, size_t len); - -char *strcat(char * __restrict, const char * __restrict); -int strcmp(const char *, const char *); -char *strcpy(char * __restrict, const char * __restrict); - -char *strdup(const char *__restrict); - -size_t strlen(const char *); - -int strncmp(const char *, const char *, size_t); -char *strncpy(char * __restrict, const char * __restrict, size_t); - -char *strstr(const char *, const char *); - -void *memset(void *, int, size_t); - -char *strchr(const char *p, int ch); -char *strrchr(const char *p, int ch); - -/* From: - * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $FreeBSD$ - */ -void *memcpy(void *to, const void *from, size_t len); - -size_t strnlen(const char *, size_t); - #include #define RAND_MIX 2654435769U diff --git a/include/mini-os/xmalloc.h b/include/mini-os/xmalloc.h index 3a7f49d..f041c9e 100644 --- a/include/mini-os/xmalloc.h +++ b/include/mini-os/xmalloc.h @@ -14,7 +14,6 @@ void * calloc(size_t, size_t); #define DEFAULT_ALIGN (sizeof(unsigned long)) /* compat */ -#define malloc(size) memalloc(size, DEFAULT_ALIGN) #define _xmalloc(size, align) memalloc(size, align) #define xfree(ptr) free(ptr) diff --git a/kernel.c b/kernel.c index ca1f3a3..1c4c7e0 100644 --- a/kernel.c +++ b/kernel.c @@ -46,6 +46,8 @@ #include #include +#include + uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32]; void setup_xen_features(void) diff --git a/lib/memalloc.c b/lib/memalloc.c index 2905768..f3173e8 100644 --- a/lib/memalloc.c +++ b/lib/memalloc.c @@ -66,6 +66,8 @@ #include #include +#include + #endif diff --git a/lib/printf.c b/lib/printf.c index f3618c3..609d4a6 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -44,6 +44,9 @@ #include #include +#include +#include + /* * local prototypes */ diff --git a/lib/string.c b/lib/string.c index 1168307..0c4125d 100644 --- a/lib/string.c +++ b/lib/string.c @@ -21,9 +21,8 @@ #include #include -#include - #include +#include char *strdup(const char *x) { diff --git a/mm.c b/mm.c index bde4c3f..2a4d720 100644 --- a/mm.c +++ b/mm.c @@ -42,6 +42,8 @@ #include #include +#include + #ifdef MM_DEBUG #define DEBUG(_f, _a...) \ printk("MINI_OS(file=mm.c, line=%d) " _f "\n", __LINE__, ## _a) diff --git a/netfront.c b/netfront.c index 29e6621..389bb72 100644 --- a/netfront.c +++ b/netfront.c @@ -17,16 +17,16 @@ #include #include -DECLARE_WAIT_QUEUE_HEAD(netfront_queue); - - +#include +#include +#include +DECLARE_WAIT_QUEUE_HEAD(netfront_queue); #define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE) #define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE) #define GRANT_INVALID_REF 0 - struct net_buffer { void* page; grant_ref_t gref; diff --git a/rumphyper_base.c b/rumphyper_base.c index 2f66ba0..a3813c5 100644 --- a/rumphyper_base.c +++ b/rumphyper_base.c @@ -31,6 +31,9 @@ #include #include +#include +#include + #include "rumphyper.h" struct rumpuser_hyperup rumpuser__hyp; diff --git a/rumphyper_net.c b/rumphyper_net.c index b030a43..c874c35 100644 --- a/rumphyper_net.c +++ b/rumphyper_net.c @@ -25,7 +25,9 @@ #include #include -#include + +#include +#include #include "rumphyper.h" #include diff --git a/rumphyper_synch.c b/rumphyper_synch.c index 74c1992..ed84a5e 100644 --- a/rumphyper_synch.c +++ b/rumphyper_synch.c @@ -33,10 +33,12 @@ #include #include #include -#include #include +#include +#include + #include "rumphyper.h" #define assert(a) ASSERT(a) diff --git a/rumpkern_demo.c b/rumpkern_demo.c index 9bcf351..34f143b 100644 --- a/rumpkern_demo.c +++ b/rumpkern_demo.c @@ -1,16 +1,16 @@ #include #include -#include #include #include -#include - #include #include +#include +#include +#include #include #include diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c index cfde9c8..54719aa 100644 --- a/xenbus/xenbus.c +++ b/xenbus/xenbus.c @@ -28,6 +28,10 @@ #include #include +#include +#include +#include + #define min(x,y) ({ \ typeof(x) tmpx = (x); \ typeof(y) tmpy = (y); \ -- 2.39.5