Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4ce433d8
Commit
4ce433d8
authored
Jan 20, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the %gs register to the ntdll_thread_regs structure.
parent
a19e3eeb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+9
-8
signal_i386.c
dlls/ntdll/signal_i386.c
+1
-1
thread.h
include/thread.h
+4
-5
relay.c
tools/winebuild/relay.c
+6
-3
No files found.
dlls/ntdll/ntdll_misc.h
View file @
4ce433d8
...
...
@@ -136,14 +136,15 @@ static inline struct ntdll_thread_data *ntdll_get_thread_data(void)
/* thread registers, stored in NtCurrentTeb()->SpareBytes1 */
struct
ntdll_thread_regs
{
DWORD
fs
;
/* TEB selector */
DWORD
dr0
;
/* debug registers */
DWORD
dr1
;
DWORD
dr2
;
DWORD
dr3
;
DWORD
dr6
;
DWORD
dr7
;
DWORD
spare
[
3
];
/* change this if you add fields! */
DWORD
fs
;
/* 00 TEB selector */
DWORD
gs
;
/* 04 libc selector; update winebuild if you move this! */
DWORD
dr0
;
/* 08 debug registers */
DWORD
dr1
;
/* 0c */
DWORD
dr2
;
/* 10 */
DWORD
dr3
;
/* 14 */
DWORD
dr6
;
/* 18 */
DWORD
dr7
;
/* 1c */
DWORD
spare
[
2
];
/* 20 change this if you add fields! */
};
static
inline
struct
ntdll_thread_regs
*
ntdll_get_thread_regs
(
void
)
...
...
dlls/ntdll/signal_i386.c
View file @
4ce433d8
...
...
@@ -675,7 +675,7 @@ inline static void *init_handler( const SIGCONTEXT *sigcontext, WORD *fs, WORD *
* SS is still non-system segment. This is why both CS and SS
* are checked.
*/
wine_set_gs
(
t
eb
->
gs_sel
);
wine_set_gs
(
t
hread_regs
->
gs
);
stack
=
teb
->
WOW32Reserved
;
}
#ifdef __HAVE_VM86
...
...
include/thread.h
View file @
4ce433d8
...
...
@@ -53,12 +53,11 @@ typedef struct _TEB
PVOID
SystemReserved2
[
10
];
/* 1d4 */
/* The following are Wine-specific fields (NT: GdiTebBatch) */
DWORD
gs_sel
;
/* 1fc %gs selector for this thread */
ULONG_PTR
num_async_io
;
/* 200 number of pending async I/O in the server */
DWORD
dpmi_vif
;
/* 204 protected mode virtual interrupt flag */
DWORD
vm86_pending
;
/* 208 data for vm86 mode */
DWORD
num_async_io
;
/* 1fc number of pending async I/O in the server */
ULONG_PTR
dpmi_vif
;
/* 200 protected mode virtual interrupt flag */
DWORD
vm86_pending
;
/* 204 data for vm86 mode */
/* here is plenty space for wine specific fields (don't forget to change pad6!!) */
DWORD
pad6
[
30
8
];
/* 20c
*/
DWORD
pad6
[
30
9
];
/* 208
*/
ULONG
gdiRgn
;
/* 6dc */
ULONG
gdiPen
;
/* 6e0 */
...
...
tools/winebuild/relay.c
View file @
4ce433d8
...
...
@@ -32,6 +32,9 @@
#include "build.h"
/* fix this if the ntdll_thread_regs structure is changed */
#define GS_OFFSET 0x1b0
/* STRUCTOFFSET(TEB,SpareBytes1) + STRUCTOFFSET(ntdll_thread_regs,gs) */
static
void
function_header
(
FILE
*
outfile
,
const
char
*
name
)
{
fprintf
(
outfile
,
"
\n\t
.align %d
\n
"
,
get_alignment
(
4
)
);
...
...
@@ -150,7 +153,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk )
else
fprintf
(
outfile
,
"
\t
movw %s, %%fs
\n
"
,
asm_name
(
"CallTo16_TebSelector"
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov (%d),%%gs
\n
"
,
STRUCTOFFSET
(
TEB
,
gs_sel
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov (%d),%%gs
\n
"
,
GS_OFFSET
);
/* Translate STACK16FRAME base to flat offset in %edx */
fprintf
(
outfile
,
"
\t
movw %%ss, %%dx
\n
"
);
...
...
@@ -393,7 +396,7 @@ static void BuildCallTo16Core( FILE *outfile, int reg_func )
fprintf
(
outfile
,
"
\t
pushl %%ebx
\n
"
);
fprintf
(
outfile
,
"
\t
pushl %%esi
\n
"
);
fprintf
(
outfile
,
"
\t
pushl %%edi
\n
"
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov %%gs,(%d)
\n
"
,
STRUCTOFFSET
(
TEB
,
gs_sel
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov %%gs,(%d)
\n
"
,
GS_OFFSET
);
/* Setup exception frame */
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
pushl (%d)
\n
"
,
STACKOFFSET
);
...
...
@@ -542,7 +545,7 @@ static void BuildRet16Func( FILE *outfile )
fprintf
(
outfile
,
"
\t
.byte 0x2e
\n\t
mov %s"
,
asm_name
(
"CallTo16_TebSelector"
)
);
fprintf
(
outfile
,
"-%s,%%fs
\n
"
,
asm_name
(
"__wine_call16_start"
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov (%d),%%gs
\n
"
,
STRUCTOFFSET
(
TEB
,
gs_sel
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov (%d),%%gs
\n
"
,
GS_OFFSET
);
/* Restore the 32-bit stack */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment