Jump to content

DevHlp SysTrace

From EDM2
Revision as of 01:02, 8 October 2018 by Ak120 (talk | contribs)

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

Syntax

C

DevHlp_SysTrace ( USHORT Major, USHORT Minor, USHORT Size, PBYTE Datar )

Assembler

Calling Sequence in Assembler

    MOV    AX, Major Code
    MOV    BX, Length
    MOV    CX, Minor Code

    LDS    SI, Data

    MOV    DL, 28H

    CALL   [Device_Help]

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.

Assembler

MOV    AX, Major Code
MOV    BX, Length
MOV    CX, Minor Code

Return Code

C

  • Success indicator 0.

Possible errors

  • Data not traced, e.g., 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_SysTrace to ensure that the major event specified is currently enabled for tracing. This array is located in the Global InfoSegAll registers are preserved.

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

DevHlp_SysTrace is synonymous with DevHlp_RAS.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHlp_SysTrace ( USHORT Major, USHORT Minor, USHORT Size, PBYTE Datar )

Assembler

    MOV    AX, Major Code
    MOV    BX, Length
    MOV    CX, Minor Code

    LDS    SI, Data

    MOV    DL, 28H

    CALL   [Device_Help]

Related Functions