From 48104df5132523759646870d8eb7f34e7854cd96 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Fri, 19 May 2017 00:49:54 +0000 Subject: 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@ --- sys/arch/hppa/include/intr.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sys/arch/hppa/include') 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 -- cgit v1.2.3