qt.c

Go to the documentation of this file.
00001 #include "copyright.h"
00002 #include "qt.h"
00003 
00004 static void *qt_sp_bottom_save;
00005 
00006 #ifdef QT_VARGS_DEFAULT
00007 
00008 /* If the stack grows down, `vargs' is a pointer to the lowest
00009    address in the block of arguments.  If the stack grows up, it is a
00010    pointer to the highest address in the block. */
00011 
00012   qt_t *
00013 qt_vargs (qt_t *sp, int nbytes, void *vargs,
00014       void *pt, qt_startup_t *startup,
00015       qt_vuserf_t *vuserf, qt_cleanup_t *cleanup)
00016 {
00017   int i;
00018 
00019   sp = QT_VARGS_MD0 (sp, nbytes);
00020 #ifdef QT_GROW_UP
00021     for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
00022       QT_SPUT (QT_VARGS_ADJUST(sp), i, ((qt_word_t *)vargs)[-i]);
00023     }
00024 #else
00025     for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
00026       QT_SPUT (QT_VARGS_ADJUST(sp), i-1, ((qt_word_t *)vargs)[i-1]);
00027     }
00028 #endif
00029 
00030   QT_VARGS_MD1 (QT_VADJ(sp));
00031   QT_SPUT (QT_VADJ(sp), QT_VARGT_INDEX, pt);
00032   QT_SPUT (QT_VADJ(sp), QT_VSTARTUP_INDEX, startup);
00033   QT_SPUT (QT_VADJ(sp), QT_VUSERF_INDEX, vuserf);
00034   QT_SPUT (QT_VADJ(sp), QT_VCLEANUP_INDEX, cleanup);
00035   return ((qt_t *)QT_VADJ(sp));
00036 }
00037 #endif /* def QT_VARGS_DEFAULT */
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 #endif
00042   void
00043 qt_null (void)
00044 {
00045 }
00046 
00047 #ifdef __cplusplus
00048 extern "C"
00049 #endif
00050   void
00051 qt_error (void)
00052 {
00053   extern void abort(void);
00054 
00055   abort();
00056 }

Generated on Wed Jan 21 15:32:10 2009 for SystemC by  doxygen 1.5.5