Jacek Caban <jacek(a)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. -- Alexandre Julliard julliard(a)winehq.org