From owner-freebsd-bugs Sun Dec 8 23:20:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11F0B37B401 for ; Sun, 8 Dec 2002 23:20:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3199143EC5 for ; Sun, 8 Dec 2002 23:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB97K2x3069581 for ; Sun, 8 Dec 2002 23:20:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB97K2Qt069580; Sun, 8 Dec 2002 23:20:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA8B137B401 for ; Sun, 8 Dec 2002 23:12:55 -0800 (PST) Received: from fep03-svc.swip.net (fep03.swip.net [130.244.199.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E9AD43E4A for ; Sun, 8 Dec 2002 23:12:54 -0800 (PST) (envelope-from hselasky@c2i.net) Received: from mta-int.swip.net ([192.168.145.27]) by fep03-svc.swip.net with SMTP id <20021209071253.NGNL5799.fep03-svc.swip.net@mta-int.swip.net> for ; Mon, 9 Dec 2002 08:12:53 +0100 Message-Id: <20021209071253.NGNL5799.fep03-svc.swip.net@mta-int.swip.net> Date: Mon, 9 Dec 2002 8:12:53 +0100 From: To: FreeBSD-gnats-submit@FreeBSD.org Subject: i386/46113: busspace bug Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46113 >Category: i386 >Synopsis: busspace bug >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 08 23:20:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: - >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD curly.tele2.no 5.0-CURRENT FreeBSD 5.0-CURRENT #458: Sat Dec 7 18:40:33 CET 2002 root@curly.tele2.no:/usr/obj/usr/src/sys/custom i386 >Description: Some busspace functions lack check for (count == 0). Some busspace functions interpret (count == 0) as (unsigned)(-1) + 1. >How-To-Repeat: >Fix: --- bus_at386.h.diff begins here --- *** /mnt3/src/sys/i386/include/bus_at386.h Mon Jul 29 12:21:22 2002 --- bus_at386.h Mon Nov 18 17:42:32 2002 *************** *** 277,282 **** --- 277,284 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: movb (%2),%%al \n\ *************** *** 285,290 **** --- 287,293 ---- "=D" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory"); + } #endif } #endif *************** *** 306,311 **** --- 309,316 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: movw (%2),%%ax \n\ *************** *** 314,319 **** --- 319,325 ---- "=D" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory"); + } #endif } #endif *************** *** 335,340 **** --- 341,348 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: movl (%2),%%eax \n\ *************** *** 343,348 **** --- 351,357 ---- "=D" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory"); + } #endif } #endif *************** *** 384,389 **** --- 393,400 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: inb %w2,%%al \n\ *************** *** 393,398 **** --- 404,410 ---- "=D" (addr), "=c" (count), "=d" (_port_) : "0" (addr), "1" (count), "2" (_port_) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 426,431 **** --- 438,445 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: inw %w2,%%ax \n\ *************** *** 435,440 **** --- 449,455 ---- "=D" (addr), "=c" (count), "=d" (_port_) : "0" (addr), "1" (count), "2" (_port_) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 468,473 **** --- 483,490 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: inl %w2,%%eax \n\ *************** *** 477,482 **** --- 494,500 ---- "=D" (addr), "=c" (count), "=d" (_port_) : "0" (addr), "1" (count), "2" (_port_) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 616,621 **** --- 634,641 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ *************** *** 624,629 **** --- 644,650 ---- "=S" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 645,650 **** --- 666,673 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ *************** *** 653,658 **** --- 676,682 ---- "=S" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 674,679 **** --- 698,705 ---- #endif { #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ *************** *** 682,687 **** --- 708,714 ---- "=S" (addr), "=c" (count) : "r" (bsh + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 724,729 **** --- 751,758 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ *************** *** 733,738 **** --- 762,768 ---- "=d" (_port_), "=S" (addr), "=c" (count) : "0" (_port_), "1" (addr), "2" (count) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 766,771 **** --- 796,803 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ *************** *** 775,780 **** --- 807,813 ---- "=d" (_port_), "=S" (addr), "=c" (count) : "0" (_port_), "1" (addr), "2" (count) : "%eax", "memory", "cc"); + } #endif } #endif *************** *** 808,813 **** --- 841,848 ---- { int _port_ = bsh + offset; #ifdef __GNUC__ + if(count != 0) + { __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ *************** *** 817,822 **** --- 852,858 ---- "=d" (_port_), "=S" (addr), "=c" (count) : "0" (_port_), "1" (addr), "2" (count) : "%eax", "memory", "cc"); + } #endif } #endif --- bus_at386.h.diff ends here --- ------------------------------------------------- WebMail fra Tele2 http://www.tele2.no ------------------------------------------------- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message