Squash commits for public release
This commit is contained in:
21
libs/libc/sysdeps/unix/arm32/crt0.S
Normal file
21
libs/libc/sysdeps/unix/arm32/crt0.S
Normal file
@@ -0,0 +1,21 @@
|
||||
.section .text
|
||||
|
||||
.extern main
|
||||
.extern exit
|
||||
.extern _init
|
||||
.extern _deinit
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
push {r0-r2}
|
||||
sub sp, sp, #4 // align to 16bytes
|
||||
bl _init
|
||||
add sp, sp, #4
|
||||
pop {r0-r2}
|
||||
bl main
|
||||
push {r0}
|
||||
sub sp, sp, #12 // align to 16bytes
|
||||
bl _deinit
|
||||
add sp, sp, #12
|
||||
pop {r0}
|
||||
bl exit
|
||||
21
libs/libc/sysdeps/unix/arm64/crt0.S
Normal file
21
libs/libc/sysdeps/unix/arm64/crt0.S
Normal file
@@ -0,0 +1,21 @@
|
||||
.section .text
|
||||
|
||||
.extern main
|
||||
.extern exit
|
||||
.extern _init
|
||||
.extern _deinit
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
sub sp, sp, #0x40
|
||||
stp x0,x1,[sp]
|
||||
stp x2,x3,[sp,#0x10]
|
||||
bl _init
|
||||
ldp x0,x1,[sp]
|
||||
ldp x2,x3,[sp,#0x10]
|
||||
bl main
|
||||
stp x0,x1,[sp]
|
||||
bl _deinit
|
||||
ldp x0,x1,[sp]
|
||||
add sp, sp, #0x40
|
||||
bl exit
|
||||
8
libs/libc/sysdeps/unix/generic/ioctl.c
Normal file
8
libs/libc/sysdeps/unix/generic/ioctl.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
int ioctl(int fd, uintptr_t cmd, uintptr_t arg)
|
||||
{
|
||||
int res = DO_SYSCALL_3(SYS_IOCTL, fd, cmd, arg);
|
||||
RETURN_WITH_ERRNO(res, res, -1);
|
||||
}
|
||||
32
libs/libc/sysdeps/unix/riscv64/crt0.S
Normal file
32
libs/libc/sysdeps/unix/riscv64/crt0.S
Normal file
@@ -0,0 +1,32 @@
|
||||
.section .text
|
||||
|
||||
.extern main
|
||||
.extern exit
|
||||
.extern _init
|
||||
.extern _deinit
|
||||
.extern __global_pointer$
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
.option push
|
||||
.option norelax
|
||||
la gp, __global_pointer$
|
||||
.option pop
|
||||
addi sp, sp, -0x40
|
||||
sd a0, 0(sp)
|
||||
sd a1, 8(sp)
|
||||
sd a2, 16(sp)
|
||||
sd a3, 24(sp)
|
||||
call _init
|
||||
ld a0, 0(sp)
|
||||
ld a1, 8(sp)
|
||||
ld a2, 16(sp)
|
||||
ld a3, 24(sp)
|
||||
call main
|
||||
sd a0, 0(sp)
|
||||
sd a1, 8(sp)
|
||||
call _deinit
|
||||
ld a0, 0(sp)
|
||||
ld a1, 8(sp)
|
||||
addi sp, sp, 0x40
|
||||
call exit
|
||||
15
libs/libc/sysdeps/unix/x86/crt0.S
Normal file
15
libs/libc/sysdeps/unix/x86/crt0.S
Normal file
@@ -0,0 +1,15 @@
|
||||
section .text
|
||||
|
||||
extern main
|
||||
extern exit
|
||||
extern _init
|
||||
extern _deinit
|
||||
|
||||
global _start:function (_start.end - _start)
|
||||
_start:
|
||||
call _init
|
||||
call main
|
||||
push eax
|
||||
call _deinit
|
||||
call exit
|
||||
.end:
|
||||
27
libs/libc/sysdeps/unix/x86_64/crt0.S
Normal file
27
libs/libc/sysdeps/unix/x86_64/crt0.S
Normal file
@@ -0,0 +1,27 @@
|
||||
[bits 64]
|
||||
|
||||
section .text
|
||||
|
||||
extern main
|
||||
extern exit
|
||||
extern _init
|
||||
extern _deinit
|
||||
|
||||
global _start:function (_start.end - _start)
|
||||
_start:
|
||||
push rsi
|
||||
push rdi
|
||||
push rdx
|
||||
push rcx
|
||||
call _init
|
||||
pop rcx
|
||||
pop rdx
|
||||
pop rdi
|
||||
pop rsi
|
||||
call main
|
||||
push rax
|
||||
call _deinit
|
||||
pop rax
|
||||
mov rdi, rax
|
||||
call exit
|
||||
.end:
|
||||
Reference in New Issue
Block a user