Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
syscall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
syscall
Commits
a715b8cf
Verified
Commit
a715b8cf
authored
Jan 19, 2019
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch over to using syscall instruction and linux abi on x86_64
parent
9a3734c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
src/arch/x86_64.rs
src/arch/x86_64.rs
+19
-19
No files found.
src/arch/x86_64.rs
View file @
a715b8cf
use
super
::
error
::{
Error
,
Result
};
pub
unsafe
fn
syscall0
(
mut
a
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
)
:
"memory"
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
}
pub
unsafe
fn
syscall1
(
mut
a
:
usize
,
b
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx
}"
(
b
)
:
"memory"
:
"{rax}"
(
a
),
"{r
di
}"
(
b
)
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
...
...
@@ -22,9 +22,9 @@ pub unsafe fn syscall1(mut a: usize, b: usize) -> Result<usize> {
// Clobbers all registers - special for clone
pub
unsafe
fn
syscall1_clobber
(
mut
a
:
usize
,
b
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx
}"
(
b
)
:
"{rax}"
(
a
),
"{r
di
}"
(
b
)
:
"memory"
,
"rbx"
,
"rcx"
,
"rdx"
,
"rsi"
,
"rdi"
,
"r8"
,
"r9"
,
"r10"
,
"r11"
,
"r12"
,
"r13"
,
"r14"
,
"r15"
:
"intel"
,
"volatile"
);
...
...
@@ -33,30 +33,30 @@ pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result<usize> {
}
pub
unsafe
fn
syscall2
(
mut
a
:
usize
,
b
:
usize
,
c
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx}"
(
b
),
"{rcx
}"
(
c
)
:
"memory"
:
"{rax}"
(
a
),
"{r
di}"
(
b
),
"{rsi
}"
(
c
)
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
}
pub
unsafe
fn
syscall3
(
mut
a
:
usize
,
b
:
usize
,
c
:
usize
,
d
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx}"
(
b
),
"{rcx
}"
(
c
),
"{rdx}"
(
d
)
:
"memory"
:
"{rax}"
(
a
),
"{r
di}"
(
b
),
"{rsi
}"
(
c
),
"{rdx}"
(
d
)
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
}
pub
unsafe
fn
syscall4
(
mut
a
:
usize
,
b
:
usize
,
c
:
usize
,
d
:
usize
,
e
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx}"
(
b
),
"{rcx}"
(
c
),
"{rdx}"
(
d
),
"{rsi
}"
(
e
)
:
"memory"
:
"{rax}"
(
a
),
"{r
di}"
(
b
),
"{rsi}"
(
c
),
"{rdx}"
(
d
),
"{r10
}"
(
e
)
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
...
...
@@ -64,10 +64,10 @@ pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) ->
pub
unsafe
fn
syscall5
(
mut
a
:
usize
,
b
:
usize
,
c
:
usize
,
d
:
usize
,
e
:
usize
,
f
:
usize
)
->
Result
<
usize
>
{
asm!
(
"
int 0x80
"
asm!
(
"
syscall
"
:
"={rax}"
(
a
)
:
"{rax}"
(
a
),
"{r
bx}"
(
b
),
"{rcx}"
(
c
),
"{rdx}"
(
d
),
"{rsi}"
(
e
),
"{rdi
}"
(
f
)
:
"memory"
:
"{rax}"
(
a
),
"{r
di}"
(
b
),
"{rsi}"
(
c
),
"{rdx}"
(
d
),
"{r10}"
(
e
),
"{r8
}"
(
f
)
:
"
rcx"
,
"r11"
,
"
memory"
:
"intel"
,
"volatile"
);
Error
::
demux
(
a
)
...
...
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