aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-02-01 06:06:25 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 11:53:22 -0500
commit854e981cc69bb93b49bdd052c8bc1dc744509f04 (patch)
treef45d1f19cc43c70f8f012ce7be667a3614e89cdb /arch
parent98105d47d3d62eb68d06d85dd448699678d725fc (diff)
[PATCH] uml: fix hugest stack users
The C99 initialization, with GCC's bad handling, for 6K wide structs (which _aren't_ on the stack), is causing GCC to use 12K for these silly procs with 3 vars. Workaround this. Note that .name = { '\0' } translates to memset(->name, 0, '->name' size) - I verified this with GCC's docs and a testprogram. 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/slip_common.h13
-rw-r--r--arch/um/drivers/slip_kern.c15
-rw-r--r--arch/um/drivers/slirp_kern.c13
3 files changed, 22 insertions, 19 deletions
diff --git a/arch/um/drivers/slip_common.h b/arch/um/drivers/slip_common.h
index 2ae76d8f1be1..d574e0a9dc13 100644
--- a/arch/um/drivers/slip_common.h
+++ b/arch/um/drivers/slip_common.h
@@ -88,12 +88,13 @@ struct slip_proto {
88 int esc; 88 int esc;
89}; 89};
90 90
91#define SLIP_PROTO_INIT { \ 91static inline void slip_proto_init(struct slip_proto * slip)
92 .ibuf = { '\0' }, \ 92{
93 .obuf = { '\0' }, \ 93 memset(slip->ibuf, 0, sizeof(slip->ibuf));
94 .more = 0, \ 94 memset(slip->obuf, 0, sizeof(slip->obuf));
95 .pos = 0, \ 95 slip->more = 0;
96 .esc = 0 \ 96 slip->pos = 0;
97 slip->esc = 0;
97} 98}
98 99
99extern int slip_proto_read(int fd, void *buf, int len, 100extern int slip_proto_read(int fd, void *buf, int len,
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 9a6f5c85f902..a62f5ef445cf 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -21,13 +21,14 @@ void slip_init(struct net_device *dev, void *data)
21 21
22 private = dev->priv; 22 private = dev->priv;
23 spri = (struct slip_data *) private->user; 23 spri = (struct slip_data *) private->user;
24 *spri = ((struct slip_data) 24
25 { .name = { '\0' }, 25 memset(spri->name, 0, sizeof(spri->name));
26 .addr = NULL, 26 spri->addr = NULL;
27 .gate_addr = init->gate_addr, 27 spri->gate_addr = init->gate_addr;
28 .slave = -1, 28 spri->slave = -1;
29 .slip = SLIP_PROTO_INIT, 29 spri->dev = dev;
30 .dev = dev }); 30
31 slip_proto_init(&spri->slip);
31 32
32 dev->init = NULL; 33 dev->init = NULL;
33 dev->header_cache_update = NULL; 34 dev->header_cache_update = NULL;
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index 9864d27afdbe..33d7982be5d3 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -21,12 +21,13 @@ void slirp_init(struct net_device *dev, void *data)
21 21
22 private = dev->priv; 22 private = dev->priv;
23 spri = (struct slirp_data *) private->user; 23 spri = (struct slirp_data *) private->user;
24 *spri = ((struct slirp_data) 24
25 { .argw = init->argw, 25 spri->argw = init->argw;
26 .pid = -1, 26 spri->pid = -1;
27 .slave = -1, 27 spri->slave = -1;
28 .slip = SLIP_PROTO_INIT, 28 spri->dev = dev;
29 .dev = dev }); 29
30 slip_proto_init(&spri->slip);
30 31
31 dev->init = NULL; 32 dev->init = NULL;
32 dev->hard_header_len = 0; 33 dev->hard_header_len = 0;