Commit a0266339 authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Add a -syscall entry point flag

parent 1a72836c
...@@ -175,9 +175,10 @@ struct strarray ...@@ -175,9 +175,10 @@ struct strarray
#define FLAG_REGISTER 0x0010 /* use register calling convention */ #define FLAG_REGISTER 0x0010 /* use register calling convention */
#define FLAG_PRIVATE 0x0020 /* function is private (cannot be imported) */ #define FLAG_PRIVATE 0x0020 /* function is private (cannot be imported) */
#define FLAG_ORDINAL 0x0040 /* function should be imported by ordinal */ #define FLAG_ORDINAL 0x0040 /* function should be imported by ordinal */
#define FLAG_THISCALL 0x0080 /* use thiscall calling convention */ #define FLAG_THISCALL 0x0080 /* function uses thiscall calling convention */
#define FLAG_FASTCALL 0x0100 /* use fastcall calling convention */ #define FLAG_FASTCALL 0x0100 /* function uses fastcall calling convention */
#define FLAG_IMPORT 0x0200 /* export is imported from another module */ #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_FORWARD 0x1000 /* function is a forwarded name */
#define FLAG_EXT_LINK 0x2000 /* function links to an external symbol */ #define FLAG_EXT_LINK 0x2000 /* function links to an external symbol */
......
...@@ -545,6 +545,7 @@ static void check_undefined_exports( DLLSPEC *spec ) ...@@ -545,6 +545,7 @@ static void check_undefined_exports( DLLSPEC *spec )
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue; if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue;
if (odp->flags & FLAG_FORWARD) continue; if (odp->flags & FLAG_FORWARD) continue;
if (odp->flags & FLAG_SYSCALL) continue;
if (find_name( odp->link_name, &undef_symbols )) if (find_name( odp->link_name, &undef_symbols ))
{ {
switch(odp->type) switch(odp->type)
...@@ -587,6 +588,7 @@ static char *create_undef_symbols_file( DLLSPEC *spec ) ...@@ -587,6 +588,7 @@ static char *create_undef_symbols_file( DLLSPEC *spec )
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue; if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue;
if (odp->flags & FLAG_FORWARD) 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 ))); output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name( get_link_name( odp )));
} }
for (j = 0; j < extra_ld_symbols.count; j++) for (j = 0; j < extra_ld_symbols.count; j++)
......
...@@ -70,6 +70,7 @@ static const char * const FlagNames[] = ...@@ -70,6 +70,7 @@ static const char * const FlagNames[] =
"ordinal", /* FLAG_ORDINAL */ "ordinal", /* FLAG_ORDINAL */
"thiscall", /* FLAG_THISCALL */ "thiscall", /* FLAG_THISCALL */
"fastcall", /* FLAG_FASTCALL */ "fastcall", /* FLAG_FASTCALL */
"syscall", /* FLAG_SYCALL */
"import", /* FLAG_IMPORT */ "import", /* FLAG_IMPORT */
NULL NULL
}; };
...@@ -320,6 +321,14 @@ static int parse_spec_arguments( ORDDEF *odp, DLLSPEC *spec, int optional ) ...@@ -320,6 +321,14 @@ static int parse_spec_arguments( ORDDEF *odp, DLLSPEC *spec, int optional )
return 0; 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; return 1;
} }
......
...@@ -338,6 +338,12 @@ The function uses the ...@@ -338,6 +338,12 @@ The function uses the
calling convention (first two parameters in %ecx/%edx registers on calling convention (first two parameters in %ecx/%edx registers on
i386). i386).
.TP .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 .B -import
The function is imported from another module. This can be used instead The function is imported from another module. This can be used instead
of a of a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment