home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / include / prof.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-19  |  2.2 KB  |  81 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _PROF_H
  12. #define _PROF_H
  13. #ident    "@(#)sgs-head:i386/head/prof.h    1.10.4.3"
  14.  
  15. #ifndef MARK
  16. #define MARK(K)    {}
  17. #else
  18. #undef MARK
  19.  
  20. #if #machine(i386)
  21. #define MARK(K)    {\
  22.         asm("    .data");\
  23.         asm("    .align 4");\
  24.         asm("."#K".:");\
  25.         asm("    .long 0");\
  26.         asm("    .text");\
  27.         asm("M."#K":");\
  28.         asm("    movl    $."#K".,%edx");\
  29.         asm("    call _mcount");\
  30.         }
  31. #elif #machine(m68k)
  32. #define MARK(K)    {\
  33.                 asm("   data");\
  34.                 asm("   align 4");\
  35.                 asm("K:");\
  36.                 asm("   long    0");\
  37.                 asm("   text");\
  38.                 asm("   pea    K");\
  39.                 asm("   jsr     mcount");\
  40.                 asm("   addq.l    4,%sp");\
  41.                 }
  42. #elif #machine(m88k)
  43. #define MARK(K)    {\
  44.                 asm("   data");\
  45.                 asm("   align 4");\
  46.                 asm("K:");\
  47.                 asm("   byte    0,0,0,0");\
  48.                 asm("   text");\
  49.                 asm("   subu    r31,r31,4");\
  50.                 asm("   st      r2,r31,0");\
  51.                 asm("   or.u    r2,r0,hi16(L)");\
  52.                 asm("   bsr.n   mcount");\
  53.                 asm("   or      r2,r2,lo16(L)");\
  54.                 asm("   ld    r2,r31,0");\
  55.                 asm("   addu    r31,r31,4");\
  56.                 }
  57. #elif #machine(sparc)            
  58. #define MARK(K) {\
  59.         asm("    .reserve    ."#K"., 4, \"data\", 4");\
  60.         asm("M."#K":");\
  61.         asm("    sethi    %hi(."#K".), %o0");\
  62.         asm("    call    .mcount");\
  63.         asm("    or    %o0, %lo(."#K".), %o0");\
  64.         }                
  65. #else /*Digital(?)*/
  66. #define MARK(K)    {\
  67.         asm("    .data");\
  68.         asm("    .align    4");\
  69.         asm("."#K".:");\
  70.         asm("    .word    0");\
  71.         asm("    .text");\
  72.         asm("M."#K":");\
  73.         asm("    movw    &."#K".,%r0");\
  74.         asm("    jsb    _mcount");\
  75.         }
  76. #endif /*#machine(...)*/
  77.  
  78. #endif /*MARK*/
  79.  
  80. #endif /*_PROF_H*/
  81.