Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openhcl/minimal_rt/src/arch/aarch64/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// SAFETY: The minimal_rt_build crate ensures that when this code is compiled
// there is no libc for this to conflict with.
#[unsafe(no_mangle)]
unsafe extern "C" fn memcpy(mut dest: *mut u8, src: *const u8, len: usize) -> *mut u8 {
unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, len: usize) -> *mut u8 {
// SAFETY: the caller guarantees the pointers and length are correct.
unsafe {
core::arch::asm!(r#"
Expand All @@ -25,7 +25,7 @@ unsafe extern "C" fn memcpy(mut dest: *mut u8, src: *const u8, len: usize) -> *m
2:
add x0, x0, x2
"#,
inout("x0") dest,
inout("x0") dest => _,
in("x1") src,
in("x2") len,
);
Expand All @@ -38,7 +38,7 @@ unsafe extern "C" fn memcpy(mut dest: *mut u8, src: *const u8, len: usize) -> *m
// SAFETY: The minimal_rt_build crate ensures that when this code is compiled
// there is no libc for this to conflict with.
#[unsafe(no_mangle)]
unsafe extern "C" fn memset(mut ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
unsafe extern "C" fn memset(ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
// SAFETY: the caller guarantees the pointer and length are correct.
unsafe {
core::arch::asm!(r#"
Expand All @@ -52,7 +52,7 @@ unsafe extern "C" fn memset(mut ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
add x0, x0, x2
2:
"#,
inout("x0") ptr,
inout("x0") ptr => _,
in("x1") val,
in("x2") len);
}
Expand Down
8 changes: 4 additions & 4 deletions openhcl/minimal_rt/src/arch/x86_64/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// SAFETY: The minimal_rt_build crate ensures that when this code is compiled
// there is no libc for this to conflict with.
#[unsafe(no_mangle)]
unsafe extern "C" fn memset(mut ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
unsafe extern "C" fn memset(ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
// SAFETY: The caller guarantees that the pointer and length are correct.
unsafe {
core::arch::asm!(r#"
Expand All @@ -19,7 +19,7 @@ unsafe extern "C" fn memset(mut ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
"#,
in("rax") val,
in("rcx") len,
inout("rdi") ptr);
inout("rdi") ptr => _);
}
ptr
}
Expand All @@ -29,7 +29,7 @@ unsafe extern "C" fn memset(mut ptr: *mut u8, val: i32, len: usize) -> *mut u8 {
// SAFETY: The minimal_rt_build crate ensures that when this code is compiled
// there is no libc for this to conflict with.
#[unsafe(no_mangle)]
unsafe extern "C" fn memcpy(mut dest: *mut u8, src: *const u8, len: usize) -> *mut u8 {
unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, len: usize) -> *mut u8 {
// SAFETY: The caller guarantees that the pointers and length are correct.
unsafe {
core::arch::asm!(r#"
Expand All @@ -38,7 +38,7 @@ unsafe extern "C" fn memcpy(mut dest: *mut u8, src: *const u8, len: usize) -> *m
"#,
in("rsi") src,
in("rcx") len,
inout("rdi") dest);
inout("rdi") dest => _);
}
dest
}
Expand Down
Loading