Subject: port-amiga/28953: idesc.c kernel compilation error
To: None <port-amiga-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <netbsd@wolfnode.de>
List: netbsd-bugs
Date: 01/13/2005 15:48:00
>Number:         28953
>Category:       port-amiga
>Synopsis:       idesc.c kernel compilation error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-amiga-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 13 15:48:00 +0000 2005
>Originator:     Florian Stoehr
>Release:        2.0
>Organization:
>Environment:
n/a (crossbuild)
>Description:
Compiling an amiga kernel containing idesc.c gives compilation errors, since file includes atareg.h and tries to redefine some defines of the header (failing).

Failes for any idesc kernel (including MDINSTALL from distribution).

Fixed by some undefs.
>How-To-Repeat:
Try to build the MDINSTALL amiga kernel or any other kernel with 

idesc0          at mainbus0             # A4000 & A1200 IDE
scsibus*        at idesc0

enabled and interfering devices disabled.


>Fix:
Index: sys/arch/amiga/dev/idesc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/dev/idesc.c,v
retrieving revision 1.55
diff -u -r1.55 idesc.c
--- sys/arch/amiga/dev/idesc.c  28 Mar 2004 18:59:39 -0000      1.55
+++ sys/arch/amiga/dev/idesc.c  13 Jan 2005 15:20:10 -0000
@@ -194,6 +194,13 @@
 #define IDEI_IN                0x02            /* transfer to(1) to from(0) host */
 #define        IDEI_RELEASE    0x04            /* bus released until finished */
 
+/* Defined by atareg.h already, so #undef first */
+#undef PHASE_CMDOUT
+#undef PHASE_DATAIN
+#undef PHASE_DATAOUT
+#undef PHASE_COMPLETED
+#undef PHASE_ABORTED
+
 #define        PHASE_CMDOUT    (IDES_DRQ | IDEI_CMD)
 #define        PHASE_DATAIN    (IDES_DRQ | IDEI_IN)
 #define        PHASE_DATAOUT   (IDES_DRQ)