Commit a06d60bd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winebuild: Factor out output_syscall_dispatcher.

parent a0a62463
......@@ -1425,28 +1425,11 @@ static int cmp_link_name( const void *e1, const void *e2 )
}
/* output the functions for system calls */
void output_syscalls( DLLSPEC *spec )
/* output dispatcher for system calls */
static void output_syscall_dispatcher( int count )
{
const unsigned int invalid_param = 0xc000000d; /* STATUS_INVALID_PARAMETER */
int i, count;
ORDDEF **syscalls = NULL;
for (i = count = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
if (!(odp->flags & FLAG_SYSCALL)) continue;
if (!syscalls) syscalls = xmalloc( (spec->nb_entry_points - i) * sizeof(*syscalls) );
syscalls[count++] = odp;
}
if (!count) return;
count = sort_func_list( syscalls, count, cmp_link_name );
output( "\n/* system calls */\n\n" );
output( "\t.text\n" );
if (unix_lib)
{
output( "\t.align %d\n", get_alignment(4) );
output( "\t%s\n", func_declaration("__wine_syscall_dispatcher") );
output( "%s\n", asm_globl("__wine_syscall_dispatcher") );
......@@ -1700,6 +1683,31 @@ void output_syscalls( DLLSPEC *spec )
}
output_cfi( ".cfi_endproc" );
output_function_size( "__wine_syscall_dispatcher" );
}
/* output the functions for system calls */
void output_syscalls( DLLSPEC *spec )
{
int i, count;
ORDDEF **syscalls = NULL;
for (i = count = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
if (!(odp->flags & FLAG_SYSCALL)) continue;
if (!syscalls) syscalls = xmalloc( (spec->nb_entry_points - i) * sizeof(*syscalls) );
syscalls[count++] = odp;
}
if (!count) return;
count = sort_func_list( syscalls, count, cmp_link_name );
output( "\n/* system calls */\n\n" );
output( "\t.text\n" );
if (unix_lib)
{
output_syscall_dispatcher( count );
output( "\t.data\n" );
output( "\t.align %d\n", get_alignment( get_ptr_size() ) );
......
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