Author: mcayland Date: Sun Feb 16 17:26:25 2014 New Revision: 1262 URL: http://tracker.coreboot.org/trac/openbios/changeset/1262
Log: SPARC32: fixup psr.h header file for subsequent use
Soon we will need to use the get_psr() and put_psr() functions, however the header file needs some tidying up first. Here the extern C functions are redeclared as static inline functions, and the __ASSEMBLY macro correctly set across the relevant .S files to allow compilation to succeed as normal.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/sparc32/call-romvec.S trunk/openbios-devel/arch/sparc32/entry.S trunk/openbios-devel/arch/sparc32/psr.h trunk/openbios-devel/arch/sparc32/switch.S
Modified: trunk/openbios-devel/arch/sparc32/call-romvec.S ============================================================================== --- trunk/openbios-devel/arch/sparc32/call-romvec.S Sun Feb 16 17:26:19 2014 (r1261) +++ trunk/openbios-devel/arch/sparc32/call-romvec.S Sun Feb 16 17:26:25 2014 (r1262) @@ -1,3 +1,4 @@ +#define __ASSEMBLY #include "psr.h" #include "asm/asi.h"
Modified: trunk/openbios-devel/arch/sparc32/entry.S ============================================================================== --- trunk/openbios-devel/arch/sparc32/entry.S Sun Feb 16 17:26:19 2014 (r1261) +++ trunk/openbios-devel/arch/sparc32/entry.S Sun Feb 16 17:26:25 2014 (r1262) @@ -7,6 +7,7 @@ * $Id: head.S,v 1.12 2002/07/23 05:47:09 zaitcev Exp $ */
+#define __ASSEMBLY #include "psr.h" #include "asm/asi.h" #include "asm/crs.h"
Modified: trunk/openbios-devel/arch/sparc32/psr.h ============================================================================== --- trunk/openbios-devel/arch/sparc32/psr.h Sun Feb 16 17:26:19 2014 (r1261) +++ trunk/openbios-devel/arch/sparc32/psr.h Sun Feb 16 17:26:25 2014 (r1262) @@ -34,11 +34,9 @@ #define PSR_VERS 0x0f000000 /* cpu-version field */ #define PSR_IMPL 0xf0000000 /* cpu-implementation field */
-#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLY /* Get the %psr register. */ -extern __inline__ unsigned int get_psr(void) +static __inline__ unsigned int get_psr(void) { unsigned int psr; __asm__ __volatile__( @@ -53,7 +51,7 @@ return psr; }
-extern __inline__ void put_psr(unsigned int new_psr) +static __inline__ void put_psr(unsigned int new_psr) { __asm__ __volatile__( "wr %0, 0x0, %%psr\n\t" @@ -70,9 +68,9 @@ * incur a trap. */
-extern unsigned int fsr_storage; +static unsigned int fsr_storage;
-extern __inline__ unsigned int get_fsr(void) +static __inline__ unsigned int get_fsr(void) { unsigned int fsr = 0;
@@ -87,6 +85,4 @@
#endif /* !(__ASSEMBLY__) */
-#endif /* (__KERNEL__) */ - #endif /* !(__LINUX_SPARC_PSR_H) */
Modified: trunk/openbios-devel/arch/sparc32/switch.S ============================================================================== --- trunk/openbios-devel/arch/sparc32/switch.S Sun Feb 16 17:26:19 2014 (r1261) +++ trunk/openbios-devel/arch/sparc32/switch.S Sun Feb 16 17:26:25 2014 (r1262) @@ -1,3 +1,4 @@ +#define __ASSEMBLY #include "psr.h" #include "asm/asi.h" #define ASI_BP ASI_M_BYPASS