Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
syscall
Commits
3029f094
Commit
3029f094
authored
Jan 26, 2021
by
Robin Randhawa
Browse files
aarch64: Cleanups and alignment with x86_64 macros
parent
b12d582d
Pipeline
#9036
failed with stages
in 2 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/arch/aarch64.rs
View file @
3029f094
...
...
@@ -3,6 +3,47 @@ use core::ops::{Deref, DerefMut};
use
super
::
error
::{
Error
,
Result
};
macro_rules!
syscall
{
(
$
(
$name:ident
(
$a:ident
,
$
(
$b:ident
,
$
(
$c:ident
,
$
(
$d:ident
,
$
(
$e:ident
,
$
(
$f:ident
,
)
?
)
?
)
?
)
?
)
?
);)
+
)
=>
{
$
(
pub
unsafe
fn
$name
(
mut
$a
:
usize
,
$
(
mut
$b
:
usize
,
$
(
$c
:
usize
,
$
(
$d
:
usize
,
$
(
$e
:
usize
,
$
(
$f
:
usize
)
?
)
?
)
?
)
?
)
?
)
->
Result
<
usize
>
{
asm!
(
"svc 0"
,
in
(
"x8"
)
$a
,
$
(
inout
(
"x0"
)
$b
,
$
(
in
(
"x1"
)
$c
,
$
(
in
(
"x2"
)
$d
,
$
(
in
(
"x3"
)
$e
,
$
(
in
(
"x4"
)
$f
,
)
?
)
?
)
?
)
?
)
?
options
(
nostack
),
);
Error
::
demux
(
$a
)
}
)
+
};
}
syscall!
{
syscall0
(
a
,);
syscall1
(
a
,
b
,);
syscall2
(
a
,
b
,
c
,);
syscall3
(
a
,
b
,
c
,
d
,);
syscall4
(
a
,
b
,
c
,
d
,
e
,);
syscall5
(
a
,
b
,
c
,
d
,
e
,
f
,);
}
/*
pub unsafe fn syscall0(mut a: usize) -> Result<usize> {
llvm_asm!("svc 0"
: "={x0}"(a)
...
...
@@ -63,11 +104,50 @@ pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f:
Error::demux(a)
}
*/
//TODO
#[derive(Copy,
Clone,
Debug,
Default)]
#[repr(C)]
pub
struct
IntRegisters
;
pub
struct
IntRegisters
{
pub
elr_el1
:
usize
,
pub
tpidr_el0
:
usize
,
pub
tpidrro_el0
:
usize
,
pub
spsr_el1
:
usize
,
pub
esr_el1
:
usize
,
pub
sp_el0
:
usize
,
// Shouldn't be used if interrupt occurred at EL1
pub
padding
:
usize
,
// To keep the struct even number aligned
pub
x30
:
usize
,
pub
x29
:
usize
,
pub
x28
:
usize
,
pub
x27
:
usize
,
pub
x26
:
usize
,
pub
x25
:
usize
,
pub
x24
:
usize
,
pub
x23
:
usize
,
pub
x22
:
usize
,
pub
x21
:
usize
,
pub
x20
:
usize
,
pub
x19
:
usize
,
pub
x18
:
usize
,
pub
x17
:
usize
,
pub
x16
:
usize
,
pub
x15
:
usize
,
pub
x14
:
usize
,
pub
x13
:
usize
,
pub
x12
:
usize
,
pub
x11
:
usize
,
pub
x10
:
usize
,
pub
x9
:
usize
,
pub
x8
:
usize
,
pub
x7
:
usize
,
pub
x6
:
usize
,
pub
x5
:
usize
,
pub
x4
:
usize
,
pub
x3
:
usize
,
pub
x2
:
usize
,
pub
x1
:
usize
,
pub
x0
:
usize
}
impl
Deref
for
IntRegisters
{
type
Target
=
[
u8
];
...
...
Write
Preview
Supports
Markdown
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