[PATCH v3 1/4] ntdll: Fix the calling convention for runtime 64-bit shift functions.

Dmitry Timoshkov dmitry at baikal.ru
Thu Jul 7 09:44:15 CDT 2022


Zebediah Figura <zfigura at codeweavers.com> wrote:

> On 7/7/22 07:37, Dmitry Timoshkov wrote:
> > Jinoh Kang <jinoh.kang.kr at gmail.com> wrote:
> > 
> >>>> -@ stdcall -arch=i386 -ret64 _aullshr(int64 long)
> >>>> +@ cdecl -arch=i386 -norelay -ret64 _aullshr(int64 long)
> >>>>   @ cdecl -arch=i386 -norelay _chkstk()
> >>>>   @ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr)
> >>>>   @ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr)
> >>>
> >>> According to the tests these APIs use stdcall calling convention,
> >>
> >> The functions are neither cdecl nor stdcall.  They use a custom calling convention where
> >> arguments are passed in the order EAX (low 32-bit), EDX (high 32-bit), and ECX (shift amount).
> > 
> > Thanks for pointing that out.
> > 
> >>> what is the reason to change them to cdecl in the spec? Existing
> >>> spec entries also break that rule though...
> >>
> >> Because the functions don't really "pop off" arguments from the stack.
> > 
> > I'd guess by the same logic they shouldn't be marked as cdecl either.
> > However for -norelay entries that doesn't really matter.
> > 
> 
> I changed them to cdecl for consistency with the others.

I should have guessed that might be the case. Thanks for the explanation.

-- 
Dmitry.



More information about the wine-devel mailing list