From nobody@FreeBSD.org  Fri Jan 31 07:00:28 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 21D974BC
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Jan 2014 07:00:28 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E85AD10A4
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Jan 2014 07:00:27 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s0V70RcM017980
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Jan 2014 07:00:27 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s0V70RTv017959;
	Fri, 31 Jan 2014 07:00:27 GMT
	(envelope-from nobody)
Message-Id: <201401310700.s0V70RTv017959@oldred.freebsd.org>
Date: Fri, 31 Jan 2014 07:00:27 GMT
From: Ivan Chetyrkin <frice@inbox.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Compilation fail when "device pst" in kernel config on amd64.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186291
>Category:       amd64
>Synopsis:       [build] Compilation fail when "device pst" in kernel config on amd64.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-amd64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 31 07:10:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Mon May 05 03:26:37 UTC 2014
>Originator:     Ivan Chetyrkin
>Release:        10.0-STABLE
>Organization:
>Environment:
FreeBSD v64.devel.local 10.0-STABLE FreeBSD 10.0-STABLE #0: Thu Jan 30 21:31:03 UTC 2014     root@v64.devel.local:/usr/obj/usr/src/sys/VBOX64  amd64
>Description:
When trying to compile my own kernel with "device pst" in configuration file, process fail with message:

cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/src/sys/dev/pst/pst-iop.c
/usr/src/sys/dev/pst/pst-iop.c:197:3: error: cast to 'void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *)' from smaller integer type 'u_int32_t' (aka 'unsigned int')
      [-Werror,-Wint-to-pointer-cast]
        ((void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *))
         ^
/usr/src/sys/dev/pst/pst-iop.c:419:9: error: cast to 'struct iop_request *' from smaller integer type 'u_int32_t' (aka 'unsigned int') [-Werror,-Wint-to-pointer-cast]
        (struct iop_request *)reply->transaction_context;
        ^
2 errors generated.

As we see from /usr/src/sys/dev/pst/pst-iop.h, initiator_context and transaction_context fields of driver message struct are declared as u_int32_t, which doesn't match pointer size on 64-bit processor.
>How-To-Repeat:
On amd64 machine include
device pst
in your config file and try compile kernel.
>Fix:
The controller is very old hardware and one of fix may be exclude it from available devices on amd64 platform.

>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: freebsd-amd64@freebsd.org
Cc: Ivan Chetyrkin <frice@inbox.ru>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/186291: Compilation fail when "device pst" in kernel config on amd64.
Date: Thu, 6 Feb 2014 13:22:52 -0500

 > The controller is very old hardware and one of fix may be exclude it from 
 available devices on amd64 platform.
 
 Yes, this driver is not supported on amd64.  Do you need it to work?  You 
 would need to implement a cookie hash table of some sort to map transaction 
 context IDs to request pointers.  If you do not need it, we should probably
 disable it on amd64 as no one else has asked about it.
 
 -- 
 John Baldwin
>Unformatted:
