Jump to content

DevHelp RAS: Difference between revisions

From EDM2
Created page with "The DevHlp_RAS function provides a service for device drivers to add information to the System Trace buffer. ==Syntax== ===C=== <PRE> USHORT APIENTRY DevHelp_RAS (USHORT Ma..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
The DevHlp_RAS function provides a service for device drivers to add information to the System Trace buffer.  
{{DISPLAYTITLE:DevHelp_RAS}}
The DevHlp_RAS function provides a service for device drivers to add information to the System Trace buffer.


==Syntax==
==Syntax==
Line 25: Line 26:
==Parameters==
==Parameters==
===C===
===C===
; Major (USHORT)     : Major trace event code (240-255)
;Major (USHORT) : Major trace event code (240-255)
 
;Minor (USHORT) : Minor trace event code (0-255)
; Minor (USHORT)     : Minor trace event code (0-255)
;Size  (USHORT) : Length of the variable length area to be recorded (0-512)
 
;Data  (PBYTE) : Pointer to the area to be traced (address parameter)
; Size  (USHORT)     : Length of the variable length area to be recorded (0-512)
 
; Data  (PBYTE)     : Pointer to the area to be traced (address parameter)


===Assembler===
===Assembler===
Line 45: Line 43:


==Return Code==
==Return Code==
===C===
===C===
Success indicator: 0
Success indicator: 0
Line 70: Line 67:
The trace facility maintains an array of 32 bytes (256 bits), in which each bit represents a major event code. This array is updated each time the user enables or disables tracing of a major event. The device driver must check this array before calling DevHlp_RAS to ensure that the major event specified is currently enabled for tracing. This array is located in the Global InfoSeg.
The trace facility maintains an array of 32 bytes (256 bits), in which each bit represents a major event code. This array is updated each time the user enables or disables tracing of a major event. The device driver must check this array before calling DevHlp_RAS to ensure that the major event specified is currently enabled for tracing. This array is located in the Global InfoSeg.


All registers are preserved. Interrupts are disabled while the trace data is saved and then re-enabled if they were initially enabled.  
All registers are preserved. Interrupts are disabled while the trace data is saved and then re-enabled if they were initially enabled.


==Example Code==
==Example Code==

Revision as of 00:58, 8 October 2018

The DevHlp_RAS function provides a service for device drivers to add information to the System Trace buffer.

Syntax

C

USHORT APIENTRY DevHelp_RAS (USHORT  Major,
                             USHORT  Minor,
                             USHORT  Size,
                             PBYTE   Data);

Assembler

MOV   AX,MajorCode           ; major trace event code (240-255)
MOV   BX,Length              ; length of data area (0-512 bytes)
MOV   CX,MinorCode           ; minor trace event code (0-255)

LDS   SI,Data                ; pointer to trace data

MOV   DL,28H                 ; DevHlp_RAS function code

CALL  [Device_Help]          ; invoke device helper

Parameters

C

Major (USHORT)
Major trace event code (240-255)
Minor (USHORT)
Minor trace event code (0-255)
Size (USHORT)
Length of the variable length area to be recorded (0-512)
Data (PBYTE)
Pointer to the area to be traced (address parameter)

Assembler

MOV   AX,MajorCode           ; major trace event code (240-255)
MOV   BX,Length              ; length of data area (0-512 bytes)
MOV   CX,MinorCode           ; minor trace event code (0-255)

LDS   SI,Data                ; pointer to trace data

MOV   DL,28H                 ; DevHlp_RAS function code

Return Code

C

Success indicator: 0

Possible errors: Data not traced.

An example of when data would not be traced is if the major event code is not currently selected for tracing.

Assembler

   If CF = 0
       Trace record placed in trace buffer
   Else
       Data not traced

            Possible errors:
               Tracing suspended
               Minor code not being traced
               PID not being traced
               Trace overrun

Remarks

The trace facility maintains an array of 32 bytes (256 bits), in which each bit represents a major event code. This array is updated each time the user enables or disables tracing of a major event. The device driver must check this array before calling DevHlp_RAS to ensure that the major event specified is currently enabled for tracing. This array is located in the Global InfoSeg.

All registers are preserved. Interrupts are disabled while the trace data is saved and then re-enabled if they were initially enabled.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_RAS (USHORT  Major,
                             USHORT  Minor,
                             USHORT  Size,
                             PBYTE   Data);

Related Functions