diff options
Diffstat (limited to 'translate/grt/config')
-rw-r--r-- | translate/grt/config/amd64.S | 9 | ||||
-rw-r--r-- | translate/grt/config/chkstk.S | 25 | ||||
-rw-r--r-- | translate/grt/config/clock.c | 9 | ||||
-rw-r--r-- | translate/grt/config/i386.S | 9 | ||||
-rw-r--r-- | translate/grt/config/ia64.S | 25 | ||||
-rw-r--r-- | translate/grt/config/linux.c | 9 | ||||
-rw-r--r-- | translate/grt/config/ppc.S | 9 | ||||
-rw-r--r-- | translate/grt/config/pthread.c | 42 | ||||
-rw-r--r-- | translate/grt/config/sparc.S | 9 | ||||
-rw-r--r-- | translate/grt/config/times.c | 9 | ||||
-rw-r--r-- | translate/grt/config/win32.c | 9 |
11 files changed, 135 insertions, 29 deletions
diff --git a/translate/grt/config/amd64.S b/translate/grt/config/amd64.S index e7f1baa02..0a7f0044b 100644 --- a/translate/grt/config/amd64.S +++ b/translate/grt/config/amd64.S @@ -1,5 +1,5 @@ /* GRT stack implementation for amd64 (x86_64) - Copyright (C) 2005 Tristan Gingold. + Copyright (C) 2005 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ .file "amd64.S" diff --git a/translate/grt/config/chkstk.S b/translate/grt/config/chkstk.S index 3fa5cc683..ab244d0cd 100644 --- a/translate/grt/config/chkstk.S +++ b/translate/grt/config/chkstk.S @@ -1,3 +1,28 @@ +/* GRT stack implementation for x86. + Copyright (C) 2002 - 2014 Tristan Gingold. + + GHDL is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2, or (at your option) any later + version. + + GHDL is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. +*/ .file "chkstk.S" .version "01.01" diff --git a/translate/grt/config/clock.c b/translate/grt/config/clock.c index 038ce2210..242af604b 100644 --- a/translate/grt/config/clock.c +++ b/translate/grt/config/clock.c @@ -1,5 +1,5 @@ /* GRT C bindings for time. - Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold. + Copyright (C) 2002 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ #include <time.h> diff --git a/translate/grt/config/i386.S b/translate/grt/config/i386.S index c742be054..00d4719ac 100644 --- a/translate/grt/config/i386.S +++ b/translate/grt/config/i386.S @@ -1,5 +1,5 @@ /* GRT stack implementation for x86. - Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold. + Copyright (C) 2002 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ .file "i386.S" .version "01.01" diff --git a/translate/grt/config/ia64.S b/translate/grt/config/ia64.S index 34df82e0c..9ce3800bb 100644 --- a/translate/grt/config/ia64.S +++ b/translate/grt/config/ia64.S @@ -1,3 +1,28 @@ +/* GRT stack implementation for ia64. + Copyright (C) 2002 - 2014 Tristan Gingold. + + GHDL is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2, or (at your option) any later + version. + + GHDL is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. +*/ .file "ia64.S" .pred.safe_across_calls p1-p5,p16-p63 diff --git a/translate/grt/config/linux.c b/translate/grt/config/linux.c index cd495fed7..74dce0903 100644 --- a/translate/grt/config/linux.c +++ b/translate/grt/config/linux.c @@ -1,5 +1,5 @@ /* GRT stacks implementation for linux and other *nix. - Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold. + Copyright (C) 2002 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ #define _GNU_SOURCE #include <unistd.h> diff --git a/translate/grt/config/ppc.S b/translate/grt/config/ppc.S index ccfdc2209..bedd48ab4 100644 --- a/translate/grt/config/ppc.S +++ b/translate/grt/config/ppc.S @@ -1,5 +1,5 @@ /* GRT stack implementation for ppc. - Copyright (C) 2005 Tristan Gingold. + Copyright (C) 2005 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ .file "ppc.S" diff --git a/translate/grt/config/pthread.c b/translate/grt/config/pthread.c index f619ead18..189ae90c8 100644 --- a/translate/grt/config/pthread.c +++ b/translate/grt/config/pthread.c @@ -1,5 +1,5 @@ /* GRT stack implementation based on pthreads. - Copyright (C) 2003, 2004, 2005 Felix Bertram & Tristan Gingold. + Copyright (C) 2003 - 2014 Felix Bertram & Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -19,7 +19,7 @@ //----------------------------------------------------------------------------- // Project: GHDL - VHDL Simulator // Description: pthread port of stacks package, for use with MacOSX -// Note: Tristan's original i386/Linux used assembly-code +// Note: Tristan's original i386/Linux used assembly-code // to manually switch stacks for performance reasons. // History: 2003may22, FB, created. //----------------------------------------------------------------------------- @@ -35,8 +35,8 @@ // GHDL names an endless loop calling FUNC with ARG a 'stack' // at a given time, only one stack may be 'executed' -typedef struct -{ +typedef struct +{ pthread_t thread; // stack's thread pthread_mutex_t mutex; // mutex to suspend/resume thread #if defined(__CYGWIN__) @@ -60,7 +60,7 @@ void grt_stack_init(void) int res; INFO("grt_stack_init\n"); INFO(" main_stack_context=0x%08x\n", &main_stack_context); - + #if defined(__CYGWIN__) res = pthread_mutexattr_init (&main_stack_context.mxAttr); @@ -78,7 +78,7 @@ void grt_stack_init(void) // lock the mutex, as we are currently running res = pthread_mutex_lock (&main_stack_context.mutex); assert (res == 0); - + current = &main_stack_context; grt_set_main_stack (&main_stack_context); @@ -90,26 +90,26 @@ static void* grt_stack_loop(void* pv_myStack) Stack_Type myStack= (Stack_Type)pv_myStack; INFO("grt_stack_loop\n"); - + INFO(" myStack=0x%08x\n", myStack); // block until mutex becomes available again. // this happens when this stack is enabled for the first time pthread_mutex_lock(&(myStack->mutex)); - + // run stack's function in endless loop while(1) { INFO(" call 0x%08x with 0x%08x\n", myStack->Func, myStack->Arg); myStack->Func(myStack->Arg); } - + // we never get here... return 0; } //---------------------------------------------------------------------------- -Stack_Type grt_stack_create(void* Func, void* Arg) +Stack_Type grt_stack_create(void* Func, void* Arg) // Create a new stack, which on first execution will call FUNC with // an argument ARG. // => function Stack_Create (Func : Address; Arg : Address) return Stack_Type; @@ -119,13 +119,13 @@ Stack_Type grt_stack_create(void* Func, void* Arg) INFO("grt_stack_create\n"); INFO(" call 0x%08x with 0x%08x\n", Func, Arg); - + newStack = malloc (sizeof(Stack_Type_t)); - + // init function and argument newStack->Func = Func; newStack->Arg = Arg; - + // create mutex #if defined(__CYGWIN__) res = pthread_mutexattr_init (&newStack->mxAttr); @@ -138,16 +138,16 @@ Stack_Type grt_stack_create(void* Func, void* Arg) res = pthread_mutex_init (&newStack->mutex, NULL); assert (res == 0); #endif - + // block the mutex, so that thread will blocked in grt_stack_loop res = pthread_mutex_lock (&newStack->mutex); assert (res == 0); - + INFO(" newStack=0x%08x\n", newStack); - + // create thread, which executes grt_stack_loop - pthread_create (&newStack->thread, NULL, grt_stack_loop, newStack); - + pthread_create (&newStack->thread, NULL, grt_stack_loop, newStack); + return newStack; } @@ -160,7 +160,7 @@ void grt_stack_switch(Stack_Type To, Stack_Type From) // Resume stack TO and save the current context to the stack pointed by // CUR. // => procedure Stack_Switch (To : Stack_Type; From : Stack_Type); -{ +{ int res; INFO("grt_stack_switch\n"); INFO(" from 0x%08x to 0x%08x\n", From, To); @@ -172,7 +172,7 @@ void grt_stack_switch(Stack_Type To, Stack_Type From) // - resumes at lock below res = pthread_mutex_unlock (&To->mutex); assert (res == 0); - + // block until 'From' mutex becomes available again // as we are running, our mutex is locked and we block here // when stacks are switched, with above unlock, we may proceed @@ -187,7 +187,7 @@ void grt_stack_switch(Stack_Type To, Stack_Type From) void grt_stack_delete(Stack_Type Stack) // Delete stack STACK, which must not be currently executed. // => procedure Stack_Delete (Stack : Stack_Type); -{ +{ INFO("grt_stack_delete\n"); } diff --git a/translate/grt/config/sparc.S b/translate/grt/config/sparc.S index 698d49eb4..0ffe412ed 100644 --- a/translate/grt/config/sparc.S +++ b/translate/grt/config/sparc.S @@ -1,5 +1,5 @@ /* GRT stack implementation for x86. - Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold. + Copyright (C) 2002 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ .file "sparc.S" diff --git a/translate/grt/config/times.c b/translate/grt/config/times.c index 7a6dd5d82..9c0b4ebba 100644 --- a/translate/grt/config/times.c +++ b/translate/grt/config/times.c @@ -1,5 +1,5 @@ /* GRT C bindings for time. - Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold. + Copyright (C) 2002 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ #include <sys/times.h> #include <unistd.h> diff --git a/translate/grt/config/win32.c b/translate/grt/config/win32.c index de09400ce..35322ba9f 100644 --- a/translate/grt/config/win32.c +++ b/translate/grt/config/win32.c @@ -1,5 +1,5 @@ /* GRT stack implementation for Win32 using fibers. - Copyright (C) 2005 Tristan Gingold. + Copyright (C) 2005 - 2014 Tristan Gingold. GHDL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,6 +15,13 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate generics from this + unit, or you link this unit with other files to produce an executable, + this unit does not by itself cause the resulting executable to be + covered by the GNU General Public License. This exception does not + however invalidate any other reasons why the executable file might be + covered by the GNU Public License. */ #include <windows.h> |