From 01b68bd7de939c2ec580851339047d68c74fe5ce Mon Sep 17 00:00:00 2001 From: bjh21 Date: Sun, 10 Mar 2002 00:09:24 +0000 Subject: [PATCH] Clean up inline assembler. Rather than saving R0, copying FPSR to R0, copying it to the output register and then restoring R0, just copy the FPSR straight to the output. --- sys/arch/arm/arm32/cpu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/arch/arm/arm32/cpu.c b/sys/arch/arm/arm32/cpu.c index 19be09014cda..abac1f86dba9 100644 --- a/sys/arch/arm/arm32/cpu.c +++ b/sys/arch/arm/arm32/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.20 2002/03/09 23:49:15 bjh21 Exp $ */ +/* $NetBSD: cpu.c,v 1.21 2002/03/10 00:09:24 bjh21 Exp $ */ /* * Copyright (c) 1995 Mark Brinicombe. @@ -46,7 +46,7 @@ #include -__RCSID("$NetBSD: cpu.c,v 1.20 2002/03/09 23:49:15 bjh21 Exp $"); +__RCSID("$NetBSD: cpu.c,v 1.21 2002/03/10 00:09:24 bjh21 Exp $"); #include #include @@ -117,10 +117,7 @@ fpa_handler(u_int address, u_int instruction, trapframe_t *frame, { u_int fpsr; - __asm __volatile("stmfd sp!, {r0};" - "rfs r0;" - "mov %0, r0;" - "ldmfd sp!, {r0}" : "=r" (fpsr)); + __asm __volatile("rfs %0" : "=r" (fpsr)); printf("FPA exception: fpsr = %08x\n", fpsr); @@ -197,10 +194,7 @@ identify_master_cpu(struct device *dv, int cpu_number) undefined_test = 0; - __asm __volatile("stmfd sp!, {r0};" - "rfs r0;" - "mov %0, r0;" - "ldmfd sp!, {r0}" : "=r" (fpsr)); + __asm __volatile("rfs %0" : "=r" (fpsr)); remove_coproc_handler(uh);