home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / jreheadf.zip / ras.h < prev   
Text File  |  2002-09-19  |  6KB  |  178 lines

  1. /*
  2.  * @(#)src/contract/ras/sov/ras.h, xs131, xs131, 20020822 1.13.2.1
  3.  * ===========================================================================
  4.  * Licensed Materials - Property of IBM
  5.  *
  6.  * IBM Java(tm)2 SDK, Standard Edition, v 1.3.1
  7.  * (C) Copyright IBM Corp. 1998, 2001. All Rights Reserved
  8.  * US Government Users Restricted Rights - Use, duplication or disclosure
  9.  * restricted by GSA ADP Schedule Contract with IBM Corp.
  10.  * ===========================================================================
  11.  */
  12.  
  13. /*
  14.  *
  15.  * ===========================================================================
  16.  *
  17.  *
  18.  *
  19.  * ===========================================================================
  20.  * Module Information:
  21.  *
  22.  * DESCRIPTION:
  23.  * RAS header file for use in all core libraries that use any of the facilities
  24.  * provided by the Diagnostics subcomponent of the JVM.
  25.  * ===========================================================================
  26.  */
  27. #ifndef _IBM_RAS_H_
  28. #define _IBM_RAS_H_
  29.  
  30. /*
  31.  * ======================================================================
  32.  * Allow for inclusion in C++
  33.  * ======================================================================
  34.  */
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. /*
  40.  * ======================================================================
  41.  * Forward declarations
  42.  * ======================================================================
  43.  */
  44.  
  45. struct DgTrcExecStruct;
  46. typedef struct DgTrcExecStruct DgTrcExec;
  47. struct rasHpiInterface;
  48. typedef struct rasHpiInterface RasHpiInterface;
  49. struct rasJniInterface;
  50. typedef struct rasJniInterface RasJniInterface;
  51.  
  52. /*
  53.  * ======================================================================
  54.  * RasInfo structures
  55.  * ======================================================================
  56.  */
  57. typedef struct RasInfo {
  58.     int  type;
  59.     union {
  60.  
  61.         struct {
  62.             int    number;
  63.             char **names;
  64.         } query;
  65.  
  66.         struct {
  67.             int    number;
  68.             char **names;
  69.         } trace_components;
  70.  
  71.         struct {
  72.             char          *name;
  73.             int            first;
  74.             int            last;
  75.             unsigned char *bitMap;
  76.         } trace_component;
  77.     } info;
  78. } RasInfo;
  79.  
  80. #define RASINFO_TYPES               0
  81. #define RASINFO_TRACE_COMPONENTS    1
  82. #define RASINFO_TRACE_COMPONENT     2
  83. #define RASINFO_MAX_TYPES           2
  84.  
  85. /*
  86.  * ======================================================================
  87.  * External access facade
  88.  * ======================================================================
  89.  */
  90. #define JVMRAS_VERSION_1_1      0x7F000001
  91.  
  92. typedef struct DgRasInterface {
  93.     char    eyecatcher[4];
  94.     int     length;
  95.     int     version;
  96.     int     modification;
  97.     int     (JNICALL *TraceRegister)(JNIEnv *env,
  98.                                      void (JNICALL *func)(JNIEnv *env2,
  99.                              void **threadLocal, int traceId,
  100.                              const char * format, va_list var));
  101.     int     (JNICALL *TraceDeregister)(JNIEnv *env,
  102.                                        void (JNICALL *func)(JNIEnv *env2,
  103.                                void **threadLocal, int traceId,
  104.                                const char * format, va_list var));
  105.     int     (JNICALL *TraceSet)(JNIEnv *env, const char *);
  106.     void    (JNICALL *TraceSnap)(JNIEnv *env, char *);
  107.     void    (JNICALL *TraceSuspend)(JNIEnv *env);
  108.     void    (JNICALL *TraceResume)(JNIEnv *env);
  109.     int     (JNICALL *GetRasInfo)(JNIEnv * env, RasInfo * info_ptr);
  110.     int     (JNICALL *ReleaseRasInfo)(JNIEnv * env, RasInfo * info_ptr);
  111.     int     (JNICALL *DumpRegister)(JNIEnv *env,
  112.                                     int (JNICALL *func)(JNIEnv *env2,
  113.                                                         void **threadLocal,
  114.                                                         int reason));
  115.     int     (JNICALL *DumpDeregister)(JNIEnv *env,
  116.                                       int (JNICALL *func)(JNIEnv *env2,
  117.                                                           void **threadLocal,
  118.                                                           int reason));
  119.     void    (JNICALL *NotifySignal)(JNIEnv *env, int signal);
  120. } DgRasInterface;
  121.  
  122. /*
  123.  * ======================================================================
  124.  *    Dump exit return codes
  125.  * ======================================================================
  126.  */
  127.  
  128. #define RAS_DUMP_CONTINUE   0         /* Continue with diagnostic collection */
  129. #define RAS_DUMP_ABORT      1         /* No more diagnostics should be taken */
  130.  
  131. /*
  132.  * ======================================================================
  133.  *    RAS structure header
  134.  * ======================================================================
  135.  */
  136.  
  137. typedef struct RasDataHeader {
  138.     char eyecatcher[4];
  139.     int length;
  140.     int version;
  141.     int modification;
  142. } RasDataHeader;
  143.  
  144.  
  145. /*
  146.  * ======================================================================
  147.  * Function prototypes
  148.  * ======================================================================
  149.  */
  150.  
  151. int  JNICALL rasTraceRegister(JNIEnv *env , void (JNICALL *func)(JNIEnv *env2,
  152.                         void **threadLocal, int traceId,
  153.                         const char * format, va_list varargs));
  154. int  JNICALL rasTraceDeregister(JNIEnv *env ,
  155.                                    void (JNICALL *func)(JNIEnv *env2,
  156.                           void **threadLocal, int traceId,
  157.                           const char * format, va_list varargs));
  158. int  JNICALL rasGetRasInfo(JNIEnv * env, RasInfo * info_ptr);
  159. int  JNICALL rasReleaseRasInfo(JNIEnv * env, RasInfo * info_ptr);
  160.  
  161.  
  162. /*
  163.  * ======================================================================
  164.  * Facade access macros
  165.  * ======================================================================
  166.  */
  167.  
  168. #define RAS_FACADE(env) dgTrcExec.rasTrcIntf->
  169.  
  170. #ifdef __cplusplus
  171. } /* extern "C" */
  172. #endif
  173. #endif /* !_IBM_RAS_H_ */
  174.  
  175. /*
  176.  * End of file
  177.  */
  178.