home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnuc / library / rcs / dsyscall.c,v < prev    next >
Encoding:
Text File  |  1992-07-04  |  1.9 KB  |  97 lines

  1. head    1.1;
  2. access;
  3. symbols
  4.     version39-41:1.1;
  5. locks;
  6. comment    @ *  @;
  7.  
  8.  
  9. 1.1
  10. date    92.05.14.19.55.40;    author mwild;    state Exp;
  11. branches;
  12. next    ;
  13.  
  14.  
  15. desc
  16. @debugging version of syscall(), can output tracing information
  17. @
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @/*
  26.  *  This file is part of ixemul.library for the Amiga.
  27.  *  Copyright (C) 1991, 1992  Markus M. Wild
  28.  *
  29.  *  This library is free software; you can redistribute it and/or
  30.  *  modify it under the terms of the GNU Library General Public
  31.  *  License as published by the Free Software Foundation; either
  32.  *  version 2 of the License, or (at your option) any later version.
  33.  *
  34.  *  This library is distributed in the hope that it will be useful,
  35.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  36.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  37.  *  Library General Public License for more details.
  38.  *
  39.  *  You should have received a copy of the GNU Library General Public
  40.  *  License along with this library; if not, write to the Free
  41.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  42.  *
  43.  *  $Id$
  44.  *
  45.  *  $Log$
  46.  */
  47.  
  48. #define syscall _syscall
  49. #define KERNEL
  50. #include "ixemul.h"
  51. #undef syscall
  52.  
  53. #define SYSTEM_CALL(func, vec) #func,
  54.  
  55. char *sys_call[] = { "bogous",
  56. #include <sys/syscall.def>
  57. };
  58. #undef SYSTEM_CALL
  59.  
  60. #include <sys/syscall.h>
  61.  
  62. typedef int (*intfunc)();
  63.  
  64. static int go = 0;
  65.  
  66. void
  67. reset_watchdog ()
  68. {
  69.   go = 0;
  70. }
  71.  
  72. int
  73. syscall (int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
  74. {
  75.   int result;
  76.  
  77. if (! ix.ix_translate_dots) go = 1;
  78.  
  79. #if 0
  80. if (a0 != SYS_sigsetmask)
  81. #endif
  82. if (go)
  83.   kprintf ("%s ($%lx, $%lx, $%lx, $%lx)\n", sys_call[a0], a1, a2, a3, a4);
  84.  
  85.   result = ((intfunc)((int)ixemulbase-(a0+4)*6))(a1, a2, a3, a4, a5, a6, a7, a8);
  86.  
  87. if (! ix.ix_translate_dots) go = 1;
  88.  
  89. #if 0
  90. if (a0 != SYS_sigsetmask)
  91. #endif
  92. if (go)
  93.   kprintf ("\t\t%s() returned $%lx.\n", sys_call[a0], result);
  94.   return result;
  95. }
  96. @
  97.