Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/ntdll/unix/loader.c | 2 +- dlls/ntdll/unix/signal_arm.c | 4 +++ dlls/ntdll/unix/signal_arm64.c | 3 +++ dlls/ntdll/unix/signal_i386.c | 5 ++++ dlls/ntdll/unix/signal_x86_64.c | 28 +++++++++++++++++++- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 7 ----- tools/winebuild/import.c | 45 +++++++++++++++++++++++++-------- 8 files changed, 76 insertions(+), 19 deletions(-)
Jacek Caban jacek@codeweavers.com writes:
/**********************************************************************
signal_init_threading
*/ void signal_init_threading(void) {
- int regs[4];
- void *ptr;
- extern void __wine_syscall_dispatcher_xsave(void) DECLSPEC_HIDDEN;
- ntdll_cpuid( regs, 1, 0 );
- if (regs[2] & (0x1 << 27)) /* xsave OS enabled */
- {
signal_syscall_dispatcher = __wine_syscall_dispatcher_xsave;
- }
- /* sneak in a syscall dispatcher pointer at a fixed address (7ffe1000) */
- ptr = (char *)user_shared_data + page_size;
- anon_mmap_fixed( ptr, page_size, PROT_READ | PROT_WRITE, 0 );
- *(void **)ptr = signal_syscall_dispatcher;
}
It seems it would be cleaner to do this after we have done the full CPU detection, and reuse the results instead of duplicating the cpuid checks.