⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int31.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 4 页
字号:
.np
If the call fails, the carry flag is set and none of the memory will
be unlocked.
An error will be returned if the memory was not previously locked or
if the specified region is invalid.
.np
If the call succeeds, the carry flag is clear.
If the specified region overlaps part of a page at the beginning or
end of a region, the page(s) will be unlocked.
Even if the call succeeds, the memory will remain locked if the
lock count is not decremented to zero.
.*
.note Function 0604H
.*
.ix 'DPMI' 'get page size'
This function gets the page size for Virtual Memory (VM) only.
This function returns the size of a single memory page in bytes.
Pass the following information:
.begpoint $compact
.point AX = 0604H
.endpoint
.np
If the call succeeds, the carry flag is clear and BX:CX = Page size in
bytes.
.np
If the call fails, the carry flag is set.
.*
.endnote
.*
.section Demand Paging Performance Tuning Services
.*
.np
.ix 'DPMI' 'demand paging'
.ix 'page tuning services'
Some applications will discard memory objects or will not access
objects for long periods of time. These services can be used to
improve the performance of demand paging.
.np
Although these functions are only relevant for DPMI implementations
that support virtual memory, other implementations will ignore these
functions (it will always return carry clear). Therefore your code can
always call these functions regardless of the environment it is
running under.
.np
Since both of these functions are simply advisory functions, the
operating system may choose to ignore them. In any case, your code
should function properly even if the functions fail.
.begnote
.*
.note Function 0702H
.*
.ix 'DPMI' 'mark page'
(&dos4gprd Professional only)
This function marks a page as a demand paging candidate.
This function is used to inform the operating system that a range of
pages should be placed at the head of the page out candidate list.
This will force these pages to be swapped to disk ahead of other pages
even if the memory has been accessed recently. However, all memory
contents will be preserved.
.np
This is useful, for example, if a program knows that a given piece of
data will not be accessed for a long period of time. That data is
ideal for swapping to disk since the physical memory it now occupies
can be used for other purposes.
Pass the following information:
.begpoint $compact
.point AX = 0702H
.point BX:CX = Starting linear address of pages to mark
.point SI:DI = Number of bytes to mark as paging candidates
.endpoint
.np
If the call succeeds, the carry flag is clear; if it fails, the carry
flag is set.
.autonote Notes:
.note
This function does not force the pages to be swapped to disk
immediately.
.note
Partial pages will not be discarded.
.endnote
.*
.note Function 0703H
.*
.ix 'DPMI' 'discard page'
(&dos4gprd Professional only)
This function discards page contents.
This function discards the entire contents of a given linear memory
range. It is used after a memory object that occupied a given piece of
memory has been discarded.
.np
The contents of the region will be undefined the next time the memory
is accessed. All values previously stored in this memory will be lost.
Pass the following information:
.begpoint $compact
.point AX = 0703H
.point BX:CX = Starting linear address of pages to discard
.point SI:DI = Number of bytes to discard
.endpoint
.np
If the call succeeds, the carry flag is clear; if it fails, the carry
flag is set.
.autonote Notes:
.note
Partial pages will not be discarded.
.endnote
.*
.endnote
.*
.section Physical Address Mapping
.*
.np
Memory mapped devices such as network adapters and displays sometimes
have memory mapped at physical addresses that lie outside of the
normal 1Mb of memory that is addressable in real mode. Under many
implementations of DPMI, all addresses are linear addresses since they
use the paging mechanism of the 80386. This service can be used by
device drivers to convert a physical address into a linear address.
The linear address can then be used to access the device memory.
.begnote
.*
.note Function 0800H
.*
.ix 'DPMI' 'physical address mapping'
This function is used for Physical Address Mapping.
.np
Some implementations of DPMI may not support this call because it
could be used to circumvent system protection. This call should only
be used by programs that absolutely require direct access to a memory
mapped device.
.np
Pass the following information:
.begpoint $compact
.point AX = 0800H
.point BX:CX = Physical address of memory
.point SI:DI = Size of region to map in bytes
.endpoint
.np
If the call succeeds, the carry flag is clear and BX:CX = Linear
Address that can be used to access the physical memory.
.np
If the call fails, the carry flag is set.
.autonote Notes:
.note
Under DPMI implementations that do not use the 80386 paging mechanism,
the call will always succeed and the address returned will be
equal to the physical address parameter passed into this function.
.note
It is up to the caller to build an appropriate selector to access the
memory.
.note
Do not use this service to access memory that is mapped in the first
megabyte of address space (the real-mode addressable region).
.endnote
.*
.note Function 0801H
.*
.ix 'DPMI' 'free physical address mapping'
This function is used to free Physical Address Mapping.
Pass the following information:
.begpoint $compact
.point AX = 0801H
.point BX:CX = Linear address returned by Function 0800H.
.endpoint
.np
If the call succeeds, the carry flag is clear; if it fails, the carry
flag is set.
.autonote Notes:
.note
The client should call this function when it is finished using a
device previously mapped to linear addresses with the Physical Address
Mapping function (Function 0800H).
.endnote
.*
.endnote
.*
.section Virtual Interrupt State Functions
.*
.np
.ix 'DPMI' 'virtual interrupt state'
Under many implementations of DPMI, the interrupt flag in protected
mode will always be set (interrupts enabled). This is because the
program is running under a protected operating system that cannot
allow programs to disable physical hardware interrupts. However, the
operating system will maintain a "virtual" interrupt state for
protected-mode programs. When the program executes a CLI instruction,
the program's virtual interrupt state will be disabled, and the
program will not receive any hardware interrupts until it executes an
STI to reenable interrupts (or calls service 0901h).
.np
When a protected-mode program executes a PUSHF instruction, the real
processor flags will be pushed onto the stack. Thus, examining the
flags pushed on the stack is not sufficient to determine the state of
the program's virtual interrupt flag. These services enable programs
to get and modify the state of their virtual interrupt flag.
.np
The following sample code enters an interrupt critical section and
then restores the virtual interrupt state to it's previous state.
.code begin
;
; Disable interrupts and get previous interrupt state
;
        mov     ax, 0900h
        int     31h
;
; At this point AX = 0900h or 0901h
;
        .
        .
        .
;
; Restore previous state (assumes AX unchanged)
;
        int     31h
.code end
.begnote
.*
.note Function 0900H
.*
.ix 'DPMI' 'get and disable virtual interrupt state'
This function gets and disables Virtual Interrupt State.
This function will disable the virtual interrupt flag and return the
previous state of the virtual interrupt flag.
Pass the following information:
.begpoint $compact
.point AX = 0900H
.endpoint
.np
After the call, the carry flag is clear (this function always
succeeds) and virtual interrupts are disabled.
.illust begin
AL = 0 if virtual interrupts were previously disabled.
AL = 1 if virtual interrupts were previously enabled.
.illust end
.autonote Notes:
.note
AH will not be changed by this procedure. Therefore, to restore the
previous state, simply execute an Int 31h.
.endnote
.*
.note Function 0901H
.*
.ix 'DPMI' 'get and enable virtual interrupt state'
This function gets and enables the Virtual Interrupt State.
This function will enable the virtual interrupt flag and return the
previous state of the virtual interrupt flag.
Pass the following information:
.begpoint $compact
.point AX = 0901H
.endpoint
.np
After the call, the carry flag is clear (this function always
succeeds) and virtual interrupts are enabled.
.illust begin
AL = 0 if virtual interrupts were previously disabled.
AL = 1 if virtual interrupts were previously enabled.
.illust end
.autonote Notes:
.note
AH will not be changed by this procedure. Therefore, to restore the
previous state, simply execute an Int 31h.
.endnote
.*
.note Function 0902H
.*
.ix 'DPMI' 'get virtual interrupt state'
This function gets the Virtual Interrupt State.
This function will return the current state of the virtual interrupt
flag.
Pass the following information:
.begpoint $compact
.point AX = 0902H
.endpoint
.np
After the call, the carry flag is clear (this function always
succeeds).
.illust begin
AL = 0 if virtual interrupts are disabled.
AL = 1 if virtual interrupts are enabled.
.illust end
.*
.endnote
.*
.section Vendor Specific Extensions
.*
.np
.ix 'DPMI' 'vendor extensions'
Some DOS extenders provide extensions to the standard set of DPMI
calls. This call is used to obtain an address which must be called to
use the extensions. The caller points DS:ESI to a null terminated
string that specifies the vendor name or some other unique identifier
to obtain the specific extension entry point.
.begnote
.*
.note Function 0A00H
.*
.ix 'DPMI' 'get API entry point'
This function gets Tenberry Software's API Entry Point.
Pass the following information:
.begpoint $compact
.point AX = 0A00H
.point DS:ESI = Pointer to null terminated string "RATIONAL DOS/4G"
.endpoint
.np
If the call succeeds, the carry flag is clear and ES:EDI = Extended
API entry point.
DS, FS, GS, EAX, EBX, ECX, EDX, ESI, and EBP may be modified.
.np
If the call fails, the carry flag is set.
.autonote Notes:
.note
Execute a far call to call the API entry point.
.note
All extended API parameters are specified by the vendor.
.note
The string comparison used to return the API entry point is case
sensitive.
.endnote
.*
.endnote
.*
.section Coprocessor Status
.*
.begnote
.*
.note Function 0E00H
.*
.ix 'DPMI' 'get coprocessor status'
This function gets the coprocessor status.
Pass the following information:
.begpoint $compact
.point AX = 0E00H
.endpoint
.np
If the call succeeds, the carry flag is clear and AX contains the
coprocessor status.
.begnote $compact
:DTHD.Bit
:DDHD.Significance
.note 0
MPv (MP bit in the virtual MSW/CR0).
.br
0 = Numeric coprocessor is disabled for this client.
.br
1 = Numeric coprocessor is disabled for this client.
.note 1
EMv (EM bit in the virtual MSW/CR0).
.br
0 = Client is not emulating coprocessor instructions.
.br
1 = Client is emulating coprocessor instructions.
.note 2
MPr (MP bit from the actual MSW/CR0).
.br
0 = Numeric coprocessor is not present.
.br
1 = Numeric coprocessor is present.
.note 1
EMr (EM bit from the actual MSW/CR0).
.br
0 = Host is not emulating coprocessor instructions.
.br
1 = Host is emulating coprocessor instructions.
.note 4-7
Coprocessor type.
.illust begin
00H = no coprocessor.
02H = 80287
03H = 80387
04H = 80486 with numeric coprocessor
05H = Pentium
.illust end
.np
.note 8-15
Not applicable.
.endnote
.np
If the call fails, the carry flag is set.
.autonote Notes:
.note
If the real EM (EMr) bit is set, the host is supplying or is capable
of supplying floating-point emulation.
.note
If the MPv bit is not set, the host may not need to save the
coprocessor state for this virtual machine to improve system
performance.
.note
The MPr bit setting should be consistent with the setting of the
coprocessor type information. Ignore MPr bit information if it is in
conflict with the coprocessor type information.
.note
If the virtual EM (EMv) bit is set, the host delivers all coprocessor
exceptions to the client, and the client is performing its own
floating-point emulation (wether or not a coprocessor is present or
the host also has a floating-point emulator). In other words, if the
EMv bit is set, the host sets the EM bit in the real CR0 while the
virtual machine is active, and reflects coprocessor not present faults
(int 7) to the virtual machine.
.note
A client can determine the CPU type with int 31H Function 0400H, but a
client should not draw any conclusions about the presence or absence
of a coprocessor based on the CPU type alone.
.endnote
.*
.note Function 0E01H
.*
.ix 'DPMI' 'set coprocessor emulation'
This function sets coprocessor emulation.
Pass the following information:
.begpoint $compact
.point AX = 0E01H
.point BX = coprocessor bits
.begnote $compact
:DTHD.Bit
:DDHD.Significance
.note 0
New value of MPv bit for client's virtual CR0.
.br
0 = Disable numeric coprocessor for this client.
.br
1 = Enable numeric coprocessor for this client.
.note 1
New value of EMv bit for client's virtual CR0.
.br
0 = client will not supply coprocessor emulation.
.br
1 = client will supply coprocessor emulation.
.note 2-15
Not applicable.
.endnote
.endpoint
.np
If the call succeeds, the carry flag is clear; if it fails, the carry
flag is set.
.*
.endnote
.*
.endlevel

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -