diff mbox

[2/4] pre_init: x86/init64.S: use defines for syscall numbers

Message ID 1456327988-31568-3-git-send-email-andre.przywara@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andre Przywara Feb. 24, 2016, 3:33 p.m. UTC
Instead of hardcoding the syscall numbers and providing the symbol
in the comments, just include <asm/unistd.h> and use the symbol
directly.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 x86/init64.S | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/x86/init64.S b/x86/init64.S
index 488a93f..1a7c40f 100644
--- a/x86/init64.S
+++ b/x86/init64.S
@@ -1,3 +1,11 @@ 
+/*
+ * #!/bin/sh
+ * mount -t 9p -o trans=virtio,version=9p2000.L hostfs /host
+ * /virt/init $*
+ */
+
+#include <asm/unistd.h>
+
 .data
 
 .m_dev:
@@ -16,7 +24,7 @@ 
 .globl _start
 _start:
 
-	mov $165, %rax		# __NR_mount
+	mov $__NR_mount, %rax
 	mov $.m_dev, %rdi
 	mov $.m_dir, %rsi
 	mov $.m_typ, %rdx
@@ -24,7 +32,7 @@  _start:
 	mov $.m_opt, %r8
 	syscall
 
-	mov $59, %rax		# __NR_execve
+	mov $__NR_execve, %rax
 	mov $.e_nam, %rdi
 	lea 8(%rsp), %rsi	# argv[]
 	mov %rdi, (%rsi)	# change argv[0]
@@ -33,6 +41,6 @@  _start:
 	lea (%rsi,%rcx,8), %rdx # envp[]
 	syscall
 
-	mov $60, %rax		# __NR_exit
+	mov $__NR_exit, %rax
 	mov $1, %rdi
 	syscall			# panic