winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
472 discussions
Start a n
N
ew thread
Alexandre Julliard : configure: Default to Thumb-2 mode for ARM.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 405e128b0b3a9661bd3db59608cd9a44f4ff9810 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=405e128b0b3a9661bd3db596…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:44:46 2021 +0100 configure: Default to Thumb-2 mode for ARM. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 39 ++++++++++++++++++++++----------------- configure.ac | 28 ++++++++++++++++++---------- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 6a0f0ad92c2..ef09f65f11e 100755 --- a/configure +++ b/configure @@ -5623,6 +5623,8 @@ case $host in ;; esac +TARGETFLAGS="" + case $host in x86_64*|amd64*) if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes" @@ -5660,7 +5662,6 @@ $as_echo "$wine_cv_cc_m32" >&6; } host_cpu="i386" notice_platform="32-bit " TARGETFLAGS="-m32" - PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig} export PKG_CONFIG_PATH enable_win16=${enable_win16:-yes} @@ -5700,37 +5701,43 @@ $as_echo "$wine_cv_builtin_ms_va_list" >&6; } host_cpu="x86_64" notice_platform="64-bit " TARGETFLAGS="-m64" - fi ;; arm*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb" >&5 -$as_echo_n "checking whether $CC supports Thumb... " >&6; } -if ${wine_cv_thumb+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb-2" >&5 +$as_echo_n "checking whether $CC supports Thumb-2... " >&6; } +if ${wine_cv_thumb2+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int ac_test(int i) { return i; } + int main () { -asm(".thumb\nblx ac_test\n.arm"); if (ac_test(1)) return 1 +asm(".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - wine_cv_thumb=yes + wine_cv_thumb2=yes else - wine_cv_thumb=no + wine_cv_thumb2=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb" >&5 -$as_echo "$wine_cv_thumb" >&6; } - test $wine_cv_thumb != no || as_fn_error $? "You need a target with Thumb support to build Wine for ARM." "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb2" >&5 +$as_echo "$wine_cv_thumb2" >&6; } + if test x"$wine_cv_thumb2" = xyes + then + CFLAGS="$CFLAGS -mthumb" + TARGETFLAGS="-mthumb" + else + CFLAGS="$CFLAGS -marm" + TARGETFLAGS="-marm" + fi case $with_float_abi in soft|softfp|hard) float_abi=$with_float_abi ;; @@ -5741,7 +5748,7 @@ $as_echo "$wine_cv_thumb" >&6; } *) float_abi=softfp saved_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" + CFLAGS="$CFLAGS -mfloat-abi=$float_abi" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5 $as_echo_n "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; } if ${wine_cv_float_abi+:} false; then : @@ -5777,9 +5784,8 @@ $as_echo "$wine_cv_float_abi" >&6; } esac ;; esac - CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" - TARGETFLAGS="-marm -mfloat-abi=$float_abi" - + CFLAGS="$CFLAGS -mfloat-abi=$float_abi" + TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi" ;; aarch64*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5 @@ -5859,7 +5865,6 @@ fi if test -n "$host_alias" -a "$host_alias" != "$build_alias" then TARGETFLAGS="-b $host_alias $TARGETFLAGS" - fi for ac_prog in flex diff --git a/configure.ac b/configure.ac index 2c4bd667e8f..1921307da31 100644 --- a/configure.ac +++ b/configure.ac @@ -138,6 +138,7 @@ case $host in ;; esac +AC_SUBST(TARGETFLAGS,"") case $host in x86_64*|amd64*) if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes" @@ -149,7 +150,7 @@ case $host in test $wine_cv_cc_m32 != no || AC_MSG_ERROR([Cannot build a 32-bit program, you need to install 32-bit development libraries.]) host_cpu="i386" notice_platform="32-bit " - AC_SUBST(TARGETFLAGS,"-m32") + TARGETFLAGS="-m32" PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig} export PKG_CONFIG_PATH enable_win16=${enable_win16:-yes} @@ -166,14 +167,21 @@ case $host in CXX="$CXX -m64" host_cpu="x86_64" notice_platform="64-bit " - AC_SUBST(TARGETFLAGS,"-m64") + TARGETFLAGS="-m64" fi ;; arm*) - AC_CACHE_CHECK([whether $CC supports Thumb],wine_cv_thumb, - [WINE_TRY_ASM_LINK([".thumb\nblx ac_test\n.arm"],[int ac_test(int i) { return i; }], [if (ac_test(1)) return 1], - [wine_cv_thumb=yes],[wine_cv_thumb=no])]) - test $wine_cv_thumb != no || AC_MSG_ERROR([You need a target with Thumb support to build Wine for ARM.]) + AC_CACHE_CHECK([whether $CC supports Thumb-2],wine_cv_thumb2, + [WINE_TRY_ASM_LINK([".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}"],,, + [wine_cv_thumb2=yes],[wine_cv_thumb2=no])]) + if test x"$wine_cv_thumb2" = xyes + then + CFLAGS="$CFLAGS -mthumb" + TARGETFLAGS="-mthumb" + else + CFLAGS="$CFLAGS -marm" + TARGETFLAGS="-marm" + fi case $with_float_abi in soft|softfp|hard) float_abi=$with_float_abi ;; @@ -184,7 +192,7 @@ case $host in *) float_abi=softfp saved_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" + CFLAGS="$CFLAGS -mfloat-abi=$float_abi" AC_CACHE_CHECK([whether $CC supports -mfloat-abi=$float_abi],wine_cv_float_abi, [WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,[wine_cv_float_abi=yes],[wine_cv_float_abi=no])]) if test $wine_cv_float_abi = no @@ -196,8 +204,8 @@ case $host in esac ;; esac - CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" - AC_SUBST(TARGETFLAGS,"-marm -mfloat-abi=$float_abi") + CFLAGS="$CFLAGS -mfloat-abi=$float_abi" + TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi" ;; aarch64*) AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list, @@ -248,7 +256,7 @@ else fi if test -n "$host_alias" -a "$host_alias" != "$build_alias" then - AC_SUBST(TARGETFLAGS,"-b $host_alias $TARGETFLAGS") + TARGETFLAGS="-b $host_alias $TARGETFLAGS" fi dnl Check for flex
1
0
0
0
Alexandre Julliard : vcomp: Make inline asm compatible with Thumb-2.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 6083c69a3b4f4432e06ed8803e75bad102a866fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6083c69a3b4f4432e06ed880…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:44:17 2021 +0100 vcomp: Make inline asm compatible with Thumb-2. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vcomp/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 3c6d48d41cc..7b97dfc72c8 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -200,7 +200,6 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, - ".arm\n\t" "push {r4, r5, LR}\n\t" "mov r4, r0\n\t" "mov r5, SP\n\t" @@ -209,6 +208,7 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, "beq 5f\n\t" "sub SP, SP, r3\n\t" "tst r1, #1\n\t" + "it eq\n\t" "subeq SP, SP, #4\n\t" "1:\tsub r3, r3, #4\n\t" "ldr r0, [r2, r3]\n\t"
1
0
0
0
Alexandre Julliard : rpcrt4: Make inline asm compatible with Thumb-2.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 621c06a082a5507885f2c98815f411718415a53b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=621c06a082a5507885f2c988…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:44:10 2021 +0100 rpcrt4: Make inline asm compatible with Thumb-2. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_stubless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 43debcb91df..3e0c824c733 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1144,7 +1144,6 @@ __ASM_GLOBAL_FUNC( call_server_func, #elif defined __arm__ LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char *args, unsigned int stack_size); __ASM_GLOBAL_FUNC( call_server_func, - ".arm\n\t" "push {r4, r5, LR}\n\t" "mov r4, r0\n\t" "mov r5, SP\n\t" @@ -1153,6 +1152,7 @@ __ASM_GLOBAL_FUNC( call_server_func, "beq 5f\n\t" "sub SP, SP, r2\n\t" "tst r3, #1\n\t" + "it eq\n\t" "subeq SP, SP, #4\n\t" "1:\tsub r2, r2, #4\n\t" "ldr r0, [r1, r2]\n\t"
1
0
0
0
Alexandre Julliard : ntdll: Support Thumb mode in signal handling.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 37c24eabc7ce287ac2941d18bb76888381e8213f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37c24eabc7ce287ac2941d18…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:43:55 2021 +0100 ntdll: Support Thumb mode in signal handling. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 6fa37b81415..231f23e354a 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -283,6 +283,7 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) context->Cpsr = CPSR_sig(sigcontext); /* Current State Register */ context->R11 = FP_sig(sigcontext); /* Frame pointer */ context->R12 = IP_sig(sigcontext); /* Intra-Procedure-call scratch register */ + if (CPSR_sig(sigcontext) & 0x20) context->Pc |= 1; /* Thumb mode */ save_fpu( context, sigcontext ); } @@ -305,6 +306,8 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) CPSR_sig(sigcontext) = context->Cpsr; /* Current State Register */ FP_sig(sigcontext) = context->R11; /* Frame pointer */ IP_sig(sigcontext) = context->R12; /* Intra-Procedure-call scratch register */ + if (PC_sig(sigcontext) & 1) CPSR_sig(sigcontext) |= 0x20; + else CPSR_sig(sigcontext) &= ~0x20; restore_fpu( context, sigcontext ); } @@ -534,19 +537,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } -extern void raise_func_trampoline_thumb( EXCEPTION_RECORD *rec, CONTEXT *context, void *func ); -__ASM_GLOBAL_FUNC( raise_func_trampoline_thumb, - ".thumb\n\t" - "bx r2\n\t" - "bkpt\n\t" - ".arm") - -extern void raise_func_trampoline_arm( EXCEPTION_RECORD *rec, CONTEXT *context, void *func ); -__ASM_GLOBAL_FUNC( raise_func_trampoline_arm, - ".arm\n\t" - "bx r2\n\t" - "bkpt") - /*********************************************************************** * setup_exception * @@ -566,7 +556,8 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) rec->ExceptionAddress = (void *)PC_sig(sigcontext); save_context( &context, sigcontext ); - if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context.Pc += 4; + if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) + context.Pc += CPSR_sig(sigcontext) & 0x20 ? 2 : 4; status = send_debug_event( rec, &context, TRUE ); if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) @@ -581,13 +572,11 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec ) /* now modify the sigcontext to return to the raise function */ SP_sig(sigcontext) = (DWORD)stack; - if (CPSR_sig(sigcontext) & 0x20) - PC_sig(sigcontext) = (DWORD)raise_func_trampoline_thumb; - else - PC_sig(sigcontext) = (DWORD)raise_func_trampoline_arm; + PC_sig(sigcontext) = (DWORD)pKiUserExceptionDispatcher; + if (PC_sig(sigcontext) & 1) CPSR_sig(sigcontext) |= 0x20; + else CPSR_sig(sigcontext) &= ~0x20; REGn_sig(0, sigcontext) = (DWORD)&stack->rec; /* first arg for KiUserExceptionDispatcher */ REGn_sig(1, sigcontext) = (DWORD)&stack->context; /* second arg for KiUserExceptionDispatcher */ - REGn_sig(2, sigcontext) = (DWORD)pKiUserExceptionDispatcher; } @@ -999,6 +988,7 @@ static void init_thread_context( CONTEXT *context, LPTHREAD_START_ROUTINE entry, context->R1 = (DWORD)arg; context->Sp = (DWORD)teb->Tib.StackBase; context->Pc = (DWORD)pRtlUserThreadStart; + if (context->Pc & 1) context->Cpsr |= 0x20; /* thumb mode */ }
1
0
0
0
Alexandre Julliard : ntdll: Make inline asm compatible with Thumb-2.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 54cd0e9187da7b592054dc6cbcf7beed9e1c937c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54cd0e9187da7b592054dc6c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:43:55 2021 +0100 ntdll: Make inline asm compatible with Thumb-2. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/relay.c | 5 +++-- dlls/ntdll/signal_arm.c | 16 ++++++++++++++-- dlls/ntdll/unix/signal_arm.c | 17 ++++++++++------- include/wine/asm.h | 4 +++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index ee7d9951c59..be2dc833377 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -545,7 +545,6 @@ DECLSPEC_HIDDEN void WINAPI relay_trace_exit( struct relay_descr *descr, unsigne extern LONGLONG WINAPI relay_call( struct relay_descr *descr, unsigned int idx, const DWORD *stack ); __ASM_GLOBAL_FUNC( relay_call, - ".arm\n\t" "push {r4-r8,lr}\n\t" "sub sp, #16\n\t" "mov r6, r2\n\t" @@ -559,8 +558,9 @@ __ASM_GLOBAL_FUNC( relay_call, "lsl r3, r1, #2\n\t" "subs r3, #16\n\t" /* first 4 args are in registers */ "ble 2f\n\t" + "add r3, #7\n\t" + "and r3, #~7\n" "sub sp, r3\n\t" - "and sp, #~7\n" "add r2, r6, #16\n\t" /* skip r0-r3 */ "1:\tsubs r3, r3, #4\n\t" "ldr r0, [r2, r3]\n\t" @@ -570,6 +570,7 @@ __ASM_GLOBAL_FUNC( relay_call, #ifndef __SOFTFP__ "tst r1, #0x80000000\n\t" "ldm r6, {r0-r3}\n\t" + "it ne\n\t" "vldmdbne r6!, {s0-s15}\n\t" #else "ldm r6, {r0-r3}\n\t" diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 512462b7066..0461183460d 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -61,8 +61,8 @@ __ASM_GLOBAL_FUNC( __chkstk, "lsl r4, r4, #2\n\t" * RtlCaptureContext (NTDLL.@) */ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, - ".arm\n\t" - "stmib r0, {r0-r12}\n\t" /* context->R0..R12 */ + "str r0, [r0, #0x4]\n\t" /* context->R0 */ + "str r1, [r0, #0x8]\n\t" /* context->R1 */ "mov r1, #0x0200000\n\t" /* CONTEXT_ARM */ "add r1, r1, #0x3\n\t" /* CONTEXT_FULL */ "str r1, [r0]\n\t" /* context->ContextFlags */ @@ -70,7 +70,13 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, "str LR, [r0, #0x3c]\n\t" /* context->Lr */ "str LR, [r0, #0x40]\n\t" /* context->Pc */ "mrs r1, CPSR\n\t" + "tst lr, #1\n\t" /* Thumb? */ + "ite ne\n\t" + "orrne r1, r1, #0x20\n\t" + "biceq r1, r1, #0x20\n\t" "str r1, [r0, #0x44]\n\t" /* context->Cpsr */ + "add r0, #0x0c\n\t" + "stm r0, {r2-r12}\n\t" /* context->R2..R12 */ "bx lr" ) @@ -257,6 +263,12 @@ __ASM_STDCALL_FUNC( RtlRaiseException, 4, "ldr r0, [sp, #0x1a0]\n\t" /* rec */ "ldr r1, [sp, #0x1a4]\n\t" "str r1, [sp, #0x40]\n\t" /* context->Pc */ + "ldr r2, [sp, #0x44]\n\t" /* context->Cpsr */ + "tst r1, #1\n\t" /* Thumb? */ + "ite ne\n\t" + "orrne r2, r2, #0x20\n\t" + "biceq r2, r2, #0x20\n\t" + "str r2, [sp, #0x44]\n\t" /* context->Cpsr */ "str r1, [r0, #12]\n\t" /* rec->ExceptionAddress */ "add r1, sp, #0x1a8\n\t" "str r1, [sp, #0x38]\n\t" /* context->Sp */ diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 487c8501cc7..6fa37b81415 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -316,17 +316,18 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) */ void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ); __ASM_GLOBAL_FUNC( set_cpu_context, - ".arm\n\t" "ldr r2, [r0, #0x44]\n\t" /* context->Cpsr */ "tst r2, #0x20\n\t" /* thumb? */ "ldr r1, [r0, #0x40]\n\t" /* context->Pc */ + "ite ne\n\t" "orrne r1, r1, #1\n\t" /* Adjust PC according to thumb */ "biceq r1, r1, #1\n\t" /* Adjust PC according to arm */ "msr CPSR_f, r2\n\t" "ldr lr, [r0, #0x3c]\n\t" /* context->Lr */ "ldr sp, [r0, #0x38]\n\t" /* context->Sp */ "push {r1}\n\t" - "ldmib r0, {r0-r12}\n\t" /* context->R0..R12 */ + "add r0, #0x4\n\t" + "ldm r0, {r0-r12}\n\t" /* context->R0..R12 */ "pop {pc}" ) @@ -611,7 +612,8 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher, "mov sp, r0\n\t" "b 2f\n" "1:\tldr r0, [r10]\n\t" - "sub sp, r0, #0x1a0\n\t" + "sub r0, #0x1a0\n\t" + "mov sp, r0\n\t" "mov r0, #3\n\t" "movt r0, #32\n\t" "str r0, [sp]\n\t" /* context.ContextFlags = CONTEXT_FULL */ @@ -658,7 +660,8 @@ __ASM_GLOBAL_FUNC( call_user_exception_dispatcher, "ldm r3, {r5-r11}\n\t" "ldr r4, [r3, #32]\n\t" "ldr lr, [r3, #36]\n\t" - "add sp, r3, #40\n\t" + "add r3, #40\n\t" + "mov sp, r3\n\t" "bx r2" ) @@ -1031,7 +1034,6 @@ PCONTEXT DECLSPEC_HIDDEN get_initial_context( LPTHREAD_START_ROUTINE entry, void * signal_start_thread */ __ASM_GLOBAL_FUNC( signal_start_thread, - ".arm\n\t" "push {r4-r12,lr}\n\t" "mov r5, r3\n\t" /* thunk */ /* store exit frame */ @@ -1039,7 +1041,8 @@ __ASM_GLOBAL_FUNC( signal_start_thread, "str sp, [r3, #0x1d4]\n\t" /* arm_thread_data()->exit_frame */ /* switch to thread stack */ "ldr r4, [r3, #4]\n\t" /* teb->Tib.StackBase */ - "sub sp, r4, #0x1000\n\t" + "sub r4, #0x1000\n\t" + "mov sp, r4\n\t" /* attach dlls */ "bl " __ASM_NAME("get_initial_context") "\n\t" "mov lr, #0\n\t" @@ -1048,11 +1051,11 @@ __ASM_GLOBAL_FUNC( signal_start_thread, extern void DECLSPEC_NORETURN call_thread_exit_func( int status, void (*func)(int), TEB *teb ); __ASM_GLOBAL_FUNC( call_thread_exit_func, - ".arm\n\t" "ldr r3, [r2, #0x1d4]\n\t" /* arm_thread_data()->exit_frame */ "mov ip, #0\n\t" "str ip, [r2, #0x1d4]\n\t" "cmp r3, ip\n\t" + "it ne\n\t" "movne sp, r3\n\t" "blx r1" ) diff --git a/include/wine/asm.h b/include/wine/asm.h index 236b35cf8fe..b9dae95dc6d 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -59,7 +59,9 @@ # define __ASM_FUNC_TYPE(name) ".def " name "\n\t.scl 2\n\t.type 32\n\t.endef" #elif defined(__APPLE__) # define __ASM_FUNC_TYPE(name) "" -#elif defined(__arm__) || defined(__arm64__) +#elif defined(__arm__) && defined(__thumb__) +# define __ASM_FUNC_TYPE(name) ".type " name ",%function\n\t.thumb_func" +#elif defined(__arm__) || defined(__aarch64__) # define __ASM_FUNC_TYPE(name) ".type " name ",%function" #else # define __ASM_FUNC_TYPE(name) ".type " name ",@function"
1
0
0
0
Alexandre Julliard : winebuild: Support non-PIC mode for ARM targets.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 7c48d8d44ba70cbfee21e662020ecde457539963 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7c48d8d44ba70cbfee21e662…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 18 11:42:42 2021 +0100 winebuild: Support non-PIC mode for ARM targets. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 76 +++++++++++++++++++++++++++++++++--------------- tools/winebuild/spec32.c | 5 ++-- 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 00b6f19ec98..f0730aa2fe7 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -755,10 +755,19 @@ static void output_import_thunk( const char *name, const char *table, int pos ) output( "\tjmpq *%s+%d(%%rip)\n", table, pos ); break; case CPU_ARM: - output( "\tldr ip, 2f\n"); - output( "1:\tadd ip, pc\n" ); - output( "\tldr pc, [ip]\n"); - output( "2:\t.long %s+%u-1b-%u\n", table, pos, thumb_mode ? 4 : 8 ); + if (UsePIC) + { + output( "\tldr ip, 2f\n"); + output( "1:\tadd ip, pc\n" ); + output( "\tldr pc, [ip]\n"); + output( "2:\t.long %s+%u-1b-%u\n", table, pos, thumb_mode ? 4 : 8 ); + } + else + { + output( "\tldr ip, 1f\n"); + output( "\tldr pc, [ip]\n"); + output( "1:\t.long %s+%u\n", table, pos ); + } break; case CPU_ARM64: output( "\tadrp x16, %s\n", arm64_page( table ) ); @@ -1348,14 +1357,26 @@ void output_stubs( DLLSPEC *spec ) output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") ); break; case CPU_ARM: - output( "\tldr r0,3f\n"); - output( "1:\tadd r0,PC\n"); - output( "\tldr r1,3f+4\n"); - if (exp_name) output( "2:\tadd r1,PC\n"); - output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") ); - output( "3:\t.long .L__wine_spec_file_name-1b-%u\n", thumb_mode ? 4 : 8 ); - if (exp_name) output( "\t.long .L%s_string-2b-%u\n", name, thumb_mode ? 4 : 8 ); - else output( "\t.long %u\n", odp->ordinal ); + if (UsePIC) + { + output( "\tldr r0,3f\n"); + output( "1:\tadd r0,PC\n"); + output( "\tldr r1,3f+4\n"); + if (exp_name) output( "2:\tadd r1,PC\n"); + output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") ); + output( "3:\t.long .L__wine_spec_file_name-1b-%u\n", thumb_mode ? 4 : 8 ); + if (exp_name) output( "\t.long .L%s_string-2b-%u\n", name, thumb_mode ? 4 : 8 ); + else output( "\t.long %u\n", odp->ordinal ); + } + else + { + output( "\tldr r0,1f\n"); + output( "\tldr r1,1f+4\n"); + output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") ); + output( "1:\t.long .L__wine_spec_file_name\n" ); + if (exp_name) output( "\t.long .L%s_string\n", name ); + else output( "\t.long %u\n", odp->ordinal ); + } break; case CPU_ARM64: output( "\tadrp x0, %s\n", arm64_page(".L__wine_spec_file_name") ); @@ -1552,7 +1573,7 @@ void output_syscalls( DLLSPEC *spec ) case CPU_ARM: output( "\tpush {r5-r11,lr}\n" ); output( "\tadd r6, sp, #40\n" ); /* stack parameters */ - output( "\tldr r5, 8f\n" ); + output( "\tldr r5, 6f+8\n" ); output( "\tcmp r4, r5\n" ); output( "\tbcs 5f\n" ); output( "\tsub sp, sp, #8\n" ); @@ -1563,8 +1584,8 @@ void output_syscalls( DLLSPEC *spec ) output( "\tmrs ip, CPSR\n" ); output( "\tstr ip, [sp, #4]\n" ); output( "\tstr sp, [r7]\n" ); /* syscall frame */ - output( "\tldr r5, 7f\n"); - output( "1:\tadd r5, pc\n"); + output( "\tldr r5, 6f+4\n"); + if (UsePIC) output( "1:\tadd r5, pc\n"); output( "\tldrb r5, [r5, r4]\n" ); /* syscall args */ output( "\tsubs r5, #16\n" ); /* first 4 args are in registers */ output( "\tble 3f\n" ); @@ -1576,7 +1597,7 @@ void output_syscalls( DLLSPEC *spec ) output( "\tstr ip, [sp, r5]\n" ); output( "\tbgt 2b\n" ); output( "3:\tldr r5, 6f\n"); - output( "4:\tadd r5, pc\n"); + if (UsePIC) output( "4:\tadd r5, pc\n"); output( "\tldr ip, [r5, r4, lsl #2]\n"); /* syscall table */ output( "\tblx ip\n"); output( "\tmov ip, #0\n" ); @@ -1584,12 +1605,20 @@ void output_syscalls( DLLSPEC *spec ) output( "\tsub ip, r6, #40\n" ); output( "\tmov sp, ip\n" ); output( "\tpop {r5-r11,pc}\n" ); - output( "5:\tldr r0, 9f\n" ); + output( "5:\tldr r0, 6f+12\n" ); output( "\tpop {r5-r11,pc}\n" ); - output( "6:\t.long .Lsyscall_table-4b-%u\n", thumb_mode ? 4 : 8 ); - output( "7:\t.long .Lsyscall_args-1b-%u\n", thumb_mode ? 4 : 8 ); - output( "8:\t.long %u\n", count ); - output( "9:\t.long 0x%x\n", invalid_param ); + if (UsePIC) + { + output( "6:\t.long .Lsyscall_table-4b-%u\n", thumb_mode ? 4 : 8 ); + output( "\t.long .Lsyscall_args-1b-%u\n", thumb_mode ? 4 : 8 ); + } + else + { + output( "6:\t.long .Lsyscall_table\n" ); + output( "\t.long .Lsyscall_args\n" ); + } + output( "\t.long %u\n", count ); + output( "\t.long 0x%x\n", invalid_param ); break; case CPU_ARM64: output( "\tcmp x8, %u\n", count ); @@ -1731,11 +1760,12 @@ void output_syscalls( DLLSPEC *spec ) output( "\tpush {r4,lr}\n" ); output( "\tldr r4, 3f\n"); output( "\tldr ip, 2f\n"); - output( "1:\tadd ip, pc\n" ); + if (UsePIC) output( "1:\tadd ip, pc\n" ); output( "\tldr ip, [ip]\n"); output( "\tblx ip\n"); output( "\tpop {r4,pc}\n" ); - output( "2:\t.long %s-1b-%u\n", asm_name("__wine_syscall_dispatcher"), thumb_mode ? 4 : 8 ); + if (UsePIC) output( "2:\t.long %s-1b-%u\n", asm_name("__wine_syscall_dispatcher"), thumb_mode ? 4 : 8 ); + else output( "2:\t.long %s\n", asm_name("__wine_syscall_dispatcher") ); output( "3:\t.long %u\n", i ); break; case CPU_ARM64: diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 6d56cc01b6e..cf1dd353ae5 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -319,13 +319,14 @@ static void output_relay_debug( DLLSPEC *spec ) if (val & mask) output( "\t%s r1,#%u\n", count++ ? "add" : "mov", val & mask ); if (!count) output( "\tmov r1,#0\n" ); output( "\tldr r0, 2f\n"); - output( "1:\tadd r0, PC\n"); + if (UsePIC) output( "1:\tadd r0, PC\n"); output( "\tldr IP, [r0, #4]\n"); output( "\tblx IP\n"); output( "\tldr IP, [SP, #4]\n" ); output( "\tadd SP, #%u\n", 24 + (has_float ? 64 : 0) ); output( "\tbx IP\n"); - output( "2:\t.long .L__wine_spec_relay_descr-1b-%u\n", thumb_mode ? 4 : 8 ); + if (UsePIC) output( "2:\t.long .L__wine_spec_relay_descr-1b-%u\n", thumb_mode ? 4 : 8 ); + else output( "2:\t.long .L__wine_spec_relay_descr\n" ); output_cfi( ".cfi_endproc" ); break; }
1
0
0
0
Alexandre Julliard : winebuild: Generate Thumb2-compatible assembly code on ARM.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: c1a700f018ae86b31c61b0ce4e932f335a6f5081 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c1a700f018ae86b31c61b0ce…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 16 11:05:38 2021 +0100 winebuild: Generate Thumb2-compatible assembly code on ARM. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 58 ++++++++++++++++++++++++------------------------ tools/winebuild/main.c | 2 ++ tools/winebuild/spec32.c | 8 ++++--- tools/winebuild/utils.c | 11 ++++++++- 4 files changed, 46 insertions(+), 33 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index e6dff564f79..00b6f19ec98 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -755,9 +755,10 @@ static void output_import_thunk( const char *name, const char *table, int pos ) output( "\tjmpq *%s+%d(%%rip)\n", table, pos ); break; case CPU_ARM: - output( "\tldr IP,1f\n"); - output( "\tldr PC,[PC,IP]\n" ); - output( "1:\t.long %s+%u-(1b+4)\n", table, pos ); + output( "\tldr ip, 2f\n"); + output( "1:\tadd ip, pc\n" ); + output( "\tldr pc, [ip]\n"); + output( "2:\t.long %s+%u-1b-%u\n", table, pos, thumb_mode ? 4 : 8 ); break; case CPU_ARM64: output( "\tadrp x16, %s\n", arm64_page( table ) ); @@ -956,7 +957,7 @@ static void output_delayed_imports( const DLLSPEC *spec ) struct import_func *func = &import->imports[j]; const char *name = func->name ? func->name : func->export_name; output( "__imp_%s:\n", asm_name( name )); - output( "\t%s .L__wine_delay_imp_%s_%s\n", + output( "\t%s __wine_delay_imp_%s_%s\n", get_asm_ptr_keyword(), import->c_name, name ); } } @@ -1066,13 +1067,10 @@ static void output_delayed_import_thunks( const DLLSPEC *spec ) case CPU_ARM: output( "\tpush {r0-r3,FP,LR}\n" ); output( "\tmov r0,IP\n" ); - output( "\tldr IP,2f\n"); - output( "\tadd IP,PC\n"); - output( "\tblx IP\n"); - output( "1:\tmov IP,r0\n"); + output( "\tbl %s\n", asm_name("__wine_spec_delay_load") ); + output( "\tmov IP,r0\n"); output( "\tpop {r0-r3,FP,LR}\n" ); output( "\tbx IP\n"); - output( "2:\t.long %s-1b\n", asm_name("__wine_spec_delay_load") ); break; case CPU_ARM64: output( "\tstp x29, x30, [sp,#-80]!\n" ); @@ -1153,7 +1151,8 @@ static void output_delayed_import_thunks( const DLLSPEC *spec ) struct import_func *func = &import->imports[j]; const char *name = func->name ? func->name : func->export_name; - output( ".L__wine_delay_imp_%s_%s:\n", import->c_name, name ); + if (thumb_mode) output( "\t.thumb_func\n" ); + output( "__wine_delay_imp_%s_%s:\n", import->c_name, name ); output_cfi( ".cfi_startproc" ); switch(target_cpu) { @@ -1349,14 +1348,13 @@ void output_stubs( DLLSPEC *spec ) output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") ); break; case CPU_ARM: - output( "\tldr r0,2f\n"); - output( "\tadd r0,PC\n"); - output( "\tldr r1,2f+4\n"); - output( "1:" ); - if (exp_name) output( "\tadd r1,PC\n"); + output( "\tldr r0,3f\n"); + output( "1:\tadd r0,PC\n"); + output( "\tldr r1,3f+4\n"); + if (exp_name) output( "2:\tadd r1,PC\n"); output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") ); - output( "2:\t.long .L__wine_spec_file_name-1b\n" ); - if (exp_name) output( "\t.long .L%s_string-2b\n", name ); + output( "3:\t.long .L__wine_spec_file_name-1b-%u\n", thumb_mode ? 4 : 8 ); + if (exp_name) output( "\t.long .L%s_string-2b-%u\n", name, thumb_mode ? 4 : 8 ); else output( "\t.long %u\n", odp->ordinal ); break; case CPU_ARM64: @@ -1566,28 +1564,30 @@ void output_syscalls( DLLSPEC *spec ) output( "\tstr ip, [sp, #4]\n" ); output( "\tstr sp, [r7]\n" ); /* syscall frame */ output( "\tldr r5, 7f\n"); - output( "\tadd r5, pc\n"); + output( "1:\tadd r5, pc\n"); output( "\tldrb r5, [r5, r4]\n" ); /* syscall args */ - output( "1:\tsubs r5, #16\n" ); /* first 4 args are in registers */ + output( "\tsubs r5, #16\n" ); /* first 4 args are in registers */ output( "\tble 3f\n" ); - output( "\tsub sp, r5\n" ); - output( "\tand sp, #~7\n" ); + output( "\tsub ip, sp, r5\n" ); + output( "\tand ip, #~7\n" ); + output( "\tmov sp, ip\n" ); output( "2:\tsubs r5, r5, #4\n" ); output( "\tldr ip, [r6, r5]\n" ); output( "\tstr ip, [sp, r5]\n" ); output( "\tbgt 2b\n" ); output( "3:\tldr r5, 6f\n"); - output( "\tadd r5, pc\n"); + output( "4:\tadd r5, pc\n"); output( "\tldr ip, [r5, r4, lsl #2]\n"); /* syscall table */ - output( "4:\tblx ip\n"); + output( "\tblx ip\n"); output( "\tmov ip, #0\n" ); output( "\tstr ip, [r7]\n" ); - output( "\tsub sp, r6, #40\n" ); + output( "\tsub ip, r6, #40\n" ); + output( "\tmov sp, ip\n" ); output( "\tpop {r5-r11,pc}\n" ); output( "5:\tldr r0, 9f\n" ); output( "\tpop {r5-r11,pc}\n" ); - output( "6:\t.long .Lsyscall_table-4b\n" ); - output( "7:\t.long .Lsyscall_args-1b\n" ); + output( "6:\t.long .Lsyscall_table-4b-%u\n", thumb_mode ? 4 : 8 ); + output( "7:\t.long .Lsyscall_args-1b-%u\n", thumb_mode ? 4 : 8 ); output( "8:\t.long %u\n", count ); output( "9:\t.long 0x%x\n", invalid_param ); break; @@ -1731,11 +1731,11 @@ void output_syscalls( DLLSPEC *spec ) output( "\tpush {r4,lr}\n" ); output( "\tldr r4, 3f\n"); output( "\tldr ip, 2f\n"); - output( "\tadd ip, pc\n"); + output( "1:\tadd ip, pc\n" ); output( "\tldr ip, [ip]\n"); - output( "1:\tblx ip\n"); + output( "\tblx ip\n"); output( "\tpop {r4,pc}\n" ); - output( "2:\t.long %s-1b\n", asm_name("__wine_syscall_dispatcher") ); + output( "2:\t.long %s-1b-%u\n", asm_name("__wine_syscall_dispatcher"), thumb_mode ? 4 : 8 ); output( "3:\t.long %u\n", i ); break; case CPU_ARM64: diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 572b4d74ae7..abb94e27c03 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -244,6 +244,8 @@ static void set_target( const char *target ) } free( spec ); + + if (target_cpu == CPU_ARM && target_platform == PLATFORM_WINDOWS) thumb_mode = 1; } /* cleanup on program exit */ diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index a12e7d38aac..6d56cc01b6e 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -249,6 +249,7 @@ static void output_relay_debug( DLLSPEC *spec ) /* then the relay thunks */ output( "\t.text\n" ); + if (thumb_mode) output( "\t.thumb_func\n" ); output( "__wine_spec_relay_entry_points:\n" ); output( "\tnop\n" ); /* to avoid 0 offset */ @@ -306,6 +307,7 @@ static void output_relay_debug( DLLSPEC *spec ) val = (odp->u.func.args_str_offset << 16) | (i - spec->base); output( "\t.align %d\n", get_alignment(4) ); + if (thumb_mode) output( "\t.thumb_func\n" ); output( ".L__wine_spec_relay_entry_point_%d:\n", i ); output_cfi( ".cfi_startproc" ); output( "\tpush {r0-r3}\n" ); @@ -317,13 +319,13 @@ static void output_relay_debug( DLLSPEC *spec ) if (val & mask) output( "\t%s r1,#%u\n", count++ ? "add" : "mov", val & mask ); if (!count) output( "\tmov r1,#0\n" ); output( "\tldr r0, 2f\n"); - output( "\tadd r0, PC\n"); + output( "1:\tadd r0, PC\n"); output( "\tldr IP, [r0, #4]\n"); - output( "1:\tblx IP\n"); + output( "\tblx IP\n"); output( "\tldr IP, [SP, #4]\n" ); output( "\tadd SP, #%u\n", 24 + (has_float ? 64 : 0) ); output( "\tbx IP\n"); - output( "2:\t.long .L__wine_spec_relay_descr-1b\n" ); + output( "2:\t.long .L__wine_spec_relay_descr-1b-%u\n", thumb_mode ? 4 : 8 ); output_cfi( ".cfi_endproc" ); break; } diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 5cffc74accd..1a11d275cb3 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -690,6 +690,11 @@ void output_standard_file_header(void) output( "\t.globl @feat.00\n" ); output( ".set @feat.00, 1\n" ); } + if (thumb_mode) + { + output( "\t.syntax unified\n" ); + output( "\t.thumb\n" ); + } } /* dump a byte stream into the assembly code */ @@ -1119,13 +1124,17 @@ const char *func_declaration( const char *func ) return ""; case PLATFORM_WINDOWS: free( buffer ); - buffer = strmake( ".def %s\n\t.scl 2\n\t.type 32\n\t.endef", asm_name(func) ); + buffer = strmake( ".def %s\n\t.scl 2\n\t.type 32\n\t.endef%s", asm_name(func), + thumb_mode ? "\n\t.thumb_func" : "" ); break; default: free( buffer ); switch(target_cpu) { case CPU_ARM: + buffer = strmake( ".type %s,%%function%s", func, + thumb_mode ? "\n\t.thumb_func" : "" ); + break; case CPU_ARM64: buffer = strmake( ".type %s,%%function", func ); break;
1
0
0
0
Zebediah Figura : quartz/dsoundrender: Use the strmbase stream lock.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: defa3305eec8d7aabb622404bb4f011289f6bb37 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=defa3305eec8d7aabb622404…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 18 21:57:21 2021 -0600 quartz/dsoundrender: Use the strmbase stream lock. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/dsoundrender.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 099af2c4e21..27347ab6039 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -50,7 +50,6 @@ struct dsound_render struct strmbase_sink sink; - CRITICAL_SECTION stream_cs; /* Signaled when the filter has completed a state change. The filter waits * for this event in IBaseFilter::GetState(). */ HANDLE state_event; @@ -374,7 +373,7 @@ static HRESULT WINAPI dsound_render_sink_Receive(struct strmbase_sink *iface, IM if (FAILED(hr = DSoundRender_PrepareReceive(filter, sample))) return hr; - EnterCriticalSection(&filter->stream_cs); + EnterCriticalSection(&filter->filter.stream_cs); if (filter->filter.clock && SUCCEEDED(IMediaSample_GetTime(sample, &start, &stop))) strmbase_passthrough_update_time(&filter->passthrough, start); @@ -384,7 +383,7 @@ static HRESULT WINAPI dsound_render_sink_Receive(struct strmbase_sink *iface, IM hr = DSoundRender_DoRenderSample(filter, sample); - LeaveCriticalSection(&filter->stream_cs); + LeaveCriticalSection(&filter->filter.stream_cs); return hr; } @@ -471,7 +470,7 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) void *buffer; DWORD size; - EnterCriticalSection(&filter->stream_cs); + EnterCriticalSection(&filter->filter.stream_cs); filter->eos = TRUE; @@ -491,7 +490,7 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) memset(buffer, 0, size); IDirectSoundBuffer_Unlock(filter->dsbuffer, buffer, size, NULL, 0); - LeaveCriticalSection(&filter->stream_cs); + LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; } @@ -507,7 +506,7 @@ static HRESULT dsound_render_sink_end_flush(struct strmbase_sink *iface) { struct dsound_render *filter = impl_from_strmbase_pin(&iface->pin); - EnterCriticalSection(&filter->stream_cs); + EnterCriticalSection(&filter->filter.stream_cs); filter->eos = FALSE; strmbase_passthrough_invalidate_time(&filter->passthrough); @@ -525,7 +524,7 @@ static HRESULT dsound_render_sink_end_flush(struct strmbase_sink *iface) filter->writepos = filter->buf_size; } - LeaveCriticalSection(&filter->stream_cs); + LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; } @@ -557,9 +556,6 @@ static void dsound_render_destroy(struct strmbase_filter *iface) IPin_Disconnect(&filter->sink.pin.IPin_iface); strmbase_sink_cleanup(&filter->sink); - filter->stream_cs.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&filter->stream_cs); - CloseHandle(filter->state_event); CloseHandle(filter->flush_event); @@ -1051,8 +1047,6 @@ HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) strmbase_sink_init(&object->sink, &object->filter, L"Audio Input pin (rendered)", &sink_ops, NULL); - InitializeCriticalSection(&object->stream_cs); - object->stream_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": dsound_render.stream_cs"); object->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); object->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
1
0
0
0
Zebediah Figura : strmbase: Move strmbase_renderer.csRenderLock into the strmbase_filter structure.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: e468aab053e961a594abeea6f982d4133420b221 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e468aab053e961a594abeea6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 18 21:57:20 2021 -0600 strmbase: Move strmbase_renderer.csRenderLock into the strmbase_filter structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/videorenderer.c | 16 ++++++++-------- dlls/quartz/vmr9.c | 10 +++++----- dlls/strmbase/filter.c | 6 ++++++ dlls/strmbase/renderer.c | 19 +++++++------------ include/wine/strmbase.h | 2 +- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 2ad479a6301..a925340a676 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -112,9 +112,9 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa filter->current_sample = pSample; SetEvent(filter->renderer.state_event); - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); WaitForMultipleObjects(2, events, FALSE, INFINITE); - EnterCriticalSection(&filter->renderer.csRenderLock); + EnterCriticalSection(&filter->renderer.filter.stream_cs); filter->current_sample = NULL; } @@ -258,33 +258,33 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG size_t image_size; BYTE *sample_data; - EnterCriticalSection(&filter->renderer.csRenderLock); + EnterCriticalSection(&filter->renderer.filter.stream_cs); bih = get_bitmap_header(&filter->renderer.sink.pin.mt); image_size = bih->biWidth * bih->biHeight * bih->biBitCount / 8; if (!image) { - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); *size = sizeof(BITMAPINFOHEADER) + image_size; return S_OK; } if (filter->renderer.filter.state != State_Paused) { - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return VFW_E_NOT_PAUSED; } if (!filter->current_sample) { - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return E_UNEXPECTED; } if (*size < sizeof(BITMAPINFOHEADER) + image_size) { - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return E_OUTOFMEMORY; } @@ -292,7 +292,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG IMediaSample_GetPointer(filter->current_sample, &sample_data); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size); - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return S_OK; } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 37bb09b399b..57b219a6d26 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -317,9 +317,9 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi if (filter->renderer.filter.state == State_Paused) { SetEvent(filter->renderer.state_event); - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); WaitForMultipleObjects(2, events, FALSE, INFINITE); - EnterCriticalSection(&filter->renderer.csRenderLock); + EnterCriticalSection(&filter->renderer.filter.stream_cs); } return hr; @@ -687,7 +687,7 @@ static HRESULT vmr_get_current_image(struct video_window *iface, LONG *size, LON char *dst; HRESULT hr; - EnterCriticalSection(&filter->renderer.csRenderLock); + EnterCriticalSection(&filter->renderer.filter.stream_cs); device = filter->allocator_d3d9_dev; bih = *get_bitmap_header(&filter->renderer.sink.pin.mt); @@ -696,7 +696,7 @@ static HRESULT vmr_get_current_image(struct video_window *iface, LONG *size, LON if (!image) { *size = sizeof(BITMAPINFOHEADER) + bih.biSizeImage; - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return S_OK; } @@ -732,7 +732,7 @@ static HRESULT vmr_get_current_image(struct video_window *iface, LONG *size, LON out: if (surface) IDirect3DSurface9_Release(surface); if (rt) IDirect3DSurface9_Release(rt); - LeaveCriticalSection(&filter->renderer.csRenderLock); + LeaveCriticalSection(&filter->renderer.filter.stream_cs); return hr; } diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 4f2fe5967d7..93593e4c189 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -527,6 +527,9 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, InitializeCriticalSection(&filter->filter_cs); if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) filter->filter_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.filter_cs"); + InitializeCriticalSection(&filter->stream_cs); + if (filter->stream_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->stream_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.stream_cs"); filter->clsid = *clsid; filter->pin_version = 1; filter->ops = ops; @@ -541,4 +544,7 @@ void strmbase_filter_cleanup(struct strmbase_filter *filter) if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) filter->filter_cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&filter->filter_cs); + if (filter->stream_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1) + filter->stream_cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&filter->stream_cs); } diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 24d209703ca..b63129e0e87 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -192,7 +192,7 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp DeleteMediaType(mt); } - EnterCriticalSection(&filter->csRenderLock); + EnterCriticalSection(&filter->filter.stream_cs); if (filter->filter.clock && SUCCEEDED(IMediaSample_GetTime(sample, &start, &stop))) { @@ -229,7 +229,7 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp if (ret == 1) { - LeaveCriticalSection(&filter->csRenderLock); + LeaveCriticalSection(&filter->filter.stream_cs); TRACE("Flush signaled; discarding current sample.\n"); return S_OK; } @@ -245,7 +245,7 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp QualityControlRender_DoQOS(&filter->qc); - LeaveCriticalSection(&filter->csRenderLock); + LeaveCriticalSection(&filter->filter.stream_cs); return hr; } @@ -273,7 +273,7 @@ static HRESULT sink_eos(struct strmbase_sink *iface) IFilterGraph *graph = filter->filter.graph; IMediaEventSink *event_sink; - EnterCriticalSection(&filter->csRenderLock); + EnterCriticalSection(&filter->filter.stream_cs); filter->eos = TRUE; @@ -287,7 +287,7 @@ static HRESULT sink_eos(struct strmbase_sink *iface) strmbase_passthrough_eos(&filter->passthrough); SetEvent(filter->state_event); - LeaveCriticalSection(&filter->csRenderLock); + LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; } @@ -304,14 +304,14 @@ static HRESULT sink_end_flush(struct strmbase_sink *iface) { struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); - EnterCriticalSection(&filter->csRenderLock); + EnterCriticalSection(&filter->filter.stream_cs); filter->eos = FALSE; QualityControlRender_Start(&filter->qc, filter->stream_start); strmbase_passthrough_invalidate_time(&filter->passthrough); ResetEvent(filter->flush_event); - LeaveCriticalSection(&filter->csRenderLock); + LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; } @@ -336,9 +336,6 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter) strmbase_passthrough_cleanup(&filter->passthrough); - filter->csRenderLock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&filter->csRenderLock); - CloseHandle(filter->state_event); CloseHandle(filter->advise_event); CloseHandle(filter->flush_event); @@ -358,8 +355,6 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL); - InitializeCriticalSection(&filter->csRenderLock); - filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": strmbase_renderer.csRenderLock"); filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL); filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index c56a8d96037..4bb9d898a1a 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -127,6 +127,7 @@ struct strmbase_filter IUnknown *outer_unk; LONG refcount; CRITICAL_SECTION filter_cs; + CRITICAL_SECTION stream_cs; FILTER_STATE state; IReferenceClock *clock; @@ -295,7 +296,6 @@ struct strmbase_renderer struct strmbase_sink sink; - CRITICAL_SECTION csRenderLock; /* Signaled when the filter has completed a state change. The filter waits * for this event in IBaseFilter::GetState(). */ HANDLE state_event;
1
0
0
0
Zebediah Figura : strmbase: Rename csFilter to filter_cs.
by Alexandre Julliard
19 Jan '21
19 Jan '21
Module: wine Branch: master Commit: 690afb42f66fcdc4778e706ef007caaadc41a05a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=690afb42f66fcdc4778e706e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jan 18 21:57:19 2021 -0600 strmbase: Rename csFilter to filter_cs. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/tests/amstream.c | 8 ++--- dlls/qasf/dmowrapper.c | 4 +-- dlls/qcap/filewriter.c | 4 +-- dlls/qcap/smartteefilter.c | 16 ++++----- dlls/qcap/vfwcapture.c | 4 +-- dlls/qedit/samplegrabber.c | 12 +++---- dlls/quartz/vmr9.c | 74 +++++++++++++++++++++--------------------- dlls/strmbase/filter.c | 40 +++++++++++------------ dlls/strmbase/pin.c | 52 ++++++++++++++--------------- dlls/winegstreamer/gstdemux.c | 12 +++---- include/wine/strmbase.h | 2 +- 11 files changed, 114 insertions(+), 114 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=690afb42f66fcdc4778e…
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
48
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Results per page:
10
25
50
100
200