diff options
author | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2005-11-22 16:09:10 +0000 |
---|---|---|
committer | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2005-11-22 16:09:10 +0000 |
commit | 171548c9d708fc13f5b6d3edde30630ee04bd06e (patch) | |
tree | 181c2a4f230ec445277ec4ed6a25c73f25aab3e2 /translate/grt/config | |
parent | 20e31a50417e5452dcc5797d27dc1383253e3161 (diff) | |
download | ghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.tar.gz ghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.tar.bz2 ghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.zip |
more optimizations + bug fixes
Diffstat (limited to 'translate/grt/config')
-rw-r--r-- | translate/grt/config/ia64.S | 4 | ||||
-rw-r--r-- | translate/grt/config/linux.c | 20 |
2 files changed, 16 insertions, 8 deletions
diff --git a/translate/grt/config/ia64.S b/translate/grt/config/ia64.S index d7fb2d19a..34df82e0c 100644 --- a/translate/grt/config/ia64.S +++ b/translate/grt/config/ia64.S @@ -32,7 +32,7 @@ grt_stack_switch: { alloc r31=ar.pfs, 2, 0, 0, 0 mov r14 = ar.rsc - adds r12 = -(frame_size + 16), r12 + adds r12 = -frame_size, r12 .body ;; } @@ -227,7 +227,7 @@ grt_stack_switch: ldf.fill f30 = [r20], 32 // sp + 448 (f30) ;; ldf.fill f31 = [r21], 32 // sp + 464 (f31) - adds r12 = 16, r20 + mov r12 = r20 br.ret.sptk.many b0 ;; .endp grt_stack_switch# diff --git a/translate/grt/config/linux.c b/translate/grt/config/linux.c index 38641b67f..ab999c0a3 100644 --- a/translate/grt/config/linux.c +++ b/translate/grt/config/linux.c @@ -62,11 +62,6 @@ struct stack_context size_t cur_length; }; -/* Context for the main stack. */ -static struct stack_context main_stack_context; - -extern void grt_stack_set_main_stack (struct stack_context *stack); - /* If MAP_ANONYMOUS is not defined, use /dev/zero. */ #ifndef MAP_ANONYMOUS #define USE_DEV_ZERO @@ -193,6 +188,19 @@ static void grt_signal_setup (void) } #endif +/* Context for the main stack. */ +static __thread struct stack_context main_stack_context; + +extern void grt_set_main_stack (struct stack_context *stack); + +void +grt_stack_new_thread (void) +{ + main_stack_context.cur_sp = NULL; + main_stack_context.cur_length = 0; + grt_set_main_stack (&main_stack_context); +} + void grt_stack_init (void) { @@ -214,7 +222,7 @@ grt_stack_init (void) /* Initialize the main stack context. */ main_stack_context.cur_sp = NULL; main_stack_context.cur_length = 0; - grt_stack_set_main_stack (&main_stack_context); + grt_set_main_stack (&main_stack_context); #ifdef USE_DEV_ZERO dev_zero_fd = open ("/dev/zero", O_RDWR); |