From a517ead7c8ed3088b64bc86c7c82d28d51140b0b Mon Sep 17 00:00:00 2001 From: Gerard Roudier Date: Sat, 24 Nov 2001 12:35:48 +0000 Subject: [PATCH] Submitted by:David E. O'Brien MFC after:3 days - Add memory barrier definition for sparc64. Patch sent by David E. O'Brien, approved by maintainer. - Fix an endianization error of a bus physical address used from SCRIPTS that made the driver fail on big endian machines as sparc64. --- sys/dev/sym/sym_hipd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index ff74579cd02c..3b771090a5ab 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -170,7 +170,7 @@ typedef u_int32_t u32; #elif defined __ia64__ #define MEMORY_BARRIER() __asm__ volatile("mf.a; mf" : : : "memory") #elif defined __sparc64__ -#error "Sorry, but maintainer is ignorant about sparc64 :)" +#define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") #else #error "Not supported platform" #endif @@ -697,7 +697,7 @@ static void sym_mfree(void *ptr, int size, char *name) #define __sym_mfree_dma(b, p, s, n) sym_mfree(p, s, n) #ifdef __alpha__ #define __vtobus(b, p) alpha_XXX_dmamap((vm_offset_t)(p)) -#else /*__i386__*/ +#else /*__i386__, __sparc64__*/ #define __vtobus(b, p) vtophys(p) #endif @@ -1047,7 +1047,7 @@ struct sym_nvram { #define mmio_write32(a, b) writel(a, b) #define memcpy_to_pci(d, s, n) memcpy_toio((u32)(d), (void *)(s), (n)) -#else /*__i386__*/ +#else /*__i386__, __sparc64__*/ #define mmio_read8(a) scr_to_cpu((*(volatile unsigned char *) (a))) #define mmio_read16(a) scr_to_cpu((*(volatile unsigned short *) (a))) @@ -9371,7 +9371,7 @@ sym_pci_attach2(pcici_t pci_tag, int unit) np->targtbl = (u32 *) sym_calloc_dma(256, "TARGTBL"); if (!np->targtbl) goto attach_failed; - np->targtbl_ba = cpu_to_scr(vtobus(np->targtbl)); + np->targtbl_ba = vtobus(np->targtbl); /* * Allocate SCRIPTS areas.