Subject: pkg/9506: cdrecord doesn't work on powerpc port
To: None <>
From: SUNAGAWA Keiki <>
List: netbsd-bugs
Date: 02/29/2000 07:01:42
>Number:         9506
>Category:       pkg
>Synopsis:       cdrecord doesn't work on powerpc due to endian detect problem
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 29 07:00:01 2000
>Originator:     SUNAGAWA Keiki
>Release:        2000-02-29
System: NetBSD azarin 1.4P NetBSD 1.4P (AZARIN) #84: Wed Dec 1 21:54:14 JST 1999 kei@azarin:/a/anoncvs/netbsd/src/sys/arch/macppc/compile/AZARIN macppc

	Due to the problem of detecting endianness, cdrecord didn't recognize
	my MATSUSHITA CW-7502 on my macppc machine.
	connect CD-R to a powerpc box and see cdrecord fails to work.
	replace patch-ac to this (patch to the patch file is hard to read, so
	I send new version).

	XXX with this patch, my macppc box properly probe my CD-R drive, but
	on-board mesh is instable with DMA bulk transfer and causes SCSI bus
	lock up.  It's only SCSI hardware on my macppc box, so please someone
	who has another on-board SCSI or cards test and commit this?

	My sparc classic works well with this drive for 4x speed writing with
	this patch.

	XXX I didn't test this with little endian machine.


--- include/btorder.h.orig	Mon Jul 20 08:28:10 1998
+++ include/btorder.h	Tue Feb 15 23:18:23 2000
@@ -25,6 +25,7 @@
 #define	_BTORDER_H
 #include <sys/types.h>			/* try to load isa_defs.h on Solaris */
+#include <sys/endian.h>
 #if	defined(_BIT_FIELDS_LTOH) || defined(_BIT_FIELDS_HTOL)
@@ -46,14 +47,14 @@
 #	endif
 #	if defined(__i386) || defined(i386) || \
-	   defined(__alpha) || defined(alpha)
+	   defined(__alpha) || defined(alpha) || defined(__arm6__) || defined(__arm__)
 #		define _BIT_FIELDS_LTOH
 #	endif
 #	if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
-	   defined(__PPC) || defined(powerpc)
+	   defined(__PPC) || defined(powerpc) || defined(__powerpc__)
-#		if	defined(__BIG_ENDIAN__)
+#		if	defined(__BIG_ENDIAN__) || BYTE_ORDER == BIG_ENDIAN
 #			define _BIT_FIELDS_HTOL
 #		else
 #			define _BIT_FIELDS_LTOH