Cargo fmt
This commit is contained in:
+4
-2
@@ -6,7 +6,8 @@
|
||||
|
||||
// https://wiki.osdev.org/Creating_a_C_Library#crtbegin.o.2C_crtend.o.2C_crti.o.2C_and_crtn.o
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
global_asm!(r#"
|
||||
global_asm!(
|
||||
r#"
|
||||
.section .init
|
||||
.global _init
|
||||
_init:
|
||||
@@ -22,7 +23,8 @@ global_asm!(r#"
|
||||
movq %rsp, %rbp
|
||||
// Created a new stack frame and updated the stack pointer
|
||||
// Body will be filled in by gcc and ended by crtn.o
|
||||
"#);
|
||||
"#
|
||||
);
|
||||
// https://git.musl-libc.org/cgit/musl/tree/crt/aarch64/crti.s
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
global_asm!(r#"
|
||||
|
||||
+4
-2
@@ -6,7 +6,8 @@
|
||||
|
||||
// https://wiki.osdev.org/Creating_a_C_Library#crtbegin.o.2C_crtend.o.2C_crti.o.2C_and_crtn.o
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
global_asm!(r#"
|
||||
global_asm!(
|
||||
r#"
|
||||
.section .init
|
||||
// This happens after crti.o and gcc has inserted code
|
||||
// Pop the stack frame
|
||||
@@ -18,7 +19,8 @@ global_asm!(r#"
|
||||
// Pop the stack frame
|
||||
pop %rbp
|
||||
ret
|
||||
"#);
|
||||
"#
|
||||
);
|
||||
// https://git.musl-libc.org/cgit/musl/tree/crt/aarch64/crtn.s
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
global_asm!(r#"
|
||||
|
||||
@@ -115,6 +115,6 @@ impl PalSocket for Sys {
|
||||
}
|
||||
|
||||
fn socketpair(domain: c_int, kind: c_int, protocol: c_int, sv: &mut [c_int; 2]) -> c_int {
|
||||
e(unsafe { syscall!(SOCKETPAIR, domain, kind, protocol, sv.as_mut_ptr()) }) as c_int
|
||||
e(unsafe { syscall!(SOCKETPAIR, domain, kind, protocol, sv.as_mut_ptr()) }) as c_int
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,7 @@ use syscall::flag::EVENT_READ;
|
||||
|
||||
impl PalEpoll for Sys {
|
||||
fn epoll_create1(flags: c_int) -> c_int {
|
||||
Sys::open(
|
||||
c_str!("event:"),
|
||||
O_RDWR | flags,
|
||||
0,
|
||||
)
|
||||
Sys::open(c_str!("event:"), O_RDWR | flags, 0)
|
||||
}
|
||||
|
||||
fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut epoll_event) -> c_int {
|
||||
@@ -35,7 +31,7 @@ impl PalEpoll for Sys {
|
||||
data: unsafe { mem::transmute((*event).data) },
|
||||
},
|
||||
) as c_int
|
||||
},
|
||||
}
|
||||
EPOLL_CTL_DEL => {
|
||||
Sys::write(
|
||||
epfd,
|
||||
@@ -46,7 +42,7 @@ impl PalEpoll for Sys {
|
||||
data: 0,
|
||||
},
|
||||
) as c_int
|
||||
},
|
||||
}
|
||||
_ => {
|
||||
unsafe { platform::errno = EINVAL };
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user