diff options
author | Matthias Jung <jungma@eit.uni-kl.de> | 2017-03-01 18:39:56 +0100 |
---|---|---|
committer | Matthias Jung <jungma@eit.uni-kl.de> | 2017-05-18 08:36:56 +0000 |
commit | aa651c7f8321bf96fc88f9a17285225000a753ec (patch) | |
tree | b13240008c970b47bd74a5007e68136155d272fc /ext/systemc/src/sysc/qt/md/powerpc.c | |
parent | 595e692de09e1b7cbc5f57ac01da299afc066fdd (diff) | |
download | gem5-aa651c7f8321bf96fc88f9a17285225000a753ec.tar.xz |
ext: Include SystemC 2.3.1 into gem5
In the past it happened several times that some changes in gem5 broke the
SystemC coupling. Recently Accelera has changed the licence for SystemC
from their own licence to Apache2.0, which is compatible with gem5.
However, SystemC usually relies on the Boost library, but I was able to
exchange the boost calls by c++11 alternatives. The recent SystemC version
is placed into /ext and is integrated into gem5's build system. The goal is
to integrate some SystemC tests for the CI in some following patches.
Change-Id: I4b66ec806b5e3cffc1d7c85d3735ff4fa5b31fd0
Reviewed-on: https://gem5-review.googlesource.com/2240
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'ext/systemc/src/sysc/qt/md/powerpc.c')
-rw-r--r-- | ext/systemc/src/sysc/qt/md/powerpc.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/ext/systemc/src/sysc/qt/md/powerpc.c b/ext/systemc/src/sysc/qt/md/powerpc.c new file mode 100644 index 000000000..fb374f3f2 --- /dev/null +++ b/ext/systemc/src/sysc/qt/md/powerpc.c @@ -0,0 +1,69 @@ +/* + * QuickThreads -- Threads-building toolkit. + * Copyright (c) 1993 by David Keppel + * + * Permission to use, copy, modify and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that the above copyright notice and this notice + * appear in all copies. This software is provided as a + * proof-of-concept and for demonstration purposes; there is no + * representation about the suitability of this software for any + * purpose. + */ + + +#include <stdarg.h> +#include "qt.h" + +// This static is used to find the end of the stack for variable + +static void *qt_sp_bottom_save; + +/* We actually don't know how the compiler accomodates arguments in the + * va_list. In some implementation (e.g. Linux PPC) we cannot scan the + * list as an array. To avoid this problem, this version of "qt_varg", + * retrieves arguments by means of the standard "va_arg" macro defined + * in stdargs.h. + * + * Notice that we still suppose that the number of arguments is given + * by nbytes/sizeof(qt_word_t) and we load the stack of "qt_vstart" + * assuming that all parameters are alligned to the size of qt_word_t. + * + * Marco Bucci <marco.bucci@inwind.it> + * December 2002 + */ + +/* + +qt_t *qt_vargs (qt_t *sp, int nbytes, void *vargs, + void *pt, qt_startup_t *startup, + qt_vuserf_t *vuserf, qt_cleanup_t *cleanup) + +*/ + + qt_t * +qt_vargs_stdarg (qt_t *sp, int nbytes, va_list vargs, + void *pt, qt_startup_t *startup, + qt_vuserf_t *vuserf, qt_cleanup_t *cleanup) + + + +{ + int i; + qt_word_t arg; + + sp = QUICKTHREADS_VARGS_MD0 (sp, nbytes); + + for ( i=0;i<(int)(nbytes/sizeof(qt_word_t)); i++) + { + arg = va_arg(vargs, qt_word_t); + QUICKTHREADS_SPUT (QUICKTHREADS_VARGS_ADJUST(sp), i, arg); + } + + QUICKTHREADS_VARGS_MD1 (QUICKTHREADS_VADJ(sp)); + QUICKTHREADS_SPUT (QUICKTHREADS_VADJ(sp), QUICKTHREADS_VARGT_INDEX, pt); + QUICKTHREADS_SPUT (QUICKTHREADS_VADJ(sp), QUICKTHREADS_VSTARTUP_INDEX, startup); + QUICKTHREADS_SPUT (QUICKTHREADS_VADJ(sp), QUICKTHREADS_VUSERF_INDEX, vuserf); + QUICKTHREADS_SPUT (QUICKTHREADS_VADJ(sp), QUICKTHREADS_VCLEANUP_INDEX, cleanup); + return ((qt_t *)QUICKTHREADS_VADJ(sp)); +} |