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 2011
----- 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
879 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Verify we have at least one framebuffer attachment before doing clears or draws .
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 2469597e2a9b3ea2072fa5964a44d255c77e47e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2469597e2a9b3ea2072fa5964…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 26 19:45:02 2011 +0100 wined3d: Verify we have at least one framebuffer attachment before doing clears or draws. --- dlls/wined3d/context.c | 32 ++++++++++++++++++++++++++++++-- dlls/wined3d/device.c | 7 ++++++- dlls/wined3d/drawprim.c | 7 ++++++- dlls/wined3d/wined3d_private.h | 4 ++-- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 5ecd748..d9bb5d8 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2053,13 +2053,33 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp SetupForBlit(device, context); } +static BOOL context_validate_rt_config(UINT rt_count, + IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *ds) +{ + unsigned int i; + + if (ds) return TRUE; + + for (i = 0; i < rt_count; ++i) + { + if (rts[i]) return TRUE; + } + + WARN("Invalid render target config, need at least one attachment.\n"); + return FALSE; +} + /* Context activation is done by the caller. */ -void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device, +BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device, UINT rt_count, IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *depth_stencil) { const struct StateEntry *state_table = device->StateTable; UINT i; + if (!context_validate_rt_config(rt_count, rts, depth_stencil)) + return FALSE; + + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { context_validate_onscreen_formats(device, context, depth_stencil); @@ -2108,14 +2128,20 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), state_table); Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), state_table); Context_MarkStateDirty(context, STATE_SCISSORRECT, state_table); + + return TRUE; } /* Context activation is done by the caller. */ -void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) +BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) { const struct StateEntry *state_table = device->StateTable; unsigned int i; + if (!context_validate_rt_config(context->gl_info->limits.buffers, + device->render_targets, device->depth_stencil)) + return FALSE; + /* Preload resources before FBO setup. Texture preload in particular may * result in changes to the current FBO, due to using e.g. FBO blits for * updating a resource location. */ @@ -2166,6 +2192,8 @@ void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp LEAVE_GL(); context->numDirtyEntries = 0; /* This makes the whole list clean */ context->last_was_blit = FALSE; + + return TRUE; } static void context_setup_target(IWineD3DDeviceImpl *device, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 71c63b2..92bc151 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -686,7 +686,12 @@ HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, I return WINED3D_OK; } - context_apply_clear_state(context, device, rt_count, rts, depth_stencil); + if (!context_apply_clear_state(context, device, rt_count, rts, depth_stencil)) + { + context_release(context); + WARN("Failed to apply clear state, skipping clear.\n"); + return WINED3D_OK; + } target->get_drawable_size(context, &drawable_width, &drawable_height); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index a3b0053..e476d64 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -591,7 +591,12 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx, return; } - context_apply_draw_state(context, device); + if (!context_apply_draw_state(context, device)) + { + context_release(context); + WARN("Unable to apply draw state, skipping draw.\n"); + return; + } if (device->depth_stencil) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 96b845f..2ec621a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1212,9 +1212,9 @@ void context_alloc_event_query(struct wined3d_context *context, void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; -void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device, +BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device, UINT rt_count, IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN; -void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; +BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_attach_depth_stencil_fbo(struct wined3d_context *context,
1
0
0
0
Alexandre Julliard : winebuild: Get rid of support for register entry points on x86_64.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: bea2be5ccebba363b69e8186a102c8bbe376ea2a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bea2be5ccebba363b69e8186a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 14:08:57 2011 +0100 winebuild: Get rid of support for register entry points on x86_64. --- tools/winebuild/relay.c | 183 ---------------------------------------------- tools/winebuild/spec32.c | 4 +- 2 files changed, 3 insertions(+), 184 deletions(-) diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 1c84394..4fa256f 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -992,186 +992,6 @@ void output_asm_relays16(void) /******************************************************************* - * build_call_from_regs_x86_64 - * - * Build the register saving code for a 'register' entry point. - * - * Stack layout: - * ... - * (rsp+16) first arg - * (rsp+8) ret addr to user code - * (rsp) ret addr to relay code - * (rsp-128) buffer area to allow stack frame manipulation - * - * Parameters: - * %rcx number of args - * %rdx entry point - */ -static void build_call_from_regs_x86_64(void) -{ - static const int STACK_SPACE = 128 + 0x4d0; /* size of x86_64 context */ - int i; - - /* Function header */ - - output( "\t.text\n" ); - function_header( "__wine_call_from_regs" ); - - output_cfi( ".cfi_startproc" ); - output( "\tsubq $%u,%%rsp\n", STACK_SPACE ); - output_cfi( ".cfi_adjust_cfa_offset %u", STACK_SPACE ); - - /* save registers into the context */ - - output( "\tmovq %%rax,0x78(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rax,0x78" ); - output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); /* saved %rcx on stack */ - output( "\tmovq %%rax,0x80(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rcx,0x80" ); - output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 24 ); /* saved %rdx on stack */ - output_cfi( ".cfi_rel_offset %%rdx,0x88" ); - output( "\tmovq %%rax,0x88(%%rsp)\n" ); - output( "\tmovq %%rbx,0x90(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rbx,0x90" ); - output( "\tleaq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); - output( "\tmovq %%rax,0x98(%%rsp)\n" ); - output( "\tmovq %%rbp,0xa0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rbp,0xa0" ); - output( "\tmovq %%rsi,0xa8(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rsi,0xa8" ); - output( "\tmovq %%rdi,0xb0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%rdi,0xb0" ); - output( "\tmovq %%r8,0xb8(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r8,0xb8" ); - output( "\tmovq %%r9,0xc0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r9,0xc0" ); - output( "\tmovq %%r10,0xc8(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r10,0xc8" ); - output( "\tmovq %%r11,0xd0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r11,0xd0" ); - output( "\tmovq %%r12,0xd8(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r12,0xd8" ); - output( "\tmovq %%r13,0xe0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r13,0xe0" ); - output( "\tmovq %%r14,0xe8(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r14,0xe8" ); - output( "\tmovq %%r15,0xf0(%%rsp)\n" ); - output_cfi( ".cfi_rel_offset %%r15,0xf0" ); - output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 8 ); - output( "\tmovq %%rax,0xf8(%%rsp)\n" ); - - output( "\tstmxcsr 0x34(%%rsp)\n" ); - output( "\tfxsave 0x100(%%rsp)\n" ); - for (i = 0; i < 16; i++) - { - output( "\tmovdqa %%xmm%u,0x%x(%%rsp)\n", i, 0x1a0 + 16 * i ); - output_cfi( ".cfi_rel_offset %%xmm%u,0x%x", i, 0x1a0 + 16 * i ); - } - - output( "\tmovw %%cs,0x38(%%rsp)\n" ); - output( "\tmovw %%ds,0x3a(%%rsp)\n" ); - output( "\tmovw %%es,0x3c(%%rsp)\n" ); - output( "\tmovw %%fs,0x3e(%%rsp)\n" ); - output( "\tmovw %%gs,0x40(%%rsp)\n" ); - output( "\tmovw %%ss,0x42(%%rsp)\n" ); - output( "\tpushfq\n" ); - output( "\tpopq %%rax\n" ); - output( "\tmovl %%eax,0x44(%%rsp)\n" ); - - output( "\tmovl $0x%x,0x30(%%rsp)\n", 0x0010000f ); - - /* transfer the arguments */ - - output( "\tmovq %%r8,%u(%%rsp)\n", STACK_SPACE + 32 ); - output( "\tmovq %%r9,%u(%%rsp)\n", STACK_SPACE + 40 ); - output( "\tmovq $4,%%rax\n" ); - output( "\tleaq %u(%%rsp),%%rsi\n", STACK_SPACE + 16 ); - output( "\tcmpq %%rax,%%rcx\n" ); - output( "\tcmovgq %%rcx,%%rax\n" ); - output( "\tmovq %%rsp,%%rbx\n" ); - output_cfi( ".cfi_def_cfa_register %%rbx" ); - output( "\tleaq 16(,%%rax,8),%%rax\n" ); /* add 8 for context arg and 8 for rounding */ - output( "\tandq $~15,%%rax\n" ); - output( "\tsubq %%rax,%%rsp\n" ); - output( "\tmovq %%rsp,%%rdi\n" ); - output( "\tjrcxz 1f\n" ); - output( "\tcld\n" ); - output( "\trep\n\tmovsq\n" ); - output( "1:\tmovq %%rbx,0(%%rdi)\n" ); /* context arg */ - - /* call the entry point */ - - output( "\tmovq %%rdx,%%rax\n" ); - output( "\tmovq 0(%%rsp),%%rcx\n" ); - output( "\tmovq 8(%%rsp),%%rdx\n" ); - output( "\tmovq 16(%%rsp),%%r8\n" ); - output( "\tmovq 24(%%rsp),%%r9\n" ); - output( "\tcallq *%%rax\n" ); - - /* restore the context structure */ - - output( "1:\tmovq 0x80(%%rbx),%%rcx\n" ); - output_cfi( ".cfi_same_value %%rcx" ); - output( "\tmovq 0x88(%%rbx),%%rdx\n" ); - output_cfi( ".cfi_same_value %%rdx" ); - output( "\tmovq 0xa0(%%rbx),%%rbp\n" ); - output_cfi( ".cfi_same_value %%rbp" ); - output( "\tmovq 0xa8(%%rbx),%%rsi\n" ); - output_cfi( ".cfi_same_value %%rsi" ); - output( "\tmovq 0xb0(%%rbx),%%rdi\n" ); - output_cfi( ".cfi_same_value %%rdi" ); - output( "\tmovq 0xb8(%%rbx),%%r8\n" ); - output_cfi( ".cfi_same_value %%r8" ); - output( "\tmovq 0xc0(%%rbx),%%r9\n" ); - output_cfi( ".cfi_same_value %%r9" ); - output( "\tmovq 0xc8(%%rbx),%%r10\n" ); - output_cfi( ".cfi_same_value %%r10" ); - output( "\tmovq 0xd0(%%rbx),%%r11\n" ); - output_cfi( ".cfi_same_value %%r11" ); - output( "\tmovq 0xd8(%%rbx),%%r12\n" ); - output_cfi( ".cfi_same_value %%r12" ); - output( "\tmovq 0xe0(%%rbx),%%r13\n" ); - output_cfi( ".cfi_same_value %%r13" ); - output( "\tmovq 0xe8(%%rbx),%%r14\n" ); - output_cfi( ".cfi_same_value %%r14" ); - output( "\tmovq 0xf0(%%rbx),%%r15\n" ); - output_cfi( ".cfi_same_value %%r15" ); - - for (i = 0; i < 16; i++) - { - output( "\tmovdqa 0x%x(%%rbx),%%xmm%u\n", 0x1a0 + 16 * i, i ); - output_cfi( ".cfi_same_value %%xmm%u", i ); - } - output( "\tfxrstor 0x100(%%rbx)\n" ); - output( "\tldmxcsr 0x34(%%rbx)\n" ); - - output( "\tmovq 0xf8(%%rbx),%%rax\n" ); /* rip */ - output( "\tmovq %%rax,0(%%rsp)\n" ); - output( "\tmovw 0x38(%%rbx),%%ax\n" ); /* cs */ - output( "\tmovq %%rax,0x8(%%rsp)\n" ); - output( "\tmovl 0x44(%%rbx),%%eax\n" ); /* flags */ - output( "\tmovq %%rax,0x10(%%rsp)\n" ); - output( "\tmovq 0x98(%%rbx),%%rax\n" ); /* rsp */ - output( "\tmovq %%rax,0x18(%%rsp)\n" ); - output( "\tmovw 0x42(%%rbx),%%ax\n" ); /* ss */ - output( "\tmovq %%rax,0x20(%%rsp)\n" ); - output( "\tmovq 0x78(%%rbx),%%rax\n" ); - output( "\tmovq 0x90(%%rbx),%%rbx\n" ); - output( "\tiretq\n" ); - output_cfi( ".cfi_endproc" ); - - output_function_size( "__wine_call_from_regs" ); - - function_header( "__wine_restore_regs" ); - output_cfi( ".cfi_startproc" ); - output( "\tmovq %%rcx,%%rbx\n" ); - output( "\tjmp 1b\n" ); - output_cfi( ".cfi_endproc" ); - output_function_size( "__wine_restore_regs" ); -} - - -/******************************************************************* * output_asm_relays * * Build all the assembly relay callbacks @@ -1183,9 +1003,6 @@ void output_asm_relays(void) case CPU_x86: build_call_from_regs_x86(); break; - case CPU_x86_64: - build_call_from_regs_x86_64(); - break; default: break; } diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 29436f1..e16260a 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -55,6 +55,8 @@ static inline int needs_relay( const ORDDEF *odp ) if (odp->type != TYPE_STDCALL && odp->type != TYPE_CDECL && odp->type != TYPE_THISCALL) return 0; /* skip norelay and forward entry points */ if (odp->flags & (FLAG_NORELAY|FLAG_FORWARD)) return 0; + /* skip register entry points on x86_64 */ + if (target_cpu == CPU_x86_64 && (odp->flags & FLAG_REGISTER)) return 0; return 1; } @@ -206,7 +208,7 @@ static void output_relay_debug( DLLSPEC *spec ) output( "\tleaq 40(%%rsp),%%r8\n" ); output( "\tmovq $%u,%%rdx\n", (flags << 24) | (args << 16) | (i - spec->base) ); output( "\tleaq .L__wine_spec_relay_descr(%%rip),%%rcx\n" ); - output( "\tcallq *%u(%%rcx)\n", (odp->flags & FLAG_REGISTER) ? 16 : 8 ); + output( "\tcallq *8(%%rcx)\n" ); output( "\taddq $40,%%rsp\n" ); output( "\t.cfi_adjust_cfa_offset -40\n" ); output( "\tret\n" );
1
0
0
0
Alexandre Julliard : ntdll: Get rid of support for register entry points on x86_64.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: b41cc4865cc5c5adaad8233715a4c47384a5a0c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b41cc4865cc5c5adaad823371…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 14:03:39 2011 +0100 ntdll: Get rid of support for register entry points on x86_64. --- dlls/ntdll/ntdll_misc.h | 8 ------ dlls/ntdll/relay.c | 65 +--------------------------------------------- 2 files changed, 2 insertions(+), 71 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 1a9c40e..62a9b0e 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -242,14 +242,6 @@ static inline struct ntdll_thread_data *ntdll_get_thread_data(void) ".byte 0x6a," #args "\n\t" /* pushl $args */ \ "call " __ASM_NAME("__wine_call_from_regs") "\n\t" \ "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ -#elif defined(__x86_64__) -#define DEFINE_REGS_ENTRYPOINT( name, args ) \ - __ASM_GLOBAL_FUNC( name, \ - "movq %rcx,8(%rsp)\n\t" \ - "movq %rdx,16(%rsp)\n\t" \ - "movq $" #args ",%rcx\n\t" \ - "leaq " __ASM_NAME("__regs_") #name "(%rip),%rdx\n\t" \ - "call " __ASM_NAME("__wine_call_from_regs")) #endif #endif diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index 296a89a..4855a00 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -509,71 +509,10 @@ DEFINE_REGS_ENTRYPOINT( relay_call_regs, 4 ) #else /* __i386__ */ -void WINAPI __regs_relay_call_regs( struct relay_descr *descr, INT_PTR idx, - INT_PTR *stack, CONTEXT *context ) +void WINAPI relay_call_regs( struct relay_descr *descr, INT_PTR idx, INT_PTR *stack ) { - WORD ordinal = LOWORD(idx); - BYTE nb_args = LOBYTE(HIWORD(idx)); - struct relay_private_data *data = descr->private; - struct relay_entry_point *entry_point = data->entry_points + ordinal; - BYTE *orig_func = entry_point->orig_func; - INT_PTR *args = stack + 1; - INT_PTR args_copy[32]; - - /* restore the context to what it was before the relay thunk */ - context->Rip = stack[0]; - context->Rsp = (INT_PTR)args; - - if (TRACE_ON(relay)) - { - if (entry_point->name) - DPRINTF( "%04x:Call %s.%s(", GetCurrentThreadId(), data->dllname, entry_point->name ); - else - DPRINTF( "%04x:Call %s.%u(", GetCurrentThreadId(), data->dllname, data->base + ordinal ); - RELAY_PrintArgs( args, nb_args, descr->arg_types[ordinal] ); - DPRINTF( ") ret=%08lx\n", context->Rip ); - - DPRINTF( "%04x: rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", - GetCurrentThreadId(), context->Rax, context->Rbx, context->Rcx, context->Rdx, - context->Rsi, context->Rdi, context->Rbp, context->Rsp ); - DPRINTF( "%04x: r8=%016lx r9=%016lx r10=%016lx r11=%016lx r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", - GetCurrentThreadId(), context->R8, context->R9, context->R10, context->R11, - context->R12, context->R13, context->R14, context->R15 ); - - assert( orig_func[17] == 0x48 /* leaq */ ); - assert( orig_func[18] == 0x8d ); - assert( orig_func[19] == 0x15 ); - assert( orig_func[24] == 0xe8 /* call */ ); - } - - /* now call the real function */ - - memcpy( args_copy, args, nb_args * sizeof(args[0]) ); - args_copy[nb_args++] = (INT_PTR)context; /* append context argument */ - - call_entry_point( orig_func + 24 + *(int *)(orig_func + 20), nb_args, args_copy, 0 ); - - - if (TRACE_ON(relay)) - { - if (entry_point->name) - DPRINTF( "%04x:Ret %s.%s() retval=%08lx ret=%08lx\n", - GetCurrentThreadId(), data->dllname, entry_point->name, - context->Rax, context->Rip ); - else - DPRINTF( "%04x:Ret %s.%u() retval=%08lx ret=%08lx\n", - GetCurrentThreadId(), data->dllname, data->base + ordinal, - context->Rax, context->Rip ); - DPRINTF( "%04x: rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", - GetCurrentThreadId(), context->Rax, context->Rbx, context->Rcx, context->Rdx, - context->Rsi, context->Rdi, context->Rbp, context->Rsp ); - DPRINTF( "%04x: r8=%016lx r9=%016lx r10=%016lx r11=%016lx r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", - GetCurrentThreadId(), context->R8, context->R9, context->R10, context->R11, - context->R12, context->R13, context->R14, context->R15 ); - } + assert(0); /* should never be called */ } -extern void WINAPI relay_call_regs(void); -DEFINE_REGS_ENTRYPOINT( relay_call_regs, 3 ) #endif /* __i386__ */
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlRaiseException for x86_64 directly instead of using the winebuild-generated code .
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 672a084584524dfb173819a30b19b87aa14bf8f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=672a084584524dfb173819a30…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 13:59:45 2011 +0100 ntdll: Implement RtlRaiseException for x86_64 directly instead of using the winebuild-generated code. --- dlls/ntdll/signal_x86_64.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index c1d1b84..86f5c93 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -3098,7 +3098,22 @@ void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context ) status = raise_exception( rec, context, TRUE ); if (status != STATUS_SUCCESS) raise_status( status, rec ); } -DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 ) +__ASM_GLOBAL_FUNC( RtlRaiseException, + "movq %rcx,8(%rsp)\n\t" + "sub $0x4f8,%rsp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 0x4f8\n\t") + "leaq 0x20(%rsp),%rcx\n\t" + "call " __ASM_NAME("RtlCaptureContext") "\n\t" + "leaq 0x20(%rsp),%rdx\n\t" /* context pointer */ + "movq 0x4f8(%rsp),%rax\n\t" /* return address */ + "movq %rax,0xf8(%rdx)\n\t" /* context->Rip */ + "leaq 0x500(%rsp),%rax\n\t" /* orig stack pointer */ + "movq %rax,0x98(%rdx)\n\t" /* context->Rsp */ + "movq (%rax),%rcx\n\t" /* original first parameter */ + "movq %rcx,0x80(%rdx)\n\t" /* context->Rcx */ + "call " __ASM_NAME("__regs_RtlRaiseException") "\n\t" + "leaq 0x20(%rsp),%rdi\n\t" /* context pointer */ + "call " __ASM_NAME("set_cpu_context") /* does not return */ ); /*************************************************************************
1
0
0
0
Alexandre Julliard : ntdll: Implement set_cpu_context for x86_64 directly instead of using the winebuild-generated code .
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 1e6ff42d0329b368e346d84f950902dcf6159ba5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e6ff42d0329b368e346d84f9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 12:46:55 2011 +0100 ntdll: Implement set_cpu_context for x86_64 directly instead of using the winebuild-generated code. --- dlls/ntdll/signal_x86_64.c | 53 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 47 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index ae9a2bd..c1d1b84 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1515,12 +1515,53 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, * * Set the new CPU context. */ -void set_cpu_context( const CONTEXT *context ) -{ - extern void CDECL __wine_restore_regs( const CONTEXT * ) DECLSPEC_NORETURN; - __wine_restore_regs( context ); -} - +__ASM_GLOBAL_FUNC( set_cpu_context, + "subq $40,%rsp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 40\n\t") + "ldmxcsr 0x34(%rdi)\n\t" /* context->MxCsr */ + "movw 0x38(%rdi),%ax\n\t" /* context->SegCs */ + "movq %rax,8(%rsp)\n\t" + "movw 0x42(%rdi),%ax\n\t" /* context->SegSs */ + "movq %rax,32(%rsp)\n\t" + "movq 0x44(%rdi),%rax\n\t" /* context->Eflags */ + "movq %rax,16(%rsp)\n\t" + "movq 0x80(%rdi),%rcx\n\t" /* context->Rcx */ + "movq 0x88(%rdi),%rdx\n\t" /* context->Rdx */ + "movq 0x90(%rdi),%rbx\n\t" /* context->Rbx */ + "movq 0x98(%rdi),%rax\n\t" /* context->Rsp */ + "movq %rax,24(%rsp)\n\t" + "movq 0xa0(%rdi),%rbp\n\t" /* context->Rbp */ + "movq 0xa8(%rdi),%rsi\n\t" /* context->Rsi */ + "movq 0xb8(%rdi),%r8\n\t" /* context->R8 */ + "movq 0xc0(%rdi),%r9\n\t" /* context->R9 */ + "movq 0xc8(%rdi),%r10\n\t" /* context->R10 */ + "movq 0xd0(%rdi),%r11\n\t" /* context->R11 */ + "movq 0xd8(%rdi),%r12\n\t" /* context->R12 */ + "movq 0xe0(%rdi),%r13\n\t" /* context->R13 */ + "movq 0xe8(%rdi),%r14\n\t" /* context->R14 */ + "movq 0xf0(%rdi),%r15\n\t" /* context->R15 */ + "movq 0xf8(%rdi),%rax\n\t" /* context->Rip */ + "movq %rax,(%rsp)\n\t" + "fxrstor 0x100(%rdi)\n\t" /* context->FtlSave */ + "movdqa 0x1a0(%rdi),%xmm0\n\t" /* context->Xmm0 */ + "movdqa 0x1b0(%rdi),%xmm1\n\t" /* context->Xmm1 */ + "movdqa 0x1c0(%rdi),%xmm2\n\t" /* context->Xmm2 */ + "movdqa 0x1d0(%rdi),%xmm3\n\t" /* context->Xmm3 */ + "movdqa 0x1e0(%rdi),%xmm4\n\t" /* context->Xmm4 */ + "movdqa 0x1f0(%rdi),%xmm5\n\t" /* context->Xmm5 */ + "movdqa 0x200(%rdi),%xmm6\n\t" /* context->Xmm6 */ + "movdqa 0x210(%rdi),%xmm7\n\t" /* context->Xmm7 */ + "movdqa 0x220(%rdi),%xmm8\n\t" /* context->Xmm8 */ + "movdqa 0x230(%rdi),%xmm9\n\t" /* context->Xmm9 */ + "movdqa 0x240(%rdi),%xmm10\n\t" /* context->Xmm10 */ + "movdqa 0x250(%rdi),%xmm11\n\t" /* context->Xmm11 */ + "movdqa 0x260(%rdi),%xmm12\n\t" /* context->Xmm12 */ + "movdqa 0x270(%rdi),%xmm13\n\t" /* context->Xmm13 */ + "movdqa 0x280(%rdi),%xmm14\n\t" /* context->Xmm14 */ + "movdqa 0x290(%rdi),%xmm15\n\t" /* context->Xmm15 */ + "movq 0x78(%rdi),%rax\n\t" /* context->Rax */ + "movq 0xb0(%rdi),%rdi\n\t" /* context->Rdi */ + "iretq" ); /*********************************************************************** * copy_context
1
0
0
0
Alexandre Julliard : ntdll: Avoid copying and restoring the context in RtlCaptureContext for x86_64.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 33e6238f0481f9f0ef94d87a250011390549b28b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=33e6238f0481f9f0ef94d87a2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 12:20:19 2011 +0100 ntdll: Avoid copying and restoring the context in RtlCaptureContext for x86_64. --- dlls/ntdll/signal_x86_64.c | 56 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 50 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index ad49411..ae9a2bd 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1459,12 +1459,56 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) /*********************************************************************** * RtlCaptureContext (NTDLL.@) */ -void WINAPI __regs_RtlCaptureContext( CONTEXT *context, CONTEXT *regs ) -{ - *context = *regs; -} -DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 ) - +__ASM_GLOBAL_FUNC( RtlCaptureContext, + "pushfq\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") + "movl $0x001000f,0x30(%rcx)\n\t" /* context->ContextFlags */ + "stmxcsr 0x34(%rcx)\n\t" /* context->MxCsr */ + "movw %cs,0x38(%rcx)\n\t" /* context->SegCs */ + "movw %ds,0x3a(%rcx)\n\t" /* context->SegDs */ + "movw %es,0x3c(%rcx)\n\t" /* context->SegEs */ + "movw %fs,0x3e(%rcx)\n\t" /* context->SegFs */ + "movw %gs,0x40(%rcx)\n\t" /* context->SegGs */ + "movw %ss,0x42(%rcx)\n\t" /* context->SegSs */ + "popq 0x44(%rcx)\n\t" /* context->Eflags */ + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") + "movq %rax,0x78(%rcx)\n\t" /* context->Rax */ + "movq %rcx,0x80(%rcx)\n\t" /* context->Rcx */ + "movq %rdx,0x88(%rcx)\n\t" /* context->Rdx */ + "movq %rbx,0x90(%rcx)\n\t" /* context->Rbx */ + "leaq 8(%rsp),%rax\n\t" + "movq %rax,0x98(%rcx)\n\t" /* context->Rsp */ + "movq %rbp,0xa0(%rcx)\n\t" /* context->Rbp */ + "movq %rsi,0xa8(%rcx)\n\t" /* context->Rsi */ + "movq %rdi,0xb0(%rcx)\n\t" /* context->Rdi */ + "movq %r8,0xb8(%rcx)\n\t" /* context->R8 */ + "movq %r9,0xc0(%rcx)\n\t" /* context->R9 */ + "movq %r10,0xc8(%rcx)\n\t" /* context->R10 */ + "movq %r11,0xd0(%rcx)\n\t" /* context->R11 */ + "movq %r12,0xd8(%rcx)\n\t" /* context->R12 */ + "movq %r13,0xe0(%rcx)\n\t" /* context->R13 */ + "movq %r14,0xe8(%rcx)\n\t" /* context->R14 */ + "movq %r15,0xf0(%rcx)\n\t" /* context->R15 */ + "movq (%rsp),%rax\n\t" + "movq %rax,0xf8(%rcx)\n\t" /* context->Rip */ + "fxsave 0x100(%rcx)\n\t" /* context->FtlSave */ + "movdqa %xmm0,0x1a0(%rcx)\n\t" /* context->Xmm0 */ + "movdqa %xmm1,0x1b0(%rcx)\n\t" /* context->Xmm1 */ + "movdqa %xmm2,0x1c0(%rcx)\n\t" /* context->Xmm2 */ + "movdqa %xmm3,0x1d0(%rcx)\n\t" /* context->Xmm3 */ + "movdqa %xmm4,0x1e0(%rcx)\n\t" /* context->Xmm4 */ + "movdqa %xmm5,0x1f0(%rcx)\n\t" /* context->Xmm5 */ + "movdqa %xmm6,0x200(%rcx)\n\t" /* context->Xmm6 */ + "movdqa %xmm7,0x210(%rcx)\n\t" /* context->Xmm7 */ + "movdqa %xmm8,0x220(%rcx)\n\t" /* context->Xmm8 */ + "movdqa %xmm9,0x230(%rcx)\n\t" /* context->Xmm9 */ + "movdqa %xmm10,0x240(%rcx)\n\t" /* context->Xmm10 */ + "movdqa %xmm11,0x250(%rcx)\n\t" /* context->Xmm11 */ + "movdqa %xmm12,0x260(%rcx)\n\t" /* context->Xmm12 */ + "movdqa %xmm13,0x270(%rcx)\n\t" /* context->Xmm13 */ + "movdqa %xmm14,0x280(%rcx)\n\t" /* context->Xmm14 */ + "movdqa %xmm15,0x290(%rcx)\n\t" /* context->Xmm15 */ + "ret" ); /*********************************************************************** * set_cpu_context
1
0
0
0
Alexandre Julliard : ntdll: Capture the context inside RtlUnwindEx instead of assuming it' s already initialized.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: aa4ad6d76613bea8931059982d9a2b9a9e305e28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aa4ad6d76613bea8931059982…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 27 11:51:34 2011 +0100 ntdll: Capture the context inside RtlUnwindEx instead of assuming it's already initialized. --- dlls/ntdll/signal_x86_64.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index d7aafda..ad49411 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2783,6 +2783,8 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec NTSTATUS status; DWORD size; + RtlCaptureContext( orig_context ); + /* build an exception record, if we do not have one */ if (!rec) { @@ -2931,12 +2933,11 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec /******************************************************************* * RtlUnwind (NTDLL.@) */ -void WINAPI __regs_RtlUnwind( void *frame, void *target_ip, EXCEPTION_RECORD *rec, - void *retval, CONTEXT *context ) +void WINAPI RtlUnwind( void *frame, void *target_ip, EXCEPTION_RECORD *rec, void *retval ) { - RtlUnwindEx( frame, target_ip, rec, retval, context, NULL ); + CONTEXT context; + RtlUnwindEx( frame, target_ip, rec, retval, &context, NULL ); } -DEFINE_REGS_ENTRYPOINT( RtlUnwind, 4 ) /*******************************************************************
1
0
0
0
Alexandre Julliard : include: Add a prototype for RtlUnwindEx on x86_64.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 2e81ba5f4ff19666b28aef79c511a9efe0d690e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e81ba5f4ff19666b28aef79c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 26 21:30:42 2011 +0100 include: Add a prototype for RtlUnwindEx on x86_64. --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/signal_x86_64.c | 28 ++++++++++++++-------------- include/winternl.h | 4 +++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 1a33595..da674cd 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -897,7 +897,7 @@ @ stdcall RtlUnlockHeap(long) # @ stub RtlUnlockMemoryStreamRegion @ stdcall -register RtlUnwind(ptr ptr ptr ptr) -@ stdcall -arch=x86_64 RtlUnwindEx(long long ptr long ptr) +@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) @ stdcall RtlUpcaseUnicodeChar(long) @ stdcall RtlUpcaseUnicodeString(ptr ptr long) @ stdcall RtlUpcaseUnicodeStringToAnsiString(ptr ptr long) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 4807103..d7aafda 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2772,8 +2772,8 @@ static void call_teb_unwind_handler( EXCEPTION_RECORD *rec, DISPATCHER_CONTEXT * /******************************************************************* * RtlUnwindEx (NTDLL.@) */ -void WINAPI RtlUnwindEx( ULONG64 end_frame, ULONG64 target_ip, EXCEPTION_RECORD *rec, - ULONG64 retval, CONTEXT *orig_context, UNWIND_HISTORY_TABLE *table ) +void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec, + PVOID retval, CONTEXT *orig_context, UNWIND_HISTORY_TABLE *table ) { EXCEPTION_REGISTRATION_RECORD *teb_frame = NtCurrentTeb()->Tib.ExceptionList; EXCEPTION_RECORD record; @@ -2796,7 +2796,7 @@ void WINAPI RtlUnwindEx( ULONG64 end_frame, ULONG64 target_ip, EXCEPTION_RECORD rec->ExceptionFlags |= EH_UNWINDING | (end_frame ? 0 : EH_EXIT_UNWIND); - TRACE( "code=%x flags=%x end_frame=%lx target_ip=%lx rip=%016lx\n", + TRACE( "code=%x flags=%x end_frame=%p target_ip=%p rip=%016lx\n", rec->ExceptionCode, rec->ExceptionFlags, end_frame, target_ip, orig_context->Rip ); TRACE(" rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", orig_context->Rax, orig_context->Rbx, orig_context->Rcx, orig_context->Rdx ); @@ -2809,11 +2809,11 @@ void WINAPI RtlUnwindEx( ULONG64 end_frame, ULONG64 target_ip, EXCEPTION_RECORD context = *orig_context; dispatch.EstablisherFrame = context.Rsp; - dispatch.TargetIp = target_ip; + dispatch.TargetIp = (ULONG64)target_ip; dispatch.ContextRecord = &context; dispatch.HistoryTable = table; - while (dispatch.EstablisherFrame != end_frame) + while (dispatch.EstablisherFrame != (ULONG64)end_frame) { new_context = context; @@ -2899,30 +2899,30 @@ void WINAPI RtlUnwindEx( ULONG64 end_frame, ULONG64 target_ip, EXCEPTION_RECORD if (dispatch.LanguageHandler) { - if (end_frame && (dispatch.EstablisherFrame > end_frame)) + if (end_frame && (dispatch.EstablisherFrame > (ULONG64)end_frame)) { - ERR( "invalid end frame %lx/%lx\n", dispatch.EstablisherFrame, end_frame ); + ERR( "invalid end frame %lx/%p\n", dispatch.EstablisherFrame, end_frame ); raise_status( STATUS_INVALID_UNWIND_TARGET, rec ); } call_unwind_handler( rec, &dispatch ); } else /* hack: call builtin handlers registered in the tib list */ { - while ((ULONG64)teb_frame < new_context.Rsp && (ULONG64)teb_frame < end_frame) + while ((ULONG64)teb_frame < new_context.Rsp && (ULONG64)teb_frame < (ULONG64)end_frame) { TRACE( "found builtin frame %p handler %p\n", teb_frame, teb_frame->Handler ); dispatch.EstablisherFrame = (ULONG64)teb_frame; call_teb_unwind_handler( rec, &dispatch, teb_frame ); teb_frame = __wine_pop_frame( teb_frame ); } - if ((ULONG64)teb_frame == end_frame && end_frame < new_context.Rsp) break; + if ((ULONG64)teb_frame == (ULONG64)end_frame && (ULONG64)end_frame < new_context.Rsp) break; dispatch.EstablisherFrame = new_context.Rsp; } context = new_context; } - context.Rax = retval; - context.Rip = target_ip; + context.Rax = (ULONG64)retval; + context.Rip = (ULONG64)target_ip; TRACE( "returning to %lx stack %lx\n", context.Rip, context.Rsp ); set_cpu_context( &context ); } @@ -2931,8 +2931,8 @@ void WINAPI RtlUnwindEx( ULONG64 end_frame, ULONG64 target_ip, EXCEPTION_RECORD /******************************************************************* * RtlUnwind (NTDLL.@) */ -void WINAPI __regs_RtlUnwind( ULONG64 frame, ULONG64 target_ip, EXCEPTION_RECORD *rec, - ULONG64 retval, CONTEXT *context ) +void WINAPI __regs_RtlUnwind( void *frame, void *target_ip, EXCEPTION_RECORD *rec, + void *retval, CONTEXT *context ) { RtlUnwindEx( frame, target_ip, rec, retval, context, NULL ); } @@ -2982,7 +2982,7 @@ EXCEPTION_DISPOSITION WINAPI __C_specific_handler( EXCEPTION_RECORD *rec, } } TRACE( "unwinding to target %lx\n", dispatch->ImageBase + table->ScopeRecord[i].JumpTarget ); - RtlUnwindEx( frame, dispatch->ImageBase + table->ScopeRecord[i].JumpTarget, + RtlUnwindEx( (void *)frame, (char *)dispatch->ImageBase + table->ScopeRecord[i].JumpTarget, rec, 0, context, dispatch->HistoryTable ); } } diff --git a/include/winternl.h b/include/winternl.h index d40c701..a1c9f0c 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2497,7 +2497,9 @@ NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD); NTSYSAPI ULONG WINAPI RtlUniform(PULONG); NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE); NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID); -#ifdef __ia64__ +#ifdef __x86_64__ +NTSYSAPI void WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE); +#elif defined(__ia64__) NTSYSAPI void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT); NTSYSAPI void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE); #endif
1
0
0
0
Alexandre Julliard : msvcrt: Add a non-optimized implementation for the SSE2 math functions.
by Alexandre Julliard
27 Jan '11
27 Jan '11
Module: wine Branch: master Commit: 7c95b251e0f9c1cfff29a74c0a38bf8918104eff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c95b251e0f9c1cfff29a74c0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 26 20:48:44 2011 +0100 msvcrt: Add a non-optimized implementation for the SSE2 math functions. --- dlls/msvcr100/msvcr100.spec | 42 ++++---- dlls/msvcr80/msvcr80.spec | 42 ++++---- dlls/msvcr90/msvcr90.spec | 42 ++++---- dlls/msvcrt/math.c | 231 +++++++++++++++++++++++++++++++++++++++++++ dlls/msvcrt/msvcrt.spec | 42 ++++---- 5 files changed, 315 insertions(+), 84 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7c95b251e0f9c1cfff29a…
1
0
0
0
Marcus Meissner : ws2_32: Implemented SO_CONNECT_TIME stub.
by Alexandre Julliard
26 Jan '11
26 Jan '11
Module: wine Branch: master Commit: 09e29486aebe758263365fc328aab8c6470b6bd2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09e29486aebe758263365fc32…
Author: Marcus Meissner <meissner(a)suse.de> Date: Wed Jan 26 17:01:09 2011 +0100 ws2_32: Implemented SO_CONNECT_TIME stub. --- dlls/ws2_32/socket.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 774481d..f3a521c 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2536,6 +2536,20 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, return ret; } + case WS_SO_CONNECT_TIME: + { + static int pretendtime = 0; + + if (!pretendtime) FIXME("WS_SO_CONNECT_TIME - faking results\n"); + if (!optlen || *optlen < sizeof(DWORD) || !optval) + { + SetLastError(WSAEFAULT); + return SOCKET_ERROR; + } + *(DWORD*)optval = pretendtime++; + *optlen = sizeof(DWORD); + return ret; + } /* As mentioned in setsockopt, Windows ignores this, so we * always return true here */ case WS_SO_DONTROUTE:
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
88
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
Results per page:
10
25
50
100
200