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
e9f2eb52
Commit
e9f2eb52
authored
Sep 24, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support compiling with -fPIC for people who somehow think this is a
good idea.
parent
9d3019f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
preloader.c
loader/preloader.c
+15
-9
No files found.
loader/preloader.c
View file @
e9f2eb52
...
...
@@ -173,28 +173,32 @@ __ASM_GLOBAL_FUNC(_start,
static
inline
__attribute__
((
noreturn
))
void
wld_exit
(
int
code
)
{
for
(;;)
/* avoid warning */
__asm__
__volatile__
(
"int $0x80"
:
:
"a"
(
SYS_exit
),
"b"
(
code
)
);
__asm__
__volatile__
(
"pushl %%ebx; movl %1,%%ebx; int $0x80; popl %%ebx"
:
:
"a"
(
SYS_exit
),
"g"
(
code
)
);
}
static
inline
int
wld_open
(
const
char
*
name
,
int
flags
)
{
int
ret
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_open
),
"b"
(
name
),
"c"
(
flags
)
);
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_open
),
"g"
(
name
),
"c"
(
flags
)
);
return
SYSCALL_RET
(
ret
);
}
static
inline
int
wld_close
(
int
fd
)
{
int
ret
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_close
),
"b"
(
fd
)
);
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_close
),
"g"
(
fd
)
);
return
SYSCALL_RET
(
ret
);
}
static
inline
ssize_t
wld_read
(
int
fd
,
void
*
buffer
,
size_t
len
)
{
int
ret
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_read
),
"b"
(
fd
),
"c"
(
buffer
),
"d"
(
len
)
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_read
),
"g"
(
fd
),
"c"
(
buffer
),
"d"
(
len
)
:
"memory"
);
return
SYSCALL_RET
(
ret
);
}
...
...
@@ -202,15 +206,16 @@ static inline ssize_t wld_read( int fd, void *buffer, size_t len )
static
inline
ssize_t
wld_write
(
int
fd
,
const
void
*
buffer
,
size_t
len
)
{
int
ret
;
__asm__
__volatile__
(
"
int $0x80"
:
"=a"
(
ret
)
:
"
0"
(
SYS_write
),
"b
"
(
fd
),
"c"
(
buffer
),
"d"
(
len
)
);
__asm__
__volatile__
(
"
pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"
=a"
(
ret
)
:
"0"
(
SYS_write
),
"g
"
(
fd
),
"c"
(
buffer
),
"d"
(
len
)
);
return
SYSCALL_RET
(
ret
);
}
static
inline
int
wld_mprotect
(
const
void
*
addr
,
size_t
len
,
int
prot
)
{
int
ret
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_mprotect
),
"b"
(
addr
),
"c"
(
len
),
"d"
(
prot
)
);
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_mprotect
),
"g"
(
addr
),
"c"
(
len
),
"d"
(
prot
)
);
return
SYSCALL_RET
(
ret
);
}
...
...
@@ -234,7 +239,8 @@ static void *wld_mmap( void *start, size_t len, int prot, int flags, int fd, off
args
.
flags
=
flags
;
args
.
fd
=
fd
;
args
.
offset
=
offset
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_mmap
),
"b"
(
&
args
)
:
"memory"
);
__asm__
__volatile__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_mmap
),
"g"
(
&
args
)
:
"memory"
);
return
(
void
*
)
SYSCALL_RET
(
ret
);
}
...
...
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