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.
This commit is contained in:
Gerard Roudier 2001-11-24 12:35:48 +00:00
parent bafdc304b0
commit a517ead7c8

View File

@ -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.