Changeset 21916 for trunk/include/_ras.h


Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/include/_ras.h

    r21301 r21916  
    1515#ifdef RAS
    1616
     17#ifdef __cplusplus
     18extern "C" {
     19#endif
     20
    1721/* The RAS subsystem initialization/deinitialization */
    1822
     
    2024                 HMODULE hmod                    /* the custom dll handle */
    2125             );
    22              
     26
    2327void WIN32API RasUninitialize (
    2428                  void
     
    3337                  ULONG cb                       /* size of event specific data */
    3438              );
    35              
     39
    3640/* RAS events */
    3741#define RAS_EVENT_Kernel32InitComplete  (1)
     
    4347typedef void WIN32API FNCLF (ULONG h);
    4448typedef void WIN32API FNWL (ULONG h, char *buf, ULONG buflen);
    45  
     49
    4650/* Tracked objects logging functions typedefs */
    47 typedef void WIN32API FNRASLOG_EXTERNAL (char *fmt, ...);
     51typedef void WIN32API_VA FNRASLOG_EXTERNAL (const char *fmt, ...);
    4852
    4953typedef ULONG WIN32API FNLOC (ULONG objident, ULONG objhandle, void *objdata, ULONG cbobjdata, FNRASLOG_EXTERNAL *pRasLog);
     
    6266void WIN32API RasRegisterObjectTracking (
    6367                  RAS_TRACK_HANDLE *ph,           /* returned handle */
    64                   char *objname,                  /* arbitrary distinguishable object name */
     68                  const char *objname,            /* arbitrary distinguishable object name */
    6569                  ULONG cbuserdata,               /* extra data size */
    6670                  ULONG flags,                    /* object tracking flags */
     
    6872                  FNCOC *pfnCompareObjectContent  /* custom function to compare two objects */
    6973              );
    70              
     74
    7175void WIN32API RasDeregisterObjectTracking (
    7276                  RAS_TRACK_HANDLE h              /* handle previously returned by RasRegisterObjectTracking */
    7377              );
    74              
     78
    7579ULONG WIN32API RasAddObject (                     /* returns unique object ident */
    7680                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
     
    7983                  ULONG cbobjdata                 /* size of object */
    8084              );
    81              
     85
    8286void WIN32API RasTrackMemAlloc (
    8387                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
    8488                  ULONG size
    8589              );
    86              
     90
    8791void WIN32API RasTrackMemRealloc (
    8892                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
     
    9094                  ULONG newsize
    9195              );
    92              
     96
    9397void WIN32API RasTrackMemFree (
    9498                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
    9599                  ULONG size
    96100              );
    97              
     101
    98102void WIN32API RasRemoveObject (
    99103                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
    100104                  ULONG objhandle                 /* distinctive handle of the object */
    101105              );
    102              
     106
    103107void WIN32API RasSetObjectUserData (
    104108                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
     
    108112                  ULONG *pcbdataret               /* returned size of data actually saved */
    109113              );
    110              
     114
    111115void WIN32API RasQueryObjectUserData (
    112116                  RAS_TRACK_HANDLE h,             /* handle previously returned by RasRegisterObjectTracking */
     
    127131
    128132/* RAS logging channels */
    129 typedef struct _RAS_LOG_CHANNEL;
    130133typedef struct _RAS_LOG_CHANNEL *RAS_LOG_CHANNEL_H;
    131134
     
    135138                  const char *filename             /* file name to log to */
    136139              );
    137              
     140
    138141void WIN32API RasWriteLogChannel (
    139142                  RAS_LOG_CHANNEL_H hchannel,      /* log channel handle returned by RasOpenLogChannel */
     
    147150
    148151/* RAS logging functions */
    149 void WIN32API RasLog (
    150                   char *fmt,                       /* 'printf' style format string */
    151                   ...
    152               );
    153 
    154 void WIN32API RasLogNoEOL (
    155                   char *fmt,                       /* 'printf' style format string */
     152void WIN32API_VA RasLog (
     153                  const char *fmt,                 /* 'printf' style format string */
     154                  ...
     155              );
     156
     157void WIN32API_VA RasLogNoEOL (
     158                  const char *fmt,                 /* 'printf' style format string */
    156159                  ...
    157160              );
     
    162165                  ULONG parm2                      /* message parameter 2 */
    163166              );
    164        
     167
    165168#define RAS_FLAG_LOG_OBJECTS (0x1)
    166169
     
    170173              );
    171174
    172 void WIN32API RasLog2 (
     175void WIN32API_VA RasLog2 (
    173176                  RAS_LOG_CHANNEL_H hchannel,      /* log channel to log to */
    174177                  char *fmt,                       /* 'printf' style format string */
     
    176179              );
    177180
    178 void WIN32API RasLogNoEOL2 (
     181void WIN32API_VA RasLogNoEOL2 (
    179182                  RAS_LOG_CHANNEL_H hchannel,      /* log channel to log to */
    180                   char *fmt,                       /* 'printf' style format string */ 
     183                  char *fmt,                       /* 'printf' style format string */
    181184                  ...
    182185              );
     
    188191                  ULONG parm2                      /* message parameter 2 */
    189192              );
    190        
     193
    191194/* RAS replacement for C runtime sprintf function */
     195#ifdef __GNUC__
     196int WIN32API_VA ras_snprintf (
     197#else
    192198int WIN32API snprintf (
     199#endif
    193200                  char *buf,                       /* memory buffer for formatted string */
    194201                  int n,                           /* length of memeory buffer */
    195                   const char *fmt,                 /* 'printf' style format string */ 
     202                  const char *fmt,                 /* 'printf' style format string */
    196203                  ...
    197204             );
    198              
     205
    199206/* Tracked object counting function */
    200207void WIN32API RasCountObjects (
     
    215222 * any external API (OS/2 and or C runtime functions).
    216223 */
    217  
     224
    218225typedef struct _RASCONTEXT
    219226{
     
    238245              );
    239246
     247#ifdef __cplusplus
     248} // extern "C"
     249#endif
    240250
    241251/* RAS entries that are passed to plugin to use
     
    245255    ULONG cb;
    246256
    247     void  (* WIN32API RasRegisterObjectTracking) (RAS_TRACK_HANDLE *ph, char *objname, ULONG cbuserdata, ULONG flags, FNLOC *pfnLogObjectContent, FNCOC *pfnCompareObjectContent);
     257    void  (* WIN32API RasRegisterObjectTracking) (RAS_TRACK_HANDLE *ph, const char *objname, ULONG cbuserdata, ULONG flags, FNLOC *pfnLogObjectContent, FNCOC *pfnCompareObjectContent);
    248258    void  (* WIN32API RasDeregisterObjectTracking) (RAS_TRACK_HANDLE h);
    249259    ULONG (* WIN32API RasAddObject) (RAS_TRACK_HANDLE h, ULONG objhandle, void *objdata, ULONG cbobjdata);
     
    256266    void  (* WIN32API RasWriteLogChannel) (RAS_LOG_CHANNEL_H hchannel, const char *msg, ULONG length);
    257267    void  (* WIN32API RasCloseLogChannel) (RAS_LOG_CHANNEL_H hchannel);
    258     void  (* WIN32API RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
    259     void  (* WIN32API RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
     268    void  (* WIN32API_VA RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
     269    void  (* WIN32API_VA RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
    260270    void  (* WIN32API RasLogMsg) (RAS_LOG_CHANNEL_H hchannel, ULONG msg, ULONG parm1, ULONG parm2);
    261     int   (* WIN32API snprintf) (char *buf, int n, const char *fmt, ...);
     271    int   (* WIN32API_VA snprintf) (char *buf, int n, const char *fmt, ...);
    262272    void  (* WIN32API RasSaveContext) (RASCONTEXT *pcontext);
    263273    void  (* WIN32API RasRestoreContext) (RASCONTEXT *pcontext);
     
    269279    void  (* WIN32API RasTrackMemFree) (RAS_TRACK_HANDLE h, ULONG size);
    270280    RAS_TRACK_HANDLE (* WIN32API RasGetTrackHandle) (const char *objname);
    271              
     281
    272282} RasEntryTable;
    273283
     
    286296
    287297/* RAS breakpoint support */
     298#if defined(__GNUC__)
     299#include <sys/builtin.h>
     300#else
    288301#include <builtin.h>
     302#endif
    289303
    290304#ifdef __cplusplus
     
    299313#define RasDebugInt3_x(a, b, c) RasBreakPoint(__FILE__, __FUNCTION__, __LINE__, a, b, c)
    300314
    301 void __INLINE RasBreakPoint (char *szFile, char *szFunction, int iLine, ULONG msg, ULONG parm1, ULONG parm2)
     315void __INLINE RasBreakPoint (const char *szFile, const char *szFunction, int iLine, ULONG msg, ULONG parm1, ULONG parm2)
    302316{
    303317    RasLog ("BreakPoint at %s(%d)::%s", szFile, iLine, szFunction);
Note: See TracChangeset for help on using the changeset viewer.