diff options
author | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2005-11-07 23:18:35 +0000 |
---|---|---|
committer | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2005-11-07 23:18:35 +0000 |
commit | 004bd818080a8090ea61bfb9cd656b01fe4541e0 (patch) | |
tree | a09472ff8de767ccd7f84d64ffc3c3fc4179bb75 /translate/grt/config/linux.c | |
parent | d5888aa28f654fa58ec9f3914932885e36af3d5c (diff) | |
download | ghdl-004bd818080a8090ea61bfb9cd656b01fe4541e0.tar.gz ghdl-004bd818080a8090ea61bfb9cd656b01fe4541e0.tar.bz2 ghdl-004bd818080a8090ea61bfb9cd656b01fe4541e0.zip |
handle universal real div integer evaluation,
more optimizations added,
multi-thread ready grt,
bug fixes
Diffstat (limited to 'translate/grt/config/linux.c')
-rw-r--r-- | translate/grt/config/linux.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/translate/grt/config/linux.c b/translate/grt/config/linux.c index 3159cd613..38641b67f 100644 --- a/translate/grt/config/linux.c +++ b/translate/grt/config/linux.c @@ -65,7 +65,7 @@ struct stack_context /* Context for the main stack. */ static struct stack_context main_stack_context; -extern struct stack_context *grt_stack_main_stack; +extern void grt_stack_set_main_stack (struct stack_context *stack); /* If MAP_ANONYMOUS is not defined, use /dev/zero. */ #ifndef MAP_ANONYMOUS @@ -78,10 +78,8 @@ static int dev_zero_fd; #endif #if EXTEND_STACK -/* Defined in Grt.Processes (body). - This is the current process being run. - FIXME: this won't work with pthread! */ -extern void **grt_cur_proc; +/* This is the current process being run. */ +extern struct stack_context *grt_get_current_process (void); /* Stack used for signals. The stack must be different from the running stack, because we want to be @@ -124,7 +122,7 @@ static void grt_sigsegv_handler (int signo, siginfo_t *info, void *ptr) } #endif - if (info == NULL || grt_cur_proc == NULL || in_handler > 1) + if (info == NULL || grt_get_current_process () == NULL || in_handler > 1) { /* We loose. */ sigaction (SIGSEGV, &prev_sigsegv_act, NULL); @@ -134,7 +132,7 @@ static void grt_sigsegv_handler (int signo, siginfo_t *info, void *ptr) addr = info->si_addr; /* Check ADDR belong to the stack. */ - ctxt = *grt_cur_proc; + ctxt = grt_get_current_process ()->cur_sp; stack_high = (void *)(ctxt + 1); stack_low = stack_high - stack_max_size; if (addr > stack_high || addr < stack_low) @@ -216,7 +214,7 @@ grt_stack_init (void) /* Initialize the main stack context. */ main_stack_context.cur_sp = NULL; main_stack_context.cur_length = 0; - grt_stack_main_stack = &main_stack_context; + grt_stack_set_main_stack (&main_stack_context); #ifdef USE_DEV_ZERO dev_zero_fd = open ("/dev/zero", O_RDWR); |