Correct the patch table entries for the 64-bit intrinsic math

routines (_alldiv(), _allmul(), _alludiv(), _aullmul(), etc...)
that use the _stdcall calling convention.

These routines all take two arguments, but the arguments are 64 bits wide.
On the i386 this means they each consume two 32-bit slots on the stack.
Consequently, when we specify the argument count in the IMPORT_SFUNC()
macro, we have to lie and claim there are 4 arguments instead of two.
This will cause the resulting i386 assembly wrapper to push the right
number of longwords onto the stack.

This fixes a crash I discovered with the RealTek 8180 driver, which
uses these routines a lot during initialization.
This commit is contained in:
Bill Paul 2005-05-08 09:16:33 +00:00
parent 162bc322c8
commit 0ad8336bc5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145999

View File

@ -3273,14 +3273,14 @@ image_patch_table ntoskrnl_functbl[] = {
IMPORT_SFUNC(IoInitializeIrp, 3),
IMPORT_SFUNC(KeWaitForSingleObject, 5),
IMPORT_SFUNC(KeWaitForMultipleObjects, 8),
IMPORT_SFUNC(_allmul, 2),
IMPORT_SFUNC(_alldiv, 2),
IMPORT_SFUNC(_allrem, 2),
IMPORT_SFUNC(_allmul, 4),
IMPORT_SFUNC(_alldiv, 4),
IMPORT_SFUNC(_allrem, 4),
IMPORT_RFUNC(_allshr, 0),
IMPORT_RFUNC(_allshl, 0),
IMPORT_SFUNC(_aullmul, 2),
IMPORT_SFUNC(_aulldiv, 2),
IMPORT_SFUNC(_aullrem, 2),
IMPORT_SFUNC(_aullmul, 4),
IMPORT_SFUNC(_aulldiv, 4),
IMPORT_SFUNC(_aullrem, 4),
IMPORT_RFUNC(_aullshr, 0),
IMPORT_RFUNC(_aullshl, 0),
IMPORT_CFUNC(atoi, 0),