home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / log.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.2 KB  |  100 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_LOG_H
  11. #define _SYS_LOG_H
  12.  
  13. #ident    "@(#)/usr/include/sys/log.h.sl 1.1 4.0 12/08/90 1567 AT&T-USL"
  14. /*
  15.  * Header file for the Streams Log Driver
  16.  */
  17.  
  18. /*
  19.  * Minor devices for the log driver.
  20.  * 0 through 5 are reserved for well-known entry points.
  21.  * Minors above CLONEMIN are given out on clone opens.
  22.  */
  23. #define CONSWMIN    0    /* minor device to write to console log */
  24. #define CLONEMIN    5    /* minor device of clone interface */
  25.  
  26. struct log {
  27.     unsigned log_state;
  28.     queue_t *log_rdq;
  29.     mblk_t    *log_tracemp;
  30. };
  31.  
  32. /*
  33.  * Driver state values.
  34.  */
  35. #define LOGOPEN     0x01
  36. #define LOGERR        0x02
  37. #define LOGTRC        0x04
  38. #define LOGCONS        0x08
  39.  
  40. /* 
  41.  * Module information structure fields
  42.  */
  43. #define LOG_MID        44
  44. #define LOG_NAME    "LOG"
  45. #define LOG_MINPS    0
  46. #define LOG_MAXPS    128
  47. #define LOG_HIWAT    4096
  48. #define LOG_LOWAT    256
  49.  
  50. extern struct log log_log[];    /* log device state table */
  51. extern int log_cnt;        /* number of configured minor devices */
  52.  
  53. /*
  54.  * STRLOG(mid,sid,level,flags,fmt,args) should be used for those trace
  55.  * calls that are only to be made during debugging.
  56.  */
  57. #if defined(DEBUG) || defined(lint)
  58. #define STRLOG    strlog
  59. #else
  60. #define STRLOG    0 && strlog
  61. #endif
  62.  
  63.  
  64. /*
  65.  * Utility macros for strlog.
  66.  */
  67.  
  68. /*
  69.  * logadjust - move a character pointer up to the next int boundary after
  70.  * its current value.  Assumes sizeof(int) is 2**n bytes for some integer n. 
  71.  */
  72. #define logadjust(wp) (char *)(((unsigned)wp + sizeof(int)) & ~(sizeof(int)-1))
  73.  
  74. /*
  75.  * logstrcpy(dp, sp) copies string sp to dp.
  76.  */
  77.  
  78. #ifdef u3b2
  79. asm     char *
  80. logstrcpy(dp, sp) 
  81. {
  82. %    mem dp, sp;
  83.  
  84.     MOVW dp,%r1
  85.     MOVW sp,%r0
  86.     STRCPY
  87.     MOVW %r1,dp
  88.     MOVW %r0,sp
  89. }
  90. #else    /* !u3b2 */
  91. /*
  92.  * This is a catchall definition for those processors that have not had
  93.  * this coded in assembler above.
  94.  */
  95. #define logstrcpy(dp, sp)  for (; (*dp = *sp) != 0; dp++, sp++)
  96. #endif
  97.     
  98.  
  99. #endif    /* _SYS_LOG_H */
  100.