| /* | |
| * android Unix library wrapper | |
| * | |
| * Copyright 2025 Google | |
| * | |
| * This library is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU Lesser General Public | |
| * License as published by the Free Software Foundation; either | |
| * version 2.1 of the License, or (at your option) any later version. | |
| * | |
| * This library is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| * Lesser General Public License for more details. | |
| * | |
| * You should have received a copy of the GNU Lesser General Public | |
| * License along with this library; if not, write to the Free Software | |
| * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA | |
| * | |
| */ | |
| #if 0 | |
| #pragma makedep unix | |
| #endif | |
| #include "config.h" | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include "unixlib.h" | |
| #include <android/trace.h> | |
| static NTSTATUS atrace_beginsection( void *args ) | |
| { | |
| struct atrace_beginsection_params *params = args; | |
| ATrace_beginSection( params->name ); | |
| return 0; | |
| } | |
| static NTSTATUS atrace_endsection( void *args ) | |
| { | |
| ATrace_endSection(); | |
| return 0; | |
| } | |
| static NTSTATUS atrace_setcounter( void *args ) | |
| { | |
| struct setcounter_params *params = args; | |
| ATrace_setCounter( params->name, params->value ); | |
| return 0; | |
| } | |
| const unixlib_entry_t __wine_unix_call_funcs[] = | |
| { | |
| atrace_beginsection, | |
| atrace_endsection, | |
| atrace_setcounter, | |
| }; | |
| C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count ); | |
| #ifdef _WIN64 | |
| static NTSTATUS wow64_atrace_beginsection( void *args ) | |
| { | |
| struct atrace_beginsection_params32 *params32 = args; | |
| struct atrace_beginsection_params params = | |
| { | |
| ULongToPtr( params32->name ) | |
| }; | |
| return atrace_beginsection( ¶ms ); | |
| } | |
| static NTSTATUS wow64_atrace_setcounter( void *args ) | |
| { | |
| struct setcounter_params32 *params32 = args; | |
| struct setcounter_params params = | |
| { | |
| ULongToPtr( params32->name ), | |
| params32->value | |
| }; | |
| return atrace_setcounter( ¶ms ); | |
| } | |
| const unixlib_entry_t __wine_unix_call_wow64_funcs[] = | |
| { | |
| wow64_atrace_beginsection, | |
| atrace_endsection, | |
| wow64_atrace_setcounter, | |
| }; | |
| C_ASSERT( ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count ); | |
| #endif /* _WIN64 */ |