Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3751ff04
Commit
3751ff04
authored
May 04, 2002
by
Patrik Stridvall
Committed by
Alexandre Julliard
May 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MS C related changes.
parent
7e15e5d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
20 deletions
+55
-20
async.h
include/async.h
+1
-1
winnt.h
include/winnt.h
+9
-1
selector.c
memory/selector.c
+23
-9
sysdeps.c
scheduler/sysdeps.c
+17
-8
spec16.c
tools/winebuild/spec16.c
+5
-1
No files found.
include/async.h
View file @
3751ff04
...
...
@@ -31,7 +31,7 @@
struct
async_private
;
typedef
void
(
*
async_handler
)(
struct
async_private
*
ovp
);
typedef
void
CALLBACK
(
*
async_call_completion_func
)(
ULONG_PTR
data
);
typedef
void
(
CALLBACK
*
async_call_completion_func
)(
ULONG_PTR
data
);
typedef
DWORD
(
*
async_get_status
)(
const
struct
async_private
*
ovp
);
typedef
DWORD
(
*
async_get_count
)(
const
struct
async_private
*
ovp
);
typedef
void
(
*
async_set_status
)(
struct
async_private
*
ovp
,
const
DWORD
status
);
...
...
include/winnt.h
View file @
3751ff04
...
...
@@ -1244,7 +1244,7 @@ typedef CONTEXT *PCONTEXT;
extern inline void __set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
# elif defined(_MSC_VER)
# define __DEFINE_GET_SEG(seg) \
extern inline unsigned short __get_##seg(void) { unsigned short res; __asm { mov res,
fs
} return res; }
extern inline unsigned short __get_##seg(void) { unsigned short res; __asm { mov res,
seg
} return res; }
# define __DEFINE_SET_SEG(seg) \
extern inline void __set_##seg(unsigned short val) { __asm { mov seg, val } }
# else
/* __GNUC__ || _MSC_VER */
...
...
@@ -2360,6 +2360,14 @@ extern inline struct _TEB * WINAPI NtCurrentTeb(void)
__asm__
(
".byte 0x64
\n\t
movl (0x18),%0"
:
"=r"
(
teb
));
return
teb
;
}
#elif defined(__i386__) && defined(_MSC_VER)
extern
inline
struct
_TEB
*
WINAPI
NtCurrentTeb
(
void
)
{
struct
_TEB
*
teb
;
__asm
mov
eax
,
fs
:
[
0x18
];
__asm
mov
teb
,
eax
;
return
teb
;
}
#else
extern
struct
_TEB
*
WINAPI
NtCurrentTeb
(
void
);
#endif
...
...
memory/selector.c
View file @
3751ff04
...
...
@@ -938,12 +938,26 @@ void WINAPI FreeMappedBuffer( CONTEXT86 *context )
}
#ifdef __i386__
__ASM_GLOBAL_FUNC
(
__get_cs
,
"movw %cs,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__get_ds
,
"movw %ds,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__get_es
,
"movw %es,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__get_fs
,
"movw %fs,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__get_gs
,
"movw %gs,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__get_ss
,
"movw %ss,%ax
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__set_fs
,
"movl 4(%esp),%eax
\n\t
movw %ax,%fs
\n\t
ret"
)
__ASM_GLOBAL_FUNC
(
__set_gs
,
"movl 4(%esp),%eax
\n\t
movw %ax,%gs
\n\t
ret"
)
#endif
#ifdef _MSC_VER
/* Nothing needs to be done. MS C make do with inline versions from the winnt.h */
#else
/* defined(_MSC_VER) */
#define __DEFINE_GET_SEG(seg) \
__ASM_GLOBAL_FUNC( __get_##seg, "movw %" #seg ",%ax\n\tret" )
#define __DEFINE_SET_SEG(seg) \
__ASM_GLOBAL_FUNC( __set_##seg, "movl 4(%esp),%eax\n\tmovw %ax,%" #seg "\n\tret" )
__DEFINE_GET_SEG
(
cs
)
__DEFINE_GET_SEG
(
ds
)
__DEFINE_GET_SEG
(
es
)
__DEFINE_GET_SEG
(
fs
)
__DEFINE_GET_SEG
(
gs
)
__DEFINE_GET_SEG
(
ss
)
__DEFINE_SET_SEG
(
fs
)
__DEFINE_SET_SEG
(
gs
)
#undef __DEFINE_GET_SEG
#undef __DEFINE_SET_SEG
#endif
/* defined(_MSC_VER) */
#endif
/* defined(__i386__) */
scheduler/sysdeps.c
View file @
3751ff04
...
...
@@ -228,6 +228,7 @@ int SYSDEPS_SpawnThread( TEB *teb )
*/
void
SYSDEPS_CallOnStack
(
void
(
*
func
)(
LPVOID
),
LPVOID
arg
)
WINE_NORETURN
;
#ifdef __i386__
#ifdef __GNUC__
__ASM_GLOBAL_FUNC
(
SYSDEPS_CallOnStack
,
"movl 4(%esp),%ecx
\n\t
"
/* func */
"movl 8(%esp),%edx
\n\t
"
/* arg */
...
...
@@ -236,13 +237,25 @@ __ASM_GLOBAL_FUNC( SYSDEPS_CallOnStack,
"xorl %ebp,%ebp
\n\t
"
"call *%ecx
\n\t
"
"int $3"
/* we never return here */
);
#else
#elif defined(_MSC_VER)
__declspec
(
naked
)
void
SYSDEPS_CallOnStack
(
void
(
*
func
)(
LPVOID
),
LPVOID
arg
)
{
__asm
mov
ecx
,
4
[
esp
];
__asm
mov
edx
,
8
[
esp
];
__asm
mov
fs
:
[
0x04
],
esp
;
__asm
push
edx
;
__asm
xor
ebp
,
ebp
;
__asm
call
[
ecx
];
__asm
int
3
;
}
#endif
/* defined(__GNUC__) || defined(_MSC_VER) */
#else
/* defined(__i386__) */
void
SYSDEPS_CallOnStack
(
void
(
*
func
)(
LPVOID
),
LPVOID
arg
)
{
func
(
arg
);
while
(
1
);
/* avoid warning */
}
#endif
#endif
/* defined(__i386__) */
/***********************************************************************
...
...
@@ -279,7 +292,7 @@ void SYSDEPS_ExitThread( int status )
close
(
teb
->
reply_fd
);
close
(
teb
->
request_fd
);
teb
->
stack_low
=
get_temp_stack
();
teb
->
stack_top
=
teb
->
stack_low
+
TEMP_STACK_SIZE
;
teb
->
stack_top
=
(
char
*
)
teb
->
stack_low
+
TEMP_STACK_SIZE
;
SYSDEPS_CallOnStack
(
cleanup_thread
,
&
info
);
}
...
...
@@ -312,11 +325,7 @@ void SYSDEPS_AbortThread( int status )
#if defined(__i386__) && defined(__GNUC__)
__ASM_GLOBAL_FUNC
(
NtCurrentTeb
,
".byte 0x64
\n\t
movl 0x18,%eax
\n\t
ret"
);
#elif defined(__i386__) && defined(_MSC_VER)
__declspec
(
naked
)
struct
_TEB
*
WINAPI
NtCurrentTeb
(
void
)
{
__asm
mov
eax
,
fs
:
[
0x18
];
__asm
ret
;
}
/* Nothing needs to be done. MS C "magically" exports the inline version from winnt.h */
#elif defined(HAVE__LWP_CREATE)
/***********************************************************************
* NtCurrentTeb (NTDLL.@)
...
...
tools/winebuild/spec16.c
View file @
3751ff04
...
...
@@ -36,9 +36,13 @@
#include "build.h"
#ifdef __i386__
#ifdef _MSC_VER
extern
unsigned
short
__get_cs
(
void
)
{
unsigned
short
res
;
__asm
{
mov
res
,
cs
}
return
res
;
}
#else
extern
unsigned
short
__get_cs
(
void
);
__ASM_GLOBAL_FUNC
(
__get_cs
,
"movw %cs,%ax
\n\t
ret"
);
#endif
/* __i386__ */
#endif
/* defined(_MSC_VER) */
#endif
/* defined(__i386__) */
/*******************************************************************
...
...
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