diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2017-05-19 00:49:54 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2017-05-19 00:49:54 +0000 |
commit | 48104df5132523759646870d8eb7f34e7854cd96 (patch) | |
tree | c1ccd8f591636360da50ea492f5c54de87e3d22d /sys/arch | |
parent | 24230fc010e8872354af312016253177b8ebe2d5 (diff) |
tweak the spllower asm so it is more straightforward.
this properly identifies the registers used as input and output
operands to the code running in the trap handler, and passes them
to the asm statement as such. this means we dont have to do an extra
copy in the asm, or an extra clobber to keep the compiler away from
the registers. it also lets gcc set up and use the input register
nicely before it reaches the asm.
ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/include/intr.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h index 340b52918e3..6d7a1914276 100644 --- a/sys/arch/hppa/include/intr.h +++ b/sys/arch/hppa/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.42 2015/09/13 14:58:20 kettenis Exp $ */ +/* $OpenBSD: intr.h,v 1.43 2017/05/19 00:49:53 dlg Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -92,11 +92,15 @@ void intr_barrier(void *); static __inline int spllower(int ncpl) { - register int ocpl asm("r28") = ncpl; - __asm volatile("copy %0, %%arg0\n\tbreak %1, %2" - : "+r" (ocpl) : "i" (HPPA_BREAK_KERNEL), "i" (HPPA_BREAK_SPLLOWER) - : "r26", "memory"); - return (ocpl); + register int arg0 asm("r26") = ncpl; + register int ret0 asm("r28"); + + __asm volatile("break %1, %2" + : "=r" (ret0) + : "i" (HPPA_BREAK_KERNEL), "i" (HPPA_BREAK_SPLLOWER), "r" (arg0) + : "memory"); + + return (ret0); } static __inline int |