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
March 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
1163 discussions
Start a n
N
ew thread
Hugh McMaster : reg/tests: Split whitespace 'import' tests from reg.c.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: 56d9d0f791046aeab85466e2ebadac63ce457f86 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=56d9d0f791046aeab85466e2…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Mar 1 14:16:49 2021 +1100 reg/tests: Split whitespace 'import' tests from reg.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/import.c | 294 ++++++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/reg.c | 294 -------------------------------------------- 2 files changed, 294 insertions(+), 294 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=56d9d0f791046aeab854…
1
0
0
0
Hugh McMaster : reg/tests: Split first sequence of Unicode 'import' tests from reg.c.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: 2e33ab5559419655584716669505e7943613d3bb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2e33ab555941965558471666…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Mar 1 14:16:48 2021 +1100 reg/tests: Split first sequence of Unicode 'import' tests from reg.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/import.c | 1550 ++++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/reg.c | 1551 +------------------------------------------ 2 files changed, 1551 insertions(+), 1550 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2e33ab55594196555847…
1
0
0
0
Hugh McMaster : reg/tests: Split first sequence of 'import' tests from reg.c.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: 58863f53316d2d88654d3a18c9481441dfabcb1a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=58863f53316d2d88654d3a18…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Mar 1 14:16:47 2021 +1100 reg/tests: Split first sequence of 'import' tests from reg.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/Makefile.in | 1 + programs/reg/tests/import.c | 1636 ++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/reg.c | 1620 +-------------------------------------- programs/reg/tests/reg_test.h | 16 + 4 files changed, 1658 insertions(+), 1615 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=58863f53316d2d88654d…
1
0
0
0
Hugh McMaster : reg/tests: Split 'query' tests from reg.c.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: 81a8938fa31de3d5a7a4c741582b4e5d9a2d1818 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81a8938fa31de3d5a7a4c741…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Mar 1 14:16:46 2021 +1100 reg/tests: Split 'query' tests from reg.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/Makefile.in | 1 + programs/reg/tests/query.c | 136 +++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/reg.c | 108 +------------------------------- programs/reg/tests/reg_test.h | 3 + 4 files changed, 141 insertions(+), 107 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=81a8938fa31de3d5a7a4…
1
0
0
0
Hugh McMaster : reg/tests: Split 'delete' tests from reg.c.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: d3f9eaeb54cd272cb34f2863c74b47e414c87bee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d3f9eaeb54cd272cb34f2863…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Mar 1 14:16:45 2021 +1100 reg/tests: Split 'delete' tests from reg.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/Makefile.in | 1 + programs/reg/tests/delete.c | 123 ++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/reg.c | 125 ++++------------------------------------- programs/reg/tests/reg_test.h | 56 ++++++++++++++++++ 4 files changed, 190 insertions(+), 115 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d3f9eaeb54cd272cb34f…
1
0
0
0
Jacek Caban : ntdll: Use syscall frame for FPU and XMM contexts in NtSetContextThread.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: 6e03330a2124dfcdd631d43672f5ead46ce9f334 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6e03330a2124dfcdd631d436…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 1 16:52:15 2021 +0100 ntdll: Use syscall frame for FPU and XMM contexts in NtSetContextThread. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 73 ++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index cec2a89c7bf..cc1e1d24e2a 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -770,23 +770,6 @@ static inline void restore_fpu( const CONTEXT *context ) } -/*********************************************************************** - * restore_fpux - * - * Restore the FPU extended context - */ -static inline void restore_fpux( const CONTEXT *context ) -{ - /* we have to enforce alignment by hand */ - char buffer[sizeof(XSAVE_FORMAT) + 16]; - XSAVE_FORMAT *state = (XSAVE_FORMAT *)(((ULONG_PTR)buffer + 15) & ~15); - - memcpy( state, context->ExtendedRegisters, sizeof(*state) ); - /* reset the current interrupt status */ - state->StatusWord &= state->ControlWord | 0xff80; - __asm__ __volatile__( "fxrstor %0" : : "m" (*state) ); -} - /*********************************************************************** * restore_xstate * @@ -867,6 +850,32 @@ static void fpux_to_fpu( FLOATING_SAVE_AREA *fpu, const XSAVE_FORMAT *fpux ) } +/*********************************************************************** + * fpu_to_fpux + * + * Fill extended FPU context from standard one. + */ +static void fpu_to_fpux( XSAVE_FORMAT *fpux, const FLOATING_SAVE_AREA *fpu ) +{ + unsigned int i; + + fpux->ControlWord = fpu->ControlWord; + fpux->StatusWord = fpu->StatusWord; + fpux->ErrorOffset = fpu->ErrorOffset; + fpux->ErrorSelector = fpu->ErrorSelector; + fpux->ErrorOpcode = fpu->ErrorSelector >> 16; + fpux->DataOffset = fpu->DataOffset; + fpux->DataSelector = fpu->DataSelector; + fpux->TagWord = 0; + for (i = 0; i < 8; i++) + { + if (((fpu->TagWord >> (i * 2)) & 3) != 3) + fpux->TagWord |= 1 << i; + memcpy( &fpux->FloatRegisters[i], &fpu->RegisterArea[10 * i], 10 ); + } +} + + /*********************************************************************** * save_context * @@ -1041,6 +1050,16 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, */ void signal_restore_full_cpu_context(void) { + struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() ); + + if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) + { + __asm__ volatile( "fxrstor %0" : : "m"(xsave->u.xsave) ); + } + else + { + __asm__ volatile( "frstor %0; fwait" : : "m" (xsave->u.fsave) ); + } set_full_cpu_context(); } @@ -1272,8 +1291,24 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) frame->fs = context->SegFs; frame->gs = context->SegGs; } - if (flags & CONTEXT_EXTENDED_REGISTERS) restore_fpux( context ); - else if (flags & CONTEXT_FLOATING_POINT) restore_fpu( context ); + if (flags & CONTEXT_EXTENDED_REGISTERS) + { + struct syscall_xsave *xsave = get_syscall_xsave( frame ); + memcpy( &xsave->u.xsave, context->ExtendedRegisters, sizeof(xsave->u.xsave) ); + /* reset the current interrupt status */ + xsave->u.xsave.StatusWord &= xsave->u.xsave.ControlWord | 0xff80; + } + else if (flags & CONTEXT_FLOATING_POINT) + { + if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) + { + fpu_to_fpux( &get_syscall_xsave( frame )->u.xsave, &context->FloatSave ); + } + else + { + get_syscall_xsave( frame )->u.fsave = context->FloatSave; + } + } restore_xstate( context );
1
0
0
0
Jacek Caban : ntdll: Use syscall frame for FPU and XMM contexts in NtGetContextThread.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: e5d671bee5dc78235c5c9942b4cb43853d0f045c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e5d671bee5dc78235c5c9942…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 1 16:51:48 2021 +0100 ntdll: Use syscall frame for FPU and XMM contexts in NtGetContextThread. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 7e383bdcaba..cec2a89c7bf 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -530,6 +530,11 @@ void set_syscall_frame(void *frame) x86_thread_data()->syscall_frame = frame; } +static struct syscall_xsave *get_syscall_xsave( struct syscall_frame *frame ) +{ + return (struct syscall_xsave *)((ULONG_PTR)((struct syscall_xsave *)frame - 1) & ~63); +} + static inline WORD get_cs(void) { WORD res; __asm__( "movw %%cs,%0" : "=r" (res) ); return res; } static inline WORD get_ds(void) { WORD res; __asm__( "movw %%ds,%0" : "=r" (res) ); return res; } static inline WORD get_fs(void) { WORD res; __asm__( "movw %%fs,%0" : "=r" (res) ); return res; } @@ -701,23 +706,6 @@ static inline void save_fpu( CONTEXT *context ) } -/*********************************************************************** - * save_fpux - * - * Save the thread FPU extended context. - */ -static inline void save_fpux( CONTEXT *context ) -{ - /* we have to enforce alignment by hand */ - char buffer[sizeof(XSAVE_FORMAT) + 16]; - XSAVE_FORMAT *state = (XSAVE_FORMAT *)(((ULONG_PTR)buffer + 15) & ~15); - - context->ContextFlags |= CONTEXT_EXTENDED_REGISTERS; - __asm__ __volatile__( "fxsave %0" : "=m" (*state) ); - memcpy( context->ExtendedRegisters, state, sizeof(*state) ); -} - - /*********************************************************************** * save_xstate * @@ -1328,6 +1316,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) if (self) { + struct syscall_xsave *xsave = get_syscall_xsave( frame ); if (needed_flags & CONTEXT_INTEGER) { context->Eax = frame->eax; @@ -1356,8 +1345,19 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->SegGs = frame->gs; context->ContextFlags |= CONTEXT_SEGMENTS; } - if (needed_flags & CONTEXT_FLOATING_POINT) save_fpu( context ); - if (needed_flags & CONTEXT_EXTENDED_REGISTERS) save_fpux( context ); + if (needed_flags & CONTEXT_FLOATING_POINT) + { + if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) + fpux_to_fpu( &context->FloatSave, &xsave->u.xsave ); + else + context->FloatSave = xsave->u.fsave; + context->ContextFlags |= CONTEXT_FLOATING_POINT; + } + if (needed_flags & CONTEXT_EXTENDED_REGISTERS) + { + memcpy( context->ExtendedRegisters, &xsave->u.xsave, sizeof(xsave->u.xsave) ); + context->ContextFlags |= CONTEXT_EXTENDED_REGISTERS; + } /* update the cached version of the debug registers */ if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386)) {
1
0
0
0
Jacek Caban : ntdll: Store FPU and XMM contexts in x86 syscall frame.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: ce5f17c89237460ac5063b81a45caff70927f276 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce5f17c89237460ac5063b81…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 1 16:51:32 2021 +0100 ntdll: Store FPU and XMM contexts in x86 syscall frame. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm.c | 1 + dlls/ntdll/unix/signal_i386.c | 23 ++++++++++++++++++++++- dlls/ntdll/unix/virtual.c | 1 - tools/winebuild/import.c | 28 +++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index cb4695939f5..5c96521e55e 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -918,6 +918,7 @@ void signal_init_threading(void) */ NTSTATUS signal_alloc_thread( TEB *teb ) { + teb->WOW32Reserved = __wine_syscall_dispatcher; return STATUS_SUCCESS; } diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 0234c7aa6f7..7e383bdcaba 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -461,6 +461,17 @@ enum i386_trap_code #endif }; +struct syscall_xsave +{ + union + { + XSAVE_FORMAT xsave; + FLOATING_SAVE_AREA fsave; + } u; +}; + +C_ASSERT( sizeof(struct syscall_xsave) == 0x200 ); + struct syscall_frame { DWORD eflags; /* 00 */ @@ -502,6 +513,8 @@ C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, gs ) C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, exit_frame ) == 0x1f4 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_frame ) == 0x1f8 ); +static void *syscall_dispatcher; + static inline struct x86_thread_data *x86_thread_data(void) { return (struct x86_thread_data *)ntdll_get_thread_data()->cpu_data; @@ -2424,6 +2437,7 @@ NTSTATUS signal_alloc_thread( TEB *teb ) } else thread_data->fs = gdt_fs_sel; + teb->WOW32Reserved = syscall_dispatcher; return STATUS_SUCCESS; } @@ -2501,7 +2515,14 @@ void signal_init_process(void) */ void *signal_init_syscalls(void) { - return __wine_syscall_dispatcher; + extern void __wine_syscall_dispatcher_fxsave(void) DECLSPEC_HIDDEN; + + if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) + syscall_dispatcher = __wine_syscall_dispatcher_fxsave; + else + syscall_dispatcher = __wine_syscall_dispatcher; + + return NtCurrentTeb()->WOW32Reserved = syscall_dispatcher; } diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 3350dc665c1..a707faae2a5 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2556,7 +2556,6 @@ static void init_teb( TEB *teb, PEB *peb ) PtrToUlong( &teb64->ActivationContextStack.FrameListCache ); teb64->StaticUnicodeString.Buffer = PtrToUlong( teb64->StaticUnicodeBuffer ); teb64->StaticUnicodeString.MaximumLength = sizeof( teb64->StaticUnicodeBuffer ); - teb->WOW32Reserved = __wine_syscall_dispatcher; #endif teb->Peb = peb; teb->Tib.Self = &teb->Tib; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index c760903dbd1..53d77a19e23 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1456,7 +1456,19 @@ static void output_syscall_dispatcher( int count, const char *variant ) output( "\tmovl %%ecx,-0x28(%%ebp)\n" ); /* frame->esp */ output( "\tmovl 4(%%ebp),%%ecx\n" ); output( "\tmovl %%ecx,-0x2c(%%ebp)\n" ); /* frame->eip */ - output( "\tmovl %%esp,%%fs:0x1f8\n" ); /* x86_thread_data()->syscall_frame */ + output( "\tsubl $0x200,%%esp\n") ; + output( "\tandl $~63,%%esp\n" ); + if (!*variant) + { + output( "\tfnsave (%%esp)\n" ); + output( "\tfwait\n" ); + } + else + { + output( "\tfxsave (%%esp)\n" ); + } + output( "\tleal -0x30(%%ebp),%%ecx\n" ); + output( "\tmovl %%ecx,%%fs:0x1f8\n" ); /* x86_thread_data()->syscall_frame */ output( "\tcmpl $%u,%%eax\n", count ); output( "\tjae 4f\n" ); if (UsePIC) @@ -1479,6 +1491,17 @@ static void output_syscall_dispatcher( int count, const char *variant ) else output( "\tcall *.Lsyscall_table(,%%eax,4)\n" ); output( "2:\tmovl $0,%%fs:0x1f8\n" ); + output( "\tleal -0x230(%%ebp),%%ebx\n") ; + output( "\tandl $~63,%%ebx\n" ); + if (!*variant) + { + output( "\tfrstor (%%ebx)\n" ); + output( "\tfwait\n" ); + } + else + { + output( "\tfxrstor (%%ebx)\n" ); + } output( "\tleal -0x30(%%ebp),%%ebx\n" ); output_cfi( ".cfi_def_cfa_register %%ebx" ); output_cfi( ".cfi_adjust_cfa_offset 0x30\n" ); @@ -1792,6 +1815,9 @@ void output_syscalls( DLLSPEC *spec ) switch( target_cpu ) { + case CPU_x86: + output_syscall_dispatcher( count, "_fxsave" ); + break; case CPU_x86_64: output_syscall_dispatcher( count, "_xsave" ); output_syscall_dispatcher( count, "_xsavec" );
1
0
0
0
Jacek Caban : ntdll: Use syscall frame in x86 call_raise_user_exception_dispatcher implementation.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: bbae70bf1e964ee6b30a7e63b0ff03585221d068 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bbae70bf1e964ee6b30a7e63…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 1 16:51:15 2021 +0100 ntdll: Use syscall frame in x86 call_raise_user_exception_dispatcher implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 5e6d5fb25eb..0234c7aa6f7 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1782,16 +1782,10 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher, /*********************************************************************** * call_raise_user_exception_dispatcher */ -__ASM_GLOBAL_FUNC( call_raise_user_exception_dispatcher, - "movl %fs:0x1f8,%eax\n\t" /* x86_thread_data()->syscall_frame */ - "movl 0x1c(%eax),%ebx\n\t" /* frame->ebx */ - "movl 0x28(%eax),%edi\n\t" /* frame->edi */ - "movl 0x2c(%eax),%esi\n\t" /* frame->esi */ - "movl 0x30(%eax),%ebp\n\t" /* frame->ebp */ - "movl 4(%esp),%edx\n\t" /* dispatcher */ - "movl $0,%fs:0x1f8\n\t" - "leal 0x38(%eax),%esp\n\t" - "jmp *%edx" ) +void WINAPI call_raise_user_exception_dispatcher( NTSTATUS (WINAPI *dispatcher)(void) ) +{ + x86_thread_data()->syscall_frame->eip = (DWORD)dispatcher; +} /***********************************************************************
1
0
0
0
Jacek Caban : ntdll: Restore all non-volatile i386 registers in syscall dispatcher.
by Alexandre Julliard
01 Mar '21
01 Mar '21
Module: wine Branch: master Commit: e341d1f695311725752c287057f6c6ab60fdf2a3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e341d1f695311725752c2870…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 1 16:51:05 2021 +0100 ntdll: Restore all non-volatile i386 registers in syscall dispatcher. Based on set_full_cpu_context. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/import.c | 63 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 720cf0589fd..c760903dbd1 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1458,7 +1458,7 @@ static void output_syscall_dispatcher( int count, const char *variant ) output( "\tmovl %%ecx,-0x2c(%%ebp)\n" ); /* frame->eip */ output( "\tmovl %%esp,%%fs:0x1f8\n" ); /* x86_thread_data()->syscall_frame */ output( "\tcmpl $%u,%%eax\n", count ); - output( "\tjae 3f\n" ); + output( "\tjae 4f\n" ); if (UsePIC) { output( "\tmovl %%eax,%%edx\n" ); @@ -1479,19 +1479,54 @@ static void output_syscall_dispatcher( int count, const char *variant ) else output( "\tcall *.Lsyscall_table(,%%eax,4)\n" ); output( "2:\tmovl $0,%%fs:0x1f8\n" ); - output( "\tmovl -0x14(%%ebp),%%ebx\n" ); - output_cfi( ".cfi_same_value %%ebx\n" ); - output( "\tmovl -0x08(%%ebp),%%edi\n" ); - output_cfi( ".cfi_same_value %%edi\n" ); - output( "\tmovl -0x04(%%ebp),%%esi\n" ); - output_cfi( ".cfi_same_value %%esi\n" ); - output( "\tmovl %%ebp,%%esp\n" ); - output_cfi( ".cfi_def_cfa %%esp,8\n" ); - output( "\tpopl %%ebp\n" ); - output_cfi( ".cfi_adjust_cfa_offset -4\n" ); - output_cfi( ".cfi_same_value %%ebp\n" ); - output( "\tret\n" ); - output( "3:\tmovl $0x%x,%%eax\n", invalid_param ); + output( "\tleal -0x30(%%ebp),%%ebx\n" ); + output_cfi( ".cfi_def_cfa_register %%ebx" ); + output_cfi( ".cfi_adjust_cfa_offset 0x30\n" ); + output( "\tmovl %%eax,0x18(%%ebx)\n" ); + output( "\tmovw 0x16(%%ebx),%%gs\n" ); + output( "\tmovw 0x14(%%ebx),%%fs\n" ); + output( "\tmovw 0x12(%%ebx),%%es\n" ); + output( "\tmovl 0x28(%%ebx),%%edi\n" ); + output_cfi( ".cfi_same_value %%edi" ); + output( "\tmovl 0x2c(%%ebx),%%esi\n" ); + output_cfi( ".cfi_same_value %%esi" ); + output( "\tmovl (%%ebp),%%ebp\n" ); + output_cfi( ".cfi_same_value %%ebp" ); + output( "\tmovw %%ss,%%cx\n" ); + output( "\tcmpw 0x0e(%%ebx),%%cx\n" ); + output( "\tjne 3f\n" ); + /* As soon as we have switched stacks the context structure could + * be invalid (when signal handlers are executed for example). Copy + * values on the target stack before changing ESP. */ + output( "\tmovl 0x08(%%ebx),%%ecx\n" ); + output( "\tleal -3*4(%%ecx),%%ecx\n" ); + output( "\tmovl (%%ebx),%%edx\n" ); + output( "\tmovl %%edx,2*4(%%ecx)\n" ); + output( "\tmovl 0x0c(%%ebx),%%edx\n" ); + output( "\tmovl %%edx,1*4(%%ecx)\n" ); + output( "\tmovl 0x04(%%ebx),%%edx\n" ); + output( "\tmovl %%edx,0*4(%%ecx)\n" ); + output( "\tpushl 0x10(%%ebx)\n" ); + output( "\tmovl 0x1c(%%ebx),%%ebx\n" ); + output_cfi( ".cfi_same_value %%ebx" ); + output( "\tpopl %%ds\n" ); + output( "\tmovl %%ecx,%%esp\n" ); + output( "\tiret\n" ); + /* Restore the context when the stack segment changes. We can't use + * the same code as above because we do not know if the stack segment + * is 16 or 32 bit, and 'movl' will throw an exception when we try to + * access memory above the limit. */ + output( "\t3:\tmovl 0x18(%%ebx),%%ecx\n" ); + output( "\tmovw 0x0e(%%ebx),%%ss\n" ); + output( "\tmovl 0x08(%%ebx),%%esp\n" ); + output( "\tpushl 0x00(%%ebx)\n" ); + output( "\tpushl 0x0c(%%ebx)\n" ); + output( "\tpushl 0x04(%%ebx)\n" ); + output( "\tpushl 0x10(%%ebx)\n" ); + output( "\tmovl 0x1c(%%ebx),%%ebx\n" ); + output( "\tpopl %%ds\n" ); + output( "\tiret\n" ); + output( "4:\tmovl $0x%x,%%eax\n", invalid_param ); output( "\tjmp 2b\n" ); break; case CPU_x86_64:
1
0
0
0
← Newer
1
...
109
110
111
112
113
114
115
116
117
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200