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
653d2c4a
Commit
653d2c4a
authored
Apr 03, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the type of CPU that the client is running on.
parent
b06a919c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
2 deletions
+60
-2
server.c
dlls/ntdll/server.c
+15
-0
server_protocol.h
include/wine/server_protocol.h
+9
-1
process.h
server/process.h
+1
-0
protocol.def
server/protocol.def
+8
-0
request.h
server/request.h
+2
-0
thread.c
server/thread.c
+6
-0
trace.c
server/trace.c
+18
-1
make_requests
tools/make_requests
+1
-0
No files found.
dlls/ntdll/server.c
View file @
653d2c4a
...
...
@@ -76,6 +76,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(server);
#define SOCKETNAME "socket"
/* name of the socket file */
#define LOCKNAME "lock"
/* name of the lock file */
#ifdef __i386__
static
const
enum
cpu_type
client_cpu
=
CPU_x86
;
#elif defined(__x86_64__)
static
const
enum
cpu_type
client_cpu
=
CPU_x86_64
;
#elif defined(__ALPHA__)
static
const
enum
cpu_type
client_cpu
=
CPU_ALPHA
;
#elif defined(__powerpc__)
static
const
enum
cpu_type
client_cpu
=
CPU_POWERPC
;
#elif defined(__sparc__)
static
const
enum
cpu_type
client_cpu
=
CPU_SPARC
;
#else
#error Unsupported CPU
#endif
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
/* data structure used to pass an fd with sendmsg/recvmsg */
struct
cmsg_fd
...
...
@@ -1030,6 +1044,7 @@ size_t server_init_thread( void *entry_point )
req
->
reply_fd
=
reply_pipe
[
1
];
req
->
wait_fd
=
ntdll_get_thread_data
()
->
wait_fd
[
1
];
req
->
debug_level
=
(
TRACE_ON
(
server
)
!=
0
);
req
->
cpu
=
client_cpu
;
ret
=
wine_server_call
(
req
);
NtCurrentTeb
()
->
ClientId
.
UniqueProcess
=
ULongToHandle
(
reply
->
pid
);
NtCurrentTeb
()
->
ClientId
.
UniqueThread
=
ULongToHandle
(
reply
->
tid
);
...
...
include/wine/server_protocol.h
View file @
653d2c4a
...
...
@@ -128,6 +128,13 @@ typedef union
}
debug_event_t
;
enum
cpu_type
{
CPU_x86
,
CPU_x86_64
,
CPU_ALPHA
,
CPU_POWERPC
,
CPU_SPARC
};
typedef
int
cpu_type_t
;
struct
send_fd
{
thread_id_t
tid
;
...
...
@@ -567,6 +574,7 @@ struct init_thread_request
client_ptr_t
entry
;
int
reply_fd
;
int
wait_fd
;
cpu_type_t
cpu
;
};
struct
init_thread_reply
{
...
...
@@ -5214,6 +5222,6 @@ union generic_reply
struct
set_window_layered_info_reply
set_window_layered_info_reply
;
};
#define SERVER_PROTOCOL_VERSION 38
2
#define SERVER_PROTOCOL_VERSION 38
3
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/process.h
View file @
653d2c4a
...
...
@@ -58,6 +58,7 @@ struct process
process_id_t
id
;
/* id of the process */
process_id_t
group_id
;
/* group id of the process */
struct
timeout_user
*
sigkill_timeout
;
/* timeout for final SIGKILL */
enum
cpu_type
cpu
;
/* client CPU type */
int
unix_pid
;
/* Unix pid for final SIGKILL */
int
exit_code
;
/* process exit code */
int
running_threads
;
/* number of threads running in this process */
...
...
server/protocol.def
View file @
653d2c4a
...
...
@@ -143,6 +143,13 @@ typedef union
} rip_info;
} debug_event_t;
/* supported CPU types */
enum cpu_type
{
CPU_x86, CPU_x86_64, CPU_ALPHA, CPU_POWERPC, CPU_SPARC
};
typedef int cpu_type_t;
/* structure used in sending an fd from client to server */
struct send_fd
{
...
...
@@ -554,6 +561,7 @@ typedef union
client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
int reply_fd; /* fd for reply pipe */
int wait_fd; /* fd for blocking calls pipe */
cpu_type_t cpu; /* CPU that this thread is running on */
@REPLY
process_id_t pid; /* process id of the new thread's process */
thread_id_t tid; /* thread id of the new thread */
...
...
server/request.h
View file @
653d2c4a
...
...
@@ -600,6 +600,7 @@ C_ASSERT( sizeof(atom_t) == 4 );
C_ASSERT
(
sizeof
(
char
)
==
1
);
C_ASSERT
(
sizeof
(
char_info_t
)
==
4
);
C_ASSERT
(
sizeof
(
client_ptr_t
)
==
8
);
C_ASSERT
(
sizeof
(
cpu_type_t
)
==
4
);
C_ASSERT
(
sizeof
(
data_size_t
)
==
4
);
C_ASSERT
(
sizeof
(
file_pos_t
)
==
8
);
C_ASSERT
(
sizeof
(
int
)
==
4
);
...
...
@@ -663,6 +664,7 @@ C_ASSERT( FIELD_OFFSET(struct init_thread_request, teb) == 24 );
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
entry
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
reply_fd
)
==
40
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
wait_fd
)
==
44
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
cpu
)
==
48
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_reply
,
pid
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_reply
,
tid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_reply
,
server_start
)
==
16
);
...
...
server/thread.c
View file @
653d2c4a
...
...
@@ -1045,10 +1045,16 @@ DECL_HANDLER(init_thread)
{
process
->
unix_pid
=
current
->
unix_pid
;
process
->
peb
=
req
->
entry
;
process
->
cpu
=
req
->
cpu
;
reply
->
info_size
=
init_process
(
current
);
}
else
{
if
(
req
->
cpu
!=
process
->
cpu
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
process
->
unix_pid
!=
current
->
unix_pid
)
process
->
unix_pid
=
-
1
;
/* can happen with linuxthreads */
if
(
current
->
suspend
+
process
->
suspend
>
0
)
stop_thread
(
current
);
...
...
server/trace.c
View file @
653d2c4a
...
...
@@ -105,6 +105,21 @@ static void dump_ioctl_code( const ioctl_code_t *code )
}
}
static
void
dump_cpu_type
(
const
cpu_type_t
*
code
)
{
switch
(
*
code
)
{
#define CASE(c) case CPU_##c: fputs( #c, stderr ); break
CASE
(
x86
);
CASE
(
x86_64
);
CASE
(
ALPHA
);
CASE
(
POWERPC
);
CASE
(
SPARC
);
default:
fprintf
(
stderr
,
"%u"
,
*
code
);
break
;
#undef CASE
}
}
static
void
dump_apc_call
(
const
apc_call_t
*
call
)
{
fputc
(
'{'
,
stderr
);
...
...
@@ -991,7 +1006,9 @@ static void dump_init_thread_request( const struct init_thread_request *req )
dump_uint64
(
&
req
->
entry
);
fprintf
(
stderr
,
","
);
fprintf
(
stderr
,
" reply_fd=%d,"
,
req
->
reply_fd
);
fprintf
(
stderr
,
" wait_fd=%d"
,
req
->
wait_fd
);
fprintf
(
stderr
,
" wait_fd=%d,"
,
req
->
wait_fd
);
fprintf
(
stderr
,
" cpu="
);
dump_cpu_type
(
&
req
->
cpu
);
}
static
void
dump_init_thread_reply
(
const
struct
init_thread_reply
*
req
)
...
...
tools/make_requests
View file @
653d2c4a
...
...
@@ -50,6 +50,7 @@ my %formats =
"async_data_t"
=>
[
40
,
8
,
"&dump_async_data"
],
"luid_t"
=>
[
8
,
4
,
"&dump_luid"
],
"ioctl_code_t"
=>
[
4
,
4
,
"&dump_ioctl_code"
],
"cpu_type_t"
=>
[
4
,
4
,
"&dump_cpu_type"
],
);
my
@requests
=
();
...
...
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