/[osn-commons]/trunk/plibc/x86_64/boot.s
ViewVC logotype

Contents of /trunk/plibc/x86_64/boot.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (show annotations)
Fri Aug 16 18:34:43 2024 UTC (7 months, 2 weeks ago) by rakinar2
File MIME type: text/x-asm
File size: 788 byte(s)
feat: add basic utilities and more system calls

1 .text
2
3 .globl plibc_init
4 .type plibc_init, @function
5
6 plibc_init:
7 call get_errno_location
8 xorl %edi, %edi
9 movl %edi, (%rax)
10 ret
11
12 .globl plibc_deinit
13 .type plibc_deinit, @function
14
15 plibc_deinit:
16 ret
17
18 .globl plibc_deinit_sfds
19 .type plibc_deinit_sfds, @function
20
21 plibc_deinit_sfds:
22 push %rbp
23 mov %rsp, %rbp
24 call plibc_sfds_status
25 push %rax
26 mov $3, %rcx
27 .plibc_deinit_sfds.loop_start:
28 mov %rcx, %rdi
29 dec %rdi
30 mov -8(%rbp), %rax
31 movb (%rax, %rdi), %al
32 test %al, %al
33 jz .plibc_deinit_sfds.loop_repeat
34 push %rcx
35 call close
36 pop %rcx
37 .plibc_deinit_sfds.loop_repeat:
38 loop .plibc_deinit_sfds.loop_start
39 .plibc_deinit_sfds.loop_end:
40 mov %rbp, %rsp
41 pop %rbp
42 ret
43
44 .section .note.GNU-stack,"",@progbits

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26