Skip to content

Commit 4c93ae4

Browse files
committed
std.os.linux: fix comment syntax in asm
1 parent 2adabed commit 4c93ae4

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

lib/std/os/linux/aarch64.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn clone() callconv(.naked) usize {
115115
\\ mov x2,x4
116116
\\ mov x3,x5
117117
\\ mov x4,x6
118-
\\ mov x8,#220 // SYS_clone
118+
\\ mov x8,#220 /* SYS_clone */
119119
\\ svc #0
120120
\\
121121
\\ cbz x0,1f
@@ -134,14 +134,14 @@ pub fn clone() callconv(.naked) usize {
134134
\\
135135
\\ ldp x1,x0,[sp],#16
136136
\\ blr x1
137-
\\ mov x8,#93 // SYS_exit
137+
\\ mov x8,#93 /* SYS_exit */
138138
\\ svc #0
139139
);
140140
}
141141

142142
pub fn clone3() callconv(.Naked) usize {
143143
asm volatile (
144-
\\ mov x8,#435 // SYS_clone3
144+
\\ mov x8,#435 /* SYS_clone3 */
145145
\\ svc #0
146146
\\
147147
\\ cbz x0,1f
@@ -153,7 +153,7 @@ pub fn clone3() callconv(.Naked) usize {
153153
\\
154154
\\ mov x0,x3
155155
\\ blr x2
156-
\\ mov x8,#93 // SYS_exit
156+
\\ mov x8,#93 /* SYS_exit */
157157
\\ svc #0
158158
);
159159
}

lib/std/os/linux/arm.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub fn clone() callconv(.naked) usize {
106106
// r7 r0, r1, r2, r3, r4
107107
asm volatile (
108108
\\ stmfd sp!,{r4,r5,r6,r7}
109-
\\ mov r7,#120 // SYS_clone
109+
\\ mov r7,#120 /* SYS_clone */
110110
\\ mov r6,r3
111111
\\ mov r5,r0
112112
\\ mov r0,r2
@@ -127,7 +127,7 @@ pub fn clone() callconv(.naked) usize {
127127
\\
128128
\\ mov r0,r6
129129
\\ bl 3f
130-
\\ mov r7,#1 // SYS_exit
130+
\\ mov r7,#1 /* SYS_exit */
131131
\\ svc 0
132132
\\
133133
\\3: bx r5
@@ -137,7 +137,7 @@ pub fn clone() callconv(.naked) usize {
137137
pub fn clone3() callconv(.Naked) usize {
138138
asm volatile (
139139
\\ stmfd sp!,{r7}
140-
\\ mov r7,#435 // SYS_clone3
140+
\\ mov r7,#435 /* SYS_clone3 */
141141
\\ svc 0
142142
\\ tst r0,r0
143143
\\ beq 1f
@@ -149,7 +149,7 @@ pub fn clone3() callconv(.Naked) usize {
149149
\\ mov lr, #0
150150
\\ mov r0,r3
151151
\\ bx r2
152-
\\ mov r7,#1 // SYS_exit
152+
\\ mov r7,#1 /* SYS_exit */
153153
\\ svc 0
154154
);
155155
}

lib/std/os/linux/x86.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub fn clone() callconv(.naked) usize {
146146
\\ movl 24(%%ebp),%%edx
147147
\\ movl 28(%%ebp),%%esi
148148
\\ movl 32(%%ebp),%%edi
149-
\\ movl $120,%%eax // SYS_clone
149+
\\ movl $120,%%eax /* SYS_clone */
150150
\\ int $128
151151
\\ testl %%eax,%%eax
152152
\\ jz 1f
@@ -167,7 +167,7 @@ pub fn clone() callconv(.naked) usize {
167167
\\ popl %%eax
168168
\\ calll *%%eax
169169
\\ movl %%eax,%%ebx
170-
\\ movl $1,%%eax // SYS_exit
170+
\\ movl $1,%%eax /* SYS_exit */
171171
\\ int $128
172172
);
173173
}
@@ -180,7 +180,7 @@ pub fn clone3() callconv(.Naked) usize {
180180
\\ movl 16(%%esp),%%ecx
181181
\\ movl 20(%%esp),%%edx
182182
\\ movl 24(%%esp),%%esi
183-
\\ movl $435,%%eax // SYS_clone3
183+
\\ movl $435,%%eax /* SYS_clone3 */
184184
\\ int $128
185185
\\ testl %%eax,%%eax
186186
\\ jz 1f
@@ -197,7 +197,7 @@ pub fn clone3() callconv(.Naked) usize {
197197
\\ pushl %%esi
198198
\\ calll *%%edx
199199
\\ movl %%eax,%%ebx
200-
\\ movl $1,%%eax // SYS_exit
200+
\\ movl $1,%%eax /* SYS_exit */
201201
\\ int $128
202202
);
203203
}

lib/std/os/linux/x86_64.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn syscall6(
103103

104104
pub fn clone() callconv(.naked) usize {
105105
asm volatile (
106-
\\ movl $56,%%eax // SYS_clone
106+
\\ movl $56,%%eax /* SYS_clone */
107107
\\ movq %%rdi,%%r11
108108
\\ movq %%rdx,%%rdi
109109
\\ movq %%r8,%%rdx
@@ -129,15 +129,15 @@ pub fn clone() callconv(.naked) usize {
129129
\\ popq %%rdi
130130
\\ callq *%%r9
131131
\\ movl %%eax,%%edi
132-
\\ movl $60,%%eax // SYS_exit
132+
\\ movl $60,%%eax /* SYS_exit */
133133
\\ syscall
134134
\\
135135
);
136136
}
137137

138138
pub fn clone3() callconv(.Naked) usize {
139139
asm volatile (
140-
\\ movl $435,%%eax // SYS_clone3
140+
\\ movl $435,%%eax /* SYS_clone3 */
141141
\\ movq %%rcx,%%r8
142142
\\ syscall
143143
\\ testq %%rax,%%rax
@@ -150,7 +150,7 @@ pub fn clone3() callconv(.Naked) usize {
150150
\\ movq %%r8,%%rdi
151151
\\ callq *%%rdx
152152
\\ movl %%eax,%%edi
153-
\\ movl $60,%%eax // SYS_exit
153+
\\ movl $60,%%eax /* SYS_exit */
154154
\\ syscall
155155
\\
156156
);

0 commit comments

Comments
 (0)