summaryrefslogtreecommitdiff
path: root/sys.asm
diff options
context:
space:
mode:
Diffstat (limited to 'sys.asm')
-rw-r--r--sys.asm38
1 files changed, 13 insertions, 25 deletions
diff --git a/sys.asm b/sys.asm
index b9ab190..a237890 100644
--- a/sys.asm
+++ b/sys.asm
@@ -6,6 +6,10 @@ O_RDONLY equ 0
6O_WRONLY equ 1 6O_WRONLY equ 1
7O_RDWR equ 2 7O_RDWR equ 2
8 8
9AF_INET equ 2
10SOCK_STREAM equ 1
11INADDR_ANY equ 0
12
9macro scall1 v_rax, v_rdi 13macro scall1 v_rax, v_rdi
10{ 14{
11 mov rax, v_rax 15 mov rax, v_rax
@@ -38,31 +42,15 @@ macro ls_open filename, flags, mode { scall3 2, filename, flags, mode }
38 42
39macro ls_close fd { scall1 3, fd } 43macro ls_close fd { scall1 3, fd }
40 44
41;; kernel: arch/x86/include/uapi/asm/stat.h 45;; macro ls_stat filename, statbuf { scall2 4, filename, statbuf }
42;; struc stat 46
43;; { 47macro ls_socket family, type, protocol { scall3 41, family, type, protocol }
44;; .st_dev rd 1 48
45;; .st_ino rd 1 49macro ls_accept fd, upeer_sockaddr, upeer_addrlen { scall3 43, fd, upeer_sockaddr, upeer_addrlen }
46;; .st_mode rw 1 50
47;; .st_nlink rw 1 51macro ls_bind fd, umyaddr, addrlen { scall3 49, fd, umyaddr, addrlen }
48;; .st_uid rw 1 52
49;; .st_gid rw 1 53macro ls_listen fd, backlog { scall2 50, fd, backlog }
50;; .st_rdev rd 1
51;; .st_size rd 1
52;; .st_blksize rd 1
53;; .st_blocks rd 1
54;;
55;; .st_atime rd 1
56;; .st_atime_nsec rd 1
57;; .st_mtime rd 1
58;; .st_mtime_nsec rd 1
59;; .st_ctime rd 1
60;; .st_ctime_nsec rd 1
61;;
62;; .__unused4 rd 1
63;; .__unused5 rd 1
64;; }
65macro ls_stat filename, statbuf { scall2 4, filename, statbuf }
66 54
67macro ls_exit status { scall1 60, status } 55macro ls_exit status { scall1 60, status }
68 56