diff options
-rw-r--r-- | arch/um/drivers/cow_sys.h | 1 | ||||
-rw-r--r-- | arch/um/drivers/daemon_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/fd.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/mcast_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/net_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/pcap_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/port_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/pty.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/slip_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/tty.c | 1 | ||||
-rw-r--r-- | arch/um/include/um_malloc.h | 17 | ||||
-rw-r--r-- | arch/um/include/user.h | 6 | ||||
-rw-r--r-- | arch/um/include/user_util.h | 1 | ||||
-rw-r--r-- | arch/um/kernel/irq.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/drivers/ethertap_user.c | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/irq.c | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/main.c | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/sigio.c | 1 |
19 files changed, 33 insertions, 7 deletions
diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h index 7a5b4afde692..c6a308464acb 100644 --- a/arch/um/drivers/cow_sys.h +++ b/arch/um/drivers/cow_sys.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "user_util.h" | 5 | #include "user_util.h" |
6 | #include "os.h" | 6 | #include "os.h" |
7 | #include "user.h" | 7 | #include "user.h" |
8 | #include "um_malloc.h" | ||
8 | 9 | ||
9 | static inline void *cow_malloc(int size) | 10 | static inline void *cow_malloc(int size) |
10 | { | 11 | { |
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c index 77954ea77043..310af0f1e49e 100644 --- a/arch/um/drivers/daemon_user.c +++ b/arch/um/drivers/daemon_user.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "user_util.h" | 17 | #include "user_util.h" |
18 | #include "user.h" | 18 | #include "user.h" |
19 | #include "os.h" | 19 | #include "os.h" |
20 | #include "um_malloc.h" | ||
20 | 21 | ||
21 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) | 22 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) |
22 | 23 | ||
diff --git a/arch/um/drivers/fd.c b/arch/um/drivers/fd.c index 108b7dafbd0e..218aa0e9b792 100644 --- a/arch/um/drivers/fd.c +++ b/arch/um/drivers/fd.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "user_util.h" | 12 | #include "user_util.h" |
13 | #include "chan_user.h" | 13 | #include "chan_user.h" |
14 | #include "os.h" | 14 | #include "os.h" |
15 | #include "um_malloc.h" | ||
15 | 16 | ||
16 | struct fd_chan { | 17 | struct fd_chan { |
17 | int fd; | 18 | int fd; |
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c index 4d2bd39a85bc..8138f5ea1bf7 100644 --- a/arch/um/drivers/mcast_user.c +++ b/arch/um/drivers/mcast_user.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "user_util.h" | 23 | #include "user_util.h" |
24 | #include "user.h" | 24 | #include "user.h" |
25 | #include "os.h" | 25 | #include "os.h" |
26 | #include "um_malloc.h" | ||
26 | 27 | ||
27 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) | 28 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) |
28 | 29 | ||
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index f3a3f8a29c7a..0ffd7ac295d4 100644 --- a/arch/um/drivers/net_user.c +++ b/arch/um/drivers/net_user.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "kern_util.h" | 18 | #include "kern_util.h" |
19 | #include "net_user.h" | 19 | #include "net_user.h" |
20 | #include "os.h" | 20 | #include "os.h" |
21 | #include "um_malloc.h" | ||
21 | 22 | ||
22 | int tap_open_common(void *dev, char *gate_addr) | 23 | int tap_open_common(void *dev, char *gate_addr) |
23 | { | 24 | { |
diff --git a/arch/um/drivers/pcap_user.c b/arch/um/drivers/pcap_user.c index 2ef641ded960..11921a7baa7b 100644 --- a/arch/um/drivers/pcap_user.c +++ b/arch/um/drivers/pcap_user.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "net_user.h" | 12 | #include "net_user.h" |
13 | #include "pcap_user.h" | 13 | #include "pcap_user.h" |
14 | #include "user.h" | 14 | #include "user.h" |
15 | #include "um_malloc.h" | ||
15 | 16 | ||
16 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) | 17 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) |
17 | 18 | ||
diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c index f2e8fc42ecc2..bc6afaf74c1a 100644 --- a/arch/um/drivers/port_user.c +++ b/arch/um/drivers/port_user.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "chan_user.h" | 19 | #include "chan_user.h" |
20 | #include "port.h" | 20 | #include "port.h" |
21 | #include "os.h" | 21 | #include "os.h" |
22 | #include "um_malloc.h" | ||
22 | 23 | ||
23 | struct port_chan { | 24 | struct port_chan { |
24 | int raw; | 25 | int raw; |
diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c index abec620e8380..829a5eca8c07 100644 --- a/arch/um/drivers/pty.c +++ b/arch/um/drivers/pty.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "user_util.h" | 13 | #include "user_util.h" |
14 | #include "kern_util.h" | 14 | #include "kern_util.h" |
15 | #include "os.h" | 15 | #include "os.h" |
16 | #include "um_malloc.h" | ||
16 | 17 | ||
17 | struct pty_chan { | 18 | struct pty_chan { |
18 | void (*announce)(char *dev_name, int dev); | 19 | void (*announce)(char *dev_name, int dev); |
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c index 8460285c69a5..7eddacc53b6e 100644 --- a/arch/um/drivers/slip_user.c +++ b/arch/um/drivers/slip_user.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "slip.h" | 15 | #include "slip.h" |
16 | #include "slip_common.h" | 16 | #include "slip_common.h" |
17 | #include "os.h" | 17 | #include "os.h" |
18 | #include "um_malloc.h" | ||
18 | 19 | ||
19 | void slip_user_init(void *data, void *dev) | 20 | void slip_user_init(void *data, void *dev) |
20 | { | 21 | { |
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c index 11de3ac1eb5c..d95d64309eaf 100644 --- a/arch/um/drivers/tty.c +++ b/arch/um/drivers/tty.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "user_util.h" | 11 | #include "user_util.h" |
12 | #include "user.h" | 12 | #include "user.h" |
13 | #include "os.h" | 13 | #include "os.h" |
14 | #include "um_malloc.h" | ||
14 | 15 | ||
15 | struct tty_chan { | 16 | struct tty_chan { |
16 | char *dev; | 17 | char *dev; |
diff --git a/arch/um/include/um_malloc.h b/arch/um/include/um_malloc.h new file mode 100644 index 000000000000..0363a9b53f8d --- /dev/null +++ b/arch/um/include/um_malloc.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __UM_MALLOC_H__ | ||
7 | #define __UM_MALLOC_H__ | ||
8 | |||
9 | extern void *um_kmalloc(int size); | ||
10 | extern void *um_kmalloc_atomic(int size); | ||
11 | extern void kfree(const void *ptr); | ||
12 | |||
13 | extern void *um_vmalloc(int size); | ||
14 | extern void *um_vmalloc_atomic(int size); | ||
15 | extern void vfree(void *ptr); | ||
16 | |||
17 | #endif /* __UM_MALLOC_H__ */ | ||
diff --git a/arch/um/include/user.h b/arch/um/include/user.h index 39f8c8801076..acadce3f271f 100644 --- a/arch/um/include/user.h +++ b/arch/um/include/user.h | |||
@@ -11,17 +11,11 @@ extern void panic(const char *fmt, ...) | |||
11 | extern int printk(const char *fmt, ...) | 11 | extern int printk(const char *fmt, ...) |
12 | __attribute__ ((format (printf, 1, 2))); | 12 | __attribute__ ((format (printf, 1, 2))); |
13 | extern void schedule(void); | 13 | extern void schedule(void); |
14 | extern void *um_kmalloc(int size); | ||
15 | extern void *um_kmalloc_atomic(int size); | ||
16 | extern void kfree(void *ptr); | ||
17 | extern int in_aton(char *str); | 14 | extern int in_aton(char *str); |
18 | extern int open_gdb_chan(void); | 15 | extern int open_gdb_chan(void); |
19 | /* These use size_t, however unsigned long is correct on both i386 and x86_64. */ | 16 | /* These use size_t, however unsigned long is correct on both i386 and x86_64. */ |
20 | extern unsigned long strlcpy(char *, const char *, unsigned long); | 17 | extern unsigned long strlcpy(char *, const char *, unsigned long); |
21 | extern unsigned long strlcat(char *, const char *, unsigned long); | 18 | extern unsigned long strlcat(char *, const char *, unsigned long); |
22 | extern void *um_vmalloc(int size); | ||
23 | extern void *um_vmalloc_atomic(int size); | ||
24 | extern void vfree(void *ptr); | ||
25 | 19 | ||
26 | #endif | 20 | #endif |
27 | 21 | ||
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index 802d7842514d..06625fefef33 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h | |||
@@ -52,7 +52,6 @@ extern int linux_main(int argc, char **argv); | |||
52 | extern void set_cmdline(char *cmd); | 52 | extern void set_cmdline(char *cmd); |
53 | extern void input_cb(void (*proc)(void *), void *arg, int arg_len); | 53 | extern void input_cb(void (*proc)(void *), void *arg, int arg_len); |
54 | extern int get_pty(void); | 54 | extern int get_pty(void); |
55 | extern void *um_kmalloc(int size); | ||
56 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); | 55 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); |
57 | extern void do_exec(int old_pid, int new_pid); | 56 | extern void do_exec(int old_pid, int new_pid); |
58 | extern void tracer_panic(char *msg, ...) | 57 | extern void tracer_panic(char *msg, ...) |
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index ef259569fd8c..5c1e611f628d 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "irq_kern.h" | 31 | #include "irq_kern.h" |
32 | #include "os.h" | 32 | #include "os.h" |
33 | #include "sigio.h" | 33 | #include "sigio.h" |
34 | #include "um_malloc.h" | ||
34 | #include "misc_constants.h" | 35 | #include "misc_constants.h" |
35 | 36 | ||
36 | /* | 37 | /* |
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index fe6c64abda5b..348b272bb766 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "mode.h" | 46 | #include "mode.h" |
47 | #include "mode_kern.h" | 47 | #include "mode_kern.h" |
48 | #include "choose-mode.h" | 48 | #include "choose-mode.h" |
49 | #include "um_malloc.h" | ||
49 | 50 | ||
50 | /* This is a per-cpu array. A processor only modifies its entry and it only | 51 | /* This is a per-cpu array. A processor only modifies its entry and it only |
51 | * cares about its entry, so it's OK if another processor is modifying its | 52 | * cares about its entry, so it's OK if another processor is modifying its |
diff --git a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c index f559bdf746e6..863981ba1468 100644 --- a/arch/um/os-Linux/drivers/ethertap_user.c +++ b/arch/um/os-Linux/drivers/ethertap_user.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "net_user.h" | 20 | #include "net_user.h" |
21 | #include "etap.h" | 21 | #include "etap.h" |
22 | #include "os.h" | 22 | #include "os.h" |
23 | #include "um_malloc.h" | ||
23 | 24 | ||
24 | #define MAX_PACKET ETH_MAX_PACKET | 25 | #define MAX_PACKET ETH_MAX_PACKET |
25 | 26 | ||
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c index a97206df5b52..d46b818c1311 100644 --- a/arch/um/os-Linux/irq.c +++ b/arch/um/os-Linux/irq.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "sigio.h" | 18 | #include "sigio.h" |
19 | #include "irq_user.h" | 19 | #include "irq_user.h" |
20 | #include "os.h" | 20 | #include "os.h" |
21 | #include "um_malloc.h" | ||
21 | 22 | ||
22 | static struct pollfd *pollfds = NULL; | 23 | static struct pollfd *pollfds = NULL; |
23 | static int pollfds_num = 0; | 24 | static int pollfds_num = 0; |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index d1c5670787dc..685feaab65d2 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "choose-mode.h" | 23 | #include "choose-mode.h" |
24 | #include "uml-config.h" | 24 | #include "uml-config.h" |
25 | #include "os.h" | 25 | #include "os.h" |
26 | #include "um_malloc.h" | ||
26 | 27 | ||
27 | /* Set in set_stklim, which is called from main and __wrap_malloc. | 28 | /* Set in set_stklim, which is called from main and __wrap_malloc. |
28 | * __wrap_malloc only calls it if main hasn't started. | 29 | * __wrap_malloc only calls it if main hasn't started. |
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index f6457765b17d..925a65240cfe 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "user_util.h" | 19 | #include "user_util.h" |
20 | #include "sigio.h" | 20 | #include "sigio.h" |
21 | #include "os.h" | 21 | #include "os.h" |
22 | #include "um_malloc.h" | ||
22 | 23 | ||
23 | /* Protected by sigio_lock(), also used by sigio_cleanup, which is an | 24 | /* Protected by sigio_lock(), also used by sigio_cleanup, which is an |
24 | * exitcall. | 25 | * exitcall. |