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
45a632ee
Commit
45a632ee
authored
Apr 27, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preloader: Use the SYS_mmap2 system call instead of the old SYS_mmap one.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1172754f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
24 deletions
+31
-24
preloader.c
loader/preloader.c
+31
-24
No files found.
loader/preloader.c
View file @
45a632ee
...
...
@@ -291,30 +291,37 @@ static inline int wld_mprotect( const void *addr, size_t len, int prot )
return
SYSCALL_RET
(
ret
);
}
static
void
*
wld_mmap
(
void
*
start
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off_t
offset
)
{
int
ret
;
struct
{
void
*
addr
;
unsigned
int
length
;
unsigned
int
prot
;
unsigned
int
flags
;
unsigned
int
fd
;
unsigned
int
offset
;
}
args
;
args
.
addr
=
start
;
args
.
length
=
len
;
args
.
prot
=
prot
;
args
.
flags
=
flags
;
args
.
fd
=
fd
;
args
.
offset
=
offset
;
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
90
/* SYS_mmap */
),
"q"
(
&
args
)
:
"memory"
);
return
(
void
*
)
SYSCALL_RET
(
ret
);
}
void
*
wld_mmap
(
void
*
start
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
unsigned
int
offset
);
__ASM_GLOBAL_FUNC
(
wld_mmap
,
"
\t
pushl %ebp
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
"
\t
pushl %ebx
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
"
\t
pushl %esi
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
"
\t
pushl %edi
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
"
\t
movl $192,%eax
\n
"
/* SYS_mmap2 */
"
\t
movl 20(%esp),%ebx
\n
"
/* start */
"
\t
movl 24(%esp),%ecx
\n
"
/* len */
"
\t
movl 28(%esp),%edx
\n
"
/* prot */
"
\t
movl 32(%esp),%esi
\n
"
/* flags */
"
\t
movl 36(%esp),%edi
\n
"
/* fd */
"
\t
movl 40(%esp),%ebp
\n
"
/* offset */
"
\t
shrl $12,%ebp
\n
"
"
\t
int $0x80
\n
"
"
\t
cmpl $-4096,%eax
\n
"
"
\t
jbe 1f
\n
"
"
\t
movl $-1,%eax
\n
"
"1:
\t
popl %edi
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset -4
\n\t
"
)
"
\t
popl %esi
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset -4
\n\t
"
)
"
\t
popl %ebx
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset -4
\n\t
"
)
"
\t
popl %ebp
\n
"
__ASM_CFI
(
".cfi_adjust_cfa_offset -4
\n\t
"
)
"
\t
ret
\n
"
)
static
inline
uid_t
wld_getuid
(
void
)
{
...
...
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