summaryrefslogtreecommitdiff
blob: 7e10d0017eabfd9d93a50c3035dc9fc99121acc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FreeBSD only works on Sparc64 and freeBSD code relies on the __sparc64__ define.
gcc only defines __sparc64__ if -mcpu is not used.
gcc-4 defaults to using -mcpu=ultrasparc on FreeBSD.

This causes us a problem. Infact, FreeBSD developers sent gcc a patch to always
define __sparc64__ when using -mcpu=ultrasparc, but this was rejected by most
people including NetBSD developers.

The correct solution is to use __sparc__.
If platform detection is required, or the code is obviously 64 bit then we can
use the __arch64__ define as well.
This combination should be supported by all gcc versions:)

--- ofw/libofw/ofw_net.c	2005-03-02 20:12:27 +0000
+++ ofw/libofw/ofw_net.c	2006-10-11 08:10:48 +0100
@@ -189,7 +189,7 @@
 	if ((ch = index(path, ':')) != NULL)
 		*ch = '\0';
 	netdev = OF_finddevice(path);
-#ifdef __sparc64__
+#if defined(__sparc__)
 	if (OF_getprop(netdev, "mac-address", desc->myea, 6) == -1)
 #else
 	if (OF_getprop(netdev, "local-mac-address", desc->myea, 6) == -1)
@@ -207,7 +207,7 @@
 	printf("ofwn_init: Open Firmware instance handle: %08x\n", netinstance);
 #endif
 
-#ifndef __sparc64__
+#ifndef __sparc__
 	dmabuf = NULL;
 	if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf)
 	    < 0) {