Jump to content

DevHelp RegisterStackUsage: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
No edit summary
 
Line 75: Line 75:
   StackUsage    ENDS
   StackUsage    ENDS
A device must issue RegisterStackUsage once for each IRQ that it services. OS/2 2.1 (and later) supports a total of 8KB of interrupt stack.
A device must issue RegisterStackUsage once for each IRQ that it services. OS/2 2.1 (and later) supports a total of 8KB of interrupt stack.
==Alternative Names==
DevHelp_RegisterStackUsage, DevHlp_RegisterStackUsage, DevHlp_RegStackUsage.


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

Latest revision as of 17:43, 23 May 2025

This service indicates the expected stack usage of the physical device driver to the interrupt manager.

Syntax

C

USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID StackUsageData )

Assembler

MOV   BX,OFFSET DS:StackUsage
MOV   DL,DevHlp_RegisterStackUsage

CALL  [Device_Help]

Parameters

C

StackUsageData (PVOID)
14 byte structure
typedef struc _STACKUSAGEDATA
{
  USHORT Size;          /*  num of bytes in structure including itself (14) */
  USHORT Flags;         /*  Bit 0x0001 'on' indicates that the interrupt    */
                        /*  procedure enables interrupts.  All other bits   */
                        /*  are reserved.                                   */
  USHORT IRQLevel;      /*  IRQ of interrupt handler that is being described*/
                        /*  by the following data.                          */
  USHORT CLIStack;      /*  Number of bytes of stack used in the interrupt  */
                        /*  procedure when interrupts are disabled.         */
  USHORT STIStack;      /*  Number of bytes of stack used after interrupt   */
                        /*  procedure enables interrupts.                   */
  USHORT EOIStack;      /*  Number of bytes of stack used after interrupt   */
                        /*  procedure issues EOI.                           */
  USHORT NestingLevel;  /*  Maximum number of levels that the device driver */
                        /*  expects to nest.                                */
} STACKUSAGEDATA;

Assembler

MOV   BX,OFFSET DS:StackUsage

Return Code

C

Success Indicator: Clear if successful.

Possible errors: Carry flag set if stack usage exceeds system maximum. If this happens, the physical device driver must uninstall itself.

Assembler

   'C' Clear if successful.

   'C' Set if stack usage exceeds system maximum.
       If this happens, the physical device driver must deinstall itself.

Remarks

The StackUsage data structure has the following format:

  StackUsage     STRUC
   SU_cbStruct   DW 14     ; Number of bytes in structure, including itself.
   SU_flags      DW ?      ; Bit 0x0001 'on' indicates that the interrupt
                           ; procedure enables interrupts.  All other bits
                           ; are reserved.
   SU_iIRQ       DW ?      ; IRQ of interrupt handler that is being
                           ; described by the following data.
   SU_cbStackCLI DW ?      ; Number of bytes of stack used in the
                           ; interrupt procedure when interrupts are disabled.
   SU_cbStackSTI DW ?      ; Number of bytes of stack used after interrupt
                           ; procedure enables interrupts.
   SU_cbStackEOI DW ?      ; Number of bytes of stack used after interrupt
                           ; procedure issues EOI.
   SU_cNest      DW ?      ; Maximum number of levels that the device
                           ; driver expects to nest.
  StackUsage     ENDS

A device must issue RegisterStackUsage once for each IRQ that it services. OS/2 2.1 (and later) supports a total of 8KB of interrupt stack.

Alternative Names

DevHelp_RegisterStackUsage, DevHlp_RegisterStackUsage, DevHlp_RegStackUsage.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID StackUsageData )