Skip to content

Commit 3e34f84

Browse files
riastradhriastradh
authored andcommitted
vax __lwp_getprivate_fast: Fix asm constraints.
r0 is not clobbered; it is the output. So say so. No volatile is needed here, and volatile would be wrong, because calls to __lwp_getprivate_fast can be safely deleted if the result is not used. PR port-vax/60101: vax: __lwp_getprivate_fast() inline asm uses GCC-specific register variable pattern, not portable
1 parent c2eceb4 commit 3e34f84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sys/arch/vax/include/lwp_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: lwp_private.h,v 1.1 2024/11/30 01:04:15 christos Exp $ */
1+
/* $NetBSD: lwp_private.h,v 1.2 2026/03/19 04:38:07 riastradh Exp $ */
22

33
/*-
44
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@ static __inline void *
4242
__lwp_getprivate_fast(void)
4343
{
4444
register void *tcb __asm("r0");
45-
__asm("chmk %0" :: "i"(SYS__lwp_getprivate) : "r0");
45+
__asm("chmk %1" : "=r"(tcb) : "i"(SYS__lwp_getprivate));
4646
return tcb;
4747
}
4848

0 commit comments

Comments
 (0)