winebuild: Add a -syscall entry point flag

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-07 10:36:19 +02:00
parent 1a72836c37
commit a0266339c7
4 changed files with 21 additions and 3 deletions

View File

@ -175,9 +175,10 @@ struct strarray
#define FLAG_REGISTER 0x0010 /* use register calling convention */
#define FLAG_PRIVATE 0x0020 /* function is private (cannot be imported) */
#define FLAG_ORDINAL 0x0040 /* function should be imported by ordinal */
#define FLAG_THISCALL 0x0080 /* use thiscall calling convention */
#define FLAG_FASTCALL 0x0100 /* use fastcall calling convention */
#define FLAG_IMPORT 0x0200 /* export is imported from another module */
#define FLAG_THISCALL 0x0080 /* function uses thiscall calling convention */
#define FLAG_FASTCALL 0x0100 /* function uses fastcall calling convention */
#define FLAG_SYSCALL 0x0200 /* function is a system call */
#define FLAG_IMPORT 0x0400 /* export is imported from another module */
#define FLAG_FORWARD 0x1000 /* function is a forwarded name */
#define FLAG_EXT_LINK 0x2000 /* function links to an external symbol */

View File

@ -545,6 +545,7 @@ static void check_undefined_exports( DLLSPEC *spec )
ORDDEF *odp = &spec->entry_points[i];
if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue;
if (odp->flags & FLAG_FORWARD) continue;
if (odp->flags & FLAG_SYSCALL) continue;
if (find_name( odp->link_name, &undef_symbols ))
{
switch(odp->type)
@ -587,6 +588,7 @@ static char *create_undef_symbols_file( DLLSPEC *spec )
ORDDEF *odp = &spec->entry_points[i];
if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue;
if (odp->flags & FLAG_FORWARD) continue;
if (odp->flags & FLAG_SYSCALL) continue;
output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name( get_link_name( odp )));
}
for (j = 0; j < extra_ld_symbols.count; j++)

View File

@ -70,6 +70,7 @@ static const char * const FlagNames[] =
"ordinal", /* FLAG_ORDINAL */
"thiscall", /* FLAG_THISCALL */
"fastcall", /* FLAG_FASTCALL */
"syscall", /* FLAG_SYCALL */
"import", /* FLAG_IMPORT */
NULL
};
@ -320,6 +321,14 @@ static int parse_spec_arguments( ORDDEF *odp, DLLSPEC *spec, int optional )
return 0;
}
}
if (odp->flags & FLAG_SYSCALL)
{
if (odp->type != TYPE_STDCALL)
{
error( "A syscall function must use the stdcall convention\n" );
return 0;
}
}
return 1;
}

View File

@ -338,6 +338,12 @@ The function uses the
calling convention (first two parameters in %ecx/%edx registers on
i386).
.TP
.B -syscall
The function is an NT system call. A system call thunk will be
generated, and the actual function will be called by the
\fI__wine_syscall_dispatcher\fR function that will be generated on the
Unix library side.
.TP
.B -import
The function is imported from another module. This can be used instead
of a