Jump to content

DevHelp RegisterStackUsage: Difference between revisions

From EDM2
Created page with "This service indicates the expected stack usage of the physical device driver to the interrupt manager. ==Syntax== ===C=== USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID..."
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
This service indicates the expected stack usage of the physical device driver to the interrupt manager.  
{{DISPLAYTITLE:DevHelp_RegisterStackUsage}}
This service indicates the expected stack usage of the physical device driver to the interrupt manager.


==Syntax==
==Syntax==
Line 15: Line 16:
==Parameters==
==Parameters==
===C===
===C===
; StackUsageData (PVOID)   : 14 byte structure
;StackUsageData (PVOID):14 byte structure
<PRE>
<PRE>
typedef struc _STACKUSAGEDATA
typedef struc _STACKUSAGEDATA
Line 42: Line 43:


==Return Code==
==Return Code==
===C===
===C===
Success Indicator: Clear if successful.
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.
Possible errors: Carry flag set if stack usage exceeds system maximum. If this happens, the physical device driver must uninstall itself.
 
===Assembler===
===Assembler===
<PRE>
<PRE>
Line 57: Line 58:
==Remarks==
==Remarks==
The StackUsage data structure has the following format:
The StackUsage data structure has the following format:
   StackUsage    STRUC
   StackUsage    STRUC
     SU_cbStruct  DW 14    ; Number of bytes in structure, including itself.
     SU_cbStruct  DW 14    ; Number of bytes in structure, including itself.
Line 74: Line 74:
                             ; driver expects to nest.
                             ; driver expects to nest.
   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==
Line 84: Line 86:
USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID StackUsageData )
USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID StackUsageData )
</PRE>
</PRE>
==Related Functions==


[[Category:DevHlps]]
[[Category:DevHlps]]

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 )