Problem Report amd64/78848 "sis driver on FreeBSD 5.x does not work on amd64"

Stasys Smailys ssmailys at komvista.lt
Mon Mar 28 01:13:18 PST 2005


Hello there!

I've had the same problem with SiS 755 and SiS 964 on ASRock K8S8X, the 
only difference was that MAC address had all zeros (00:00:00:00:00:00). 
The problem is that integrated NIC doesn't have any eeprom to read from. 
I solved it by applying this patch. As by now it works for me. AFAIK it 
is not solved properly even in -CURRENT.

By the way I noticed some typo in 
/usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c and 
/usr/src/lib/libc/i386/sys/_amd64_get_gsbase.c. IMHO when calling 
sysarch(int, void *) it should look like this:

/usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c:
[...]
ret = sysarch(_AMD64_GET_FSBASE, (void *)(&addr64));
[...]

/usr/src/lib/libc/i386/sys/_amd64_get_gsbase.c:
[...]
ret = sysarch(_AMD64_GET_GSBASE, (void *)(&addr64));
[...]

WBR,
Stasys Smailys
-------------- next part --------------
--- /usr/src/sys/pci/if_sis.c.orig	Thu Mar  3 06:16:17 2005
+++ /usr/src/sys/pci/if_sis.c	Sat Mar 26 09:25:54 2005
@@ -139,7 +139,7 @@
 static void sis_eeprom_putbyte	(struct sis_softc *, int);
 static void sis_eeprom_getword	(struct sis_softc *, int, u_int16_t *);
 static void sis_read_eeprom	(struct sis_softc *, caddr_t, int, int, int);
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 static void sis_read_cmos	(struct sis_softc *, device_t, caddr_t,
 							int, int);
 static void sis_read_mac	(struct sis_softc *, device_t, caddr_t);
@@ -418,7 +418,7 @@
 	return;
 }
 
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 static device_t
 sis_find_bridge(dev)
 	device_t		dev;
@@ -476,7 +476,11 @@
 	pci_write_config(bridge, 0x48, reg|0x40, 1);
 
 	/* XXX */
+#if defined(__i386__)
 	btag = I386_BUS_SPACE_IO;
+#elif defined(__amd64__)
+	btag = AMD64_BUS_SPACE_IO;
+#endif
 
 	for (i = 0; i < cnt; i++) {
 		bus_space_write_1(btag, 0x0, 0x70, i + off);
@@ -1144,7 +1148,7 @@
 		break;
 	case SIS_VENDORID:
 	default:
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 		/*
 		 * If this is a SiS 630E chipset with an embedded
 		 * SiS 900 controller, we have to read the MAC address
@@ -1603,7 +1607,7 @@
 		}
 
 		/* No errors; receive the packet. */	
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 		/*
 		 * On the x86 we do not have alignment problems, so try to
 		 * allocate a new buffer for the receive ring, and pass up
-------------- next part --------------
--- /usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c.orig	Sat Nov 27 22:24:31 2004
+++ /usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c	Thu Mar 24 23:16:48 2005
@@ -37,7 +37,7 @@
 	int ret;
 
 	addr64 = 0;
-	ret = sysarch(_AMD64_GET_FSBASE, (void **)(&addr64));
+	ret = sysarch(_AMD64_GET_FSBASE, (void *)(&addr64));
 	if (ret != -1)
 		*addr = (void *)(uintptr_t)addr64;
 	return ret;
-------------- next part --------------
--- /usr/src/lib/libc/i386/sys/_amd64_get_gsbase.c.orig	Sat Nov 27 22:24:31 2004
+++ /usr/src/lib/libc/i386/sys/_amd64_get_gsbase.c	Thu Mar 24 23:16:51 2005
@@ -37,7 +37,7 @@
 	int ret;
 
 	addr64 = 0;
-	ret = sysarch(_AMD64_GET_GSBASE, (void **)(&addr64));
+	ret = sysarch(_AMD64_GET_GSBASE, (void *)(&addr64));
 	if (ret != -1)
 		*addr = (void *)(uintptr_t)addr64;
 	return ret;


More information about the freebsd-amd64 mailing list