home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / strmdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  1.5 KB  |  86 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_STRMDEP_H
  11. #define _SYS_STRMDEP_H
  12.  
  13. #ident    "@(#)/usr/include/sys/strmdep.h.sl 1.1 4.0 12/08/90 54733 AT&T-USL"
  14.  
  15. /*
  16.  * This file contains all machine-dependent declarations
  17.  * in STREAMS.
  18.  */
  19.  
  20. /*
  21.  * Copy data from one data buffer to another.
  22.  * The addresses must be word aligned - if not, use bcopy!
  23.  */
  24.  
  25. #if defined(u3b2) && !defined(lint)
  26.  
  27. /*
  28.  * Use the MOVBLW instruction on the 3b2.  
  29.  */
  30. asm    void
  31. strbcpy(s, d, c)
  32. {
  33. %mem    s,d,c;
  34.     
  35.     MOVW    s,%r0
  36.     MOVW    d,%r1
  37.     MOVW    c,%r2
  38.     ADDW2    &3,%r2
  39.     LRSW3    &2,%r2,%r2
  40.     MOVBLW
  41. }
  42.  
  43. #else
  44.  
  45. #define    strbcpy(s, d, c)    bcopy(s, d, c)
  46.  
  47. #endif
  48.  
  49. /*
  50.  * save the address of the calling function on the 3b2 to
  51.  * enable tracking of who is allocating message blocks
  52.  */
  53.  
  54. #if defined (u3b2) && !defined(lint)
  55.  
  56. asm    void
  57. saveaddr(funcp)
  58. {
  59. %mem    funcp;
  60.  
  61.     MOVW    -36(%fp),*funcp
  62. }
  63.  
  64. #else
  65.  
  66. #define saveaddr(funcp)
  67.  
  68. #endif
  69.  
  70. /*
  71.  * macro to check pointer alignment
  72.  * (true if alignment is sufficient for worst case)
  73.  */
  74. #ifdef u3b2
  75.  
  76. #define str_aligned(X)    (((uint)(X) & 03) == 0)
  77.  
  78. #else
  79.  
  80. #define str_aligned(X)    (((uint)(X) & (sizeof(int) - 1)) == 0)
  81.  
  82. #endif
  83.  
  84.  
  85. #endif    /* _SYS_STRMDEP_H */
  86.