Jump to content

MFSH PHYSTOVIRT: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:MFSH_PHYSTOVIRT}} Translate the physical address of a data buffer into a virtual address. ==Syntax== int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel) ==P..."
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:MFSH_PHYSTOVIRT}}
{{DISPLAYTITLE:MFSH_PHYSTOVIRT}}
Translate the physical address of a data buffer into a virtual address.  
Translate the physical address of a data buffer into a virtual address.
 
==Syntax==
==Syntax==
  int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel)
  int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel)
==Parameters==
==Parameters==
; ulAddr: is the physical address to be translated.  
;ulAddr: is the physical address to be translated.
; usLen: is the length of the segment for the physical address.  
;usLen: is the length of the segment for the physical address.
; pusSel: is a pointer to the word in which the selector or segment is returned .  
;pusSel: is a pointer to the word in which the selector or segment is returned.


==Returns==
==Returns==
If an error is not detected, a zero error code is returned. If an error is detected, the following error is returned:  
If an error is not detected, a zero error code is returned. If an error is detected, the following error is returned:
; ERROR_PROTECTION_VIOLATION :the supplied address is invalid.  
;ERROR_PROTECTION_VIOLATION :the supplied address is invalid.


==Sample==
==Sample==
Line 20: Line 22:


==Remarks==
==Remarks==
This helper is for use by a mini-FSD with an imbedded device driver. It is the same as the standard device driver helper PHYSTOVIRT. A segment/offset pair is returned in real mode for addresses below the 1-Meg boundary. Else a selector/offset pair is returned.  
This helper is for use by a mini-FSD with an imbedded device driver. It is the same as the standard device driver helper PHYSTOVIRT. A segment/offset pair is returned in real mode for addresses below the 1-Meg boundary. Else a selector/offset pair is returned.


A caller must issue a corresponding UNPHYSTOVIRT before returning to its caller or using any other helpers.
A caller must issue a corresponding UNPHYSTOVIRT before returning to its caller or using any other helpers.


[[Category:IFS]]
[[Category:IFS Interfaces]]

Latest revision as of 21:35, 20 November 2019

Translate the physical address of a data buffer into a virtual address.

Syntax

int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel)

Parameters

ulAddr
is the physical address to be translated.
usLen
is the length of the segment for the physical address.
pusSel
is a pointer to the word in which the selector or segment is returned.

Returns

If an error is not detected, a zero error code is returned. If an error is detected, the following error is returned:

ERROR_PROTECTION_VIOLATION
the supplied address is invalid.

Sample

unsigned long ulAddr;
unsigned short usLen;
unsigned short far * pusSel;

int far pascal MFSH_PHYSTOVIRT(ulAddr, usLen, pusSel)

Remarks

This helper is for use by a mini-FSD with an imbedded device driver. It is the same as the standard device driver helper PHYSTOVIRT. A segment/offset pair is returned in real mode for addresses below the 1-Meg boundary. Else a selector/offset pair is returned.

A caller must issue a corresponding UNPHYSTOVIRT before returning to its caller or using any other helpers.