]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[PATCH] uml: split memory allocation prototypes out of user.h
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Fri, 20 Oct 2006 06:28:20 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 20 Oct 2006 17:26:36 +0000 (10:26 -0700)
user.h is too generic a header name.  I've split out allocation routines from
it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 files changed:
arch/um/drivers/cow_sys.h
arch/um/drivers/daemon_user.c
arch/um/drivers/fd.c
arch/um/drivers/mcast_user.c
arch/um/drivers/net_user.c
arch/um/drivers/pcap_user.c
arch/um/drivers/port_user.c
arch/um/drivers/pty.c
arch/um/drivers/slip_user.c
arch/um/drivers/tty.c
arch/um/include/um_malloc.h [new file with mode: 0644]
arch/um/include/user.h
arch/um/include/user_util.h
arch/um/kernel/irq.c
arch/um/kernel/process.c
arch/um/os-Linux/drivers/ethertap_user.c
arch/um/os-Linux/irq.c
arch/um/os-Linux/main.c
arch/um/os-Linux/sigio.c

index 7a5b4afde6929474f8422ab681076dd430ebaed1..c6a308464acb600f3705c4e3a6e0c9fa9c848430 100644 (file)
@@ -5,6 +5,7 @@
 #include "user_util.h"
 #include "os.h"
 #include "user.h"
+#include "um_malloc.h"
 
 static inline void *cow_malloc(int size)
 {
index 77954ea77043796217b22f83e3ef0d9d3b8c7c14..310af0f1e49e4a7fa2b78609ed5e46c200cba721 100644 (file)
@@ -17,6 +17,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index 108b7dafbd0e99a6d0cf9a9d82ca26ed6d1ac5f1..218aa0e9b792b6f0351e084f8640e472ecdf5c9f 100644 (file)
@@ -12,6 +12,7 @@
 #include "user_util.h"
 #include "chan_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct fd_chan {
        int fd;
index 4d2bd39a85bc16ff7dc685b908dad366fa82cac0..8138f5ea1bf7516272de7b086ead9ca8295306ea 100644 (file)
@@ -23,6 +23,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index f3a3f8a29c7af877d327692f2f30f89a7ef6f081..0ffd7ac295d45e0fd5bdc0e4e8c36eab42c517cd 100644 (file)
@@ -18,6 +18,7 @@
 #include "kern_util.h"
 #include "net_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 int tap_open_common(void *dev, char *gate_addr)
 {
index 2ef641ded960a96670456b5d2f1b56914a689c42..11921a7baa7b14066d2c2f7d7f653063535e516e 100644 (file)
@@ -12,6 +12,7 @@
 #include "net_user.h"
 #include "pcap_user.h"
 #include "user.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index f2e8fc42ecc2df4a2ec7bfe247ab7ec12fe1659c..bc6afaf74c1a8123ace69f94c5d2d9a340bc6347 100644 (file)
@@ -19,6 +19,7 @@
 #include "chan_user.h"
 #include "port.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct port_chan {
        int raw;
index abec620e838030d43e7a01626cb82c5c041ed63f..829a5eca8c07606b9b44ea393df4e4f32b94fd99 100644 (file)
@@ -13,6 +13,7 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct pty_chan {
        void (*announce)(char *dev_name, int dev);
index 8460285c69a5cea3e0b842d0b5cd792d84c38aef..7eddacc53b6ec2168a581685b4e11bf6523eeedf 100644 (file)
@@ -15,6 +15,7 @@
 #include "slip.h"
 #include "slip_common.h"
 #include "os.h"
+#include "um_malloc.h"
 
 void slip_user_init(void *data, void *dev)
 {
index 11de3ac1eb5c787512b4c1a71f6ac1a16cd6725b..d95d64309eaf3defc373ba6195a0b5fc03cbea45 100644 (file)
@@ -11,6 +11,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct tty_chan {
        char *dev;
diff --git a/arch/um/include/um_malloc.h b/arch/um/include/um_malloc.h
new file mode 100644 (file)
index 0000000..0363a9b
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
+ * Licensed under the GPL
+ */
+
+#ifndef __UM_MALLOC_H__
+#define __UM_MALLOC_H__
+
+extern void *um_kmalloc(int size);
+extern void *um_kmalloc_atomic(int size);
+extern void kfree(const void *ptr);
+
+extern void *um_vmalloc(int size);
+extern void *um_vmalloc_atomic(int size);
+extern void vfree(void *ptr);
+
+#endif /* __UM_MALLOC_H__ */
index 39f8c8801076351de6b0c2cfc3d7b070a2c7dba4..acadce3f271f05d2833790c82922140b539d4dc4 100644 (file)
@@ -11,17 +11,11 @@ extern void panic(const char *fmt, ...)
 extern int printk(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
 extern void schedule(void);
-extern void *um_kmalloc(int size);
-extern void *um_kmalloc_atomic(int size);
-extern void kfree(void *ptr);
 extern int in_aton(char *str);
 extern int open_gdb_chan(void);
 /* These use size_t, however unsigned long is correct on both i386 and x86_64. */
 extern unsigned long strlcpy(char *, const char *, unsigned long);
 extern unsigned long strlcat(char *, const char *, unsigned long);
-extern void *um_vmalloc(int size);
-extern void *um_vmalloc_atomic(int size);
-extern void vfree(void *ptr);
 
 #endif
 
index 802d7842514d25ad63b5be204a573363a6992b60..06625fefef3387b2aac94471361cf59139042b34 100644 (file)
@@ -52,7 +52,6 @@ extern int linux_main(int argc, char **argv);
 extern void set_cmdline(char *cmd);
 extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
 extern int get_pty(void);
-extern void *um_kmalloc(int size);
 extern int switcheroo(int fd, int prot, void *from, void *to, int size);
 extern void do_exec(int old_pid, int new_pid);
 extern void tracer_panic(char *msg, ...)
index ef259569fd8c003cc0c5c671eaab7af536805d90..5c1e611f628d548fed1716c75d5537c39d6b8cc4 100644 (file)
@@ -31,6 +31,7 @@
 #include "irq_kern.h"
 #include "os.h"
 #include "sigio.h"
+#include "um_malloc.h"
 #include "misc_constants.h"
 
 /*
index fe6c64abda5b029d3f3b1c2a2b891471cf52f3c2..348b272bb766a5305f54ba3d35874b5b3caa45e6 100644 (file)
@@ -46,6 +46,7 @@
 #include "mode.h"
 #include "mode_kern.h"
 #include "choose-mode.h"
+#include "um_malloc.h"
 
 /* This is a per-cpu array.  A processor only modifies its entry and it only
  * cares about its entry, so it's OK if another processor is modifying its
index f559bdf746e6099bfb7593215ded118626a899df..863981ba14687684ab8bcbae3d7606945468afeb 100644 (file)
@@ -20,6 +20,7 @@
 #include "net_user.h"
 #include "etap.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET ETH_MAX_PACKET
 
index a97206df5b52068ffe20b3b0979653c4e384d28b..d46b818c1311258934679b82fdd0685afeaecbca 100644 (file)
@@ -18,6 +18,7 @@
 #include "sigio.h"
 #include "irq_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 static struct pollfd *pollfds = NULL;
 static int pollfds_num = 0;
index d1c5670787dca8edb9ad9b6aede68e22c6e24cd4..685feaab65d239efa4931af9838e63b54f62d702 100644 (file)
@@ -23,6 +23,7 @@
 #include "choose-mode.h"
 #include "uml-config.h"
 #include "os.h"
+#include "um_malloc.h"
 
 /* Set in set_stklim, which is called from main and __wrap_malloc.
  * __wrap_malloc only calls it if main hasn't started.
index f6457765b17db86c7b03c3879e11e8f1da16934b..925a65240cfec96c0f6c424e6009bf24a2012f90 100644 (file)
@@ -19,6 +19,7 @@
 #include "user_util.h"
 #include "sigio.h"
 #include "os.h"
+#include "um_malloc.h"
 
 /* Protected by sigio_lock(), also used by sigio_cleanup, which is an
  * exitcall.