Date: Mon, 9 Dec 2002 8:12:53 +0100 From: <hselasky@c2i.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: i386/46113: busspace bug Message-ID: <20021209071253.NGNL5799.fep03-svc.swip.net@mta-int.swip.net>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021209071253.NGNL5799.fep03-svc.swip.net>