From owner-freebsd-current Sat Apr 24 5: 2:12 1999 Delivered-To: freebsd-current@freebsd.org Received: from gneiss.eps.nagoya-u.ac.jp (gneiss.eps.nagoya-u.ac.jp [133.6.124.148]) by hub.freebsd.org (Postfix) with ESMTP id 938E414CBF for ; Sat, 24 Apr 1999 05:02:07 -0700 (PDT) (envelope-from kato@ganko.eps.nagoya-u.ac.jp) Received: from localhost (localhost [127.0.0.1]) by gneiss.eps.nagoya-u.ac.jp (8.9.3/3.7W) with ESMTP id VAA00666 for ; Sat, 24 Apr 1999 21:02:07 +0900 (JST) To: current@FreeBSD.org Subject: singed short to unsigned long conversion problem in isa.c From: KATO Takenori X-Mailer: Mew version 1.93 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) X-PGP-Fingerprint: 03 72 85 36 62 46 23 03 52 B1 10 22 44 10 0D 9E Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990424210206R.kato@gneiss.eps.nagoya-u.ac.jp> Date: Sat, 24 Apr 1999 21:02:06 +0900 X-Dispatcher: imput version 980905(IM100) Lines: 39 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The type of the member id_port in isa_device structure is signed short and a value is converted int unsigned long to allocate I/O port resource via bus_alloc_resources. If an I/O port >= 0x8000, conversion from signed short to unsigned long causes unexpected result and nexus_alloc_resouce cannot allocate resouce. Fix is: ---------- BEGIN ---------- *** isa.c.orig Sat Apr 24 20:55:32 1999 --- isa.c Sat Apr 24 20:55:24 1999 *************** *** 75,81 **** * The structure used to attach devices to the isa bus. */ struct isa_device { ! short id_port[ISA_NPORT_IVARS]; u_short id_portsize[ISA_NPORT_IVARS]; vm_offset_t id_maddr[ISA_NMEM_IVARS]; vm_size_t id_msize[ISA_NMEM_IVARS]; --- 75,81 ---- * The structure used to attach devices to the isa bus. */ struct isa_device { ! u_short id_port[ISA_NPORT_IVARS]; u_short id_portsize[ISA_NPORT_IVARS]; vm_offset_t id_maddr[ISA_NMEM_IVARS]; vm_size_t id_msize[ISA_NMEM_IVARS]; ---------- END ---------- If this should not be in sys/i386/isa, I will copy this file into sys/pc98/pc98. Comment please. -----------------------------------------------+--------------------------+ KATO Takenori | FreeBSD | Dept. Earth Planet. Sci, Nagoya Univ. | The power to serve! | Nagoya, 464-8602, Japan | http://www.FreeBSD.org/ | ++++ FreeBSD(98) 3.1: Rev. 01 available! |http://www.jp.FreeBSD.org/| ++++ FreeBSD(98) 2.2.8: Rev. 01 available! +==========================+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message