From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15430 invoked by alias); 27 Sep 2002 21:03:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15422 invoked from network); 27 Sep 2002 21:03:40 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Sep 2002 21:03:40 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 9E16D3E9C; Fri, 27 Sep 2002 17:03:36 -0400 (EDT) Message-ID: <3D94C7A8.50603@redhat.com> Date: Fri, 27 Sep 2002 14:03:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney Cc: obrien@FreeBSD.org, gdb-patches@sources.redhat.com Subject: [patch/5.3] ppc "disk" -> "block"; Was: add disk device to PowerPC sim References: <20020328150956.A99002@dragon.nuxi.com> <3CA3A41F.5060502@cygnus.com> <3CA3C617.9000302@cygnus.com> Content-Type: multipart/mixed; boundary="------------020100010205080508030403" X-SW-Source: 2002-09/txt/msg00681.txt.bz2 This is a multi-part message in MIME format. --------------020100010205080508030403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1891 > I make this commit needed by the FreeBSD/powerpc porting effort. > > 2002-03-24 David O'Brien > * ppc/hw_disk.c: Export a disk device property. > > Index: hw_disk.c > =================================================================== > RCS file: /cvs/src/src/sim/ppc/hw_disk.c,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- hw_disk.c 1999/04/16 01:35:09 1.1 > +++ hw_disk.c 2002/03/25 04:39:20 1.2 > @@ -232,6 +232,9 @@ > space, address, 0/*size*/, access_read_write_exec, > me); > > + /* Tell the world we are a disk. */ > + device_add_string_property(me, "device_type", "disk"); > + > /* get the name of the file specifying the disk image */ > disk->name_index = 0; > disk->nr_names = device_find_string_array_property(me, "file", > > I'm going to need to dig up my 1275 manual to check this one out. > > David, > > A disk drive has a "device_type" of "block" not "disk". See 1276 section 3.7 (Standard device types) and 3.7.2 ("block" devices). Could you please fix this, trunk and branch (given it has already been checked into the branch :-( ). > > At present none of other hw_*.c files are doing like the above. Instead they use a device tree (see attached) so your two line patch introduces a very fundamental change in the simulator's behavour. However, yes, the current need to specify all the properties in a file is a pain and the code to start doing this is long overdue. > > Looking at the actual change, ..._init_address() appears to get the job done. However, if you trace the code, the second and further init calls try to re-add the property to the tree (see how permenant_object is used) - fortunatly these are ignored. Can you please create a bug-report documenting this problem. I've checked in the attached. HEAD and gdb_5_3-branch. Andrew --------------020100010205080508030403 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 666 2002-09-27 Andrew Cagney * hw_disk.c (hw_disk_init_address): Set device type to "block", not "disk". Index: hw_disk.c =================================================================== RCS file: /cvs/src/src/sim/ppc/hw_disk.c,v retrieving revision 1.2 diff -u -r1.2 hw_disk.c --- hw_disk.c 25 Mar 2002 04:39:20 -0000 1.2 +++ hw_disk.c 27 Sep 2002 21:00:45 -0000 @@ -233,7 +233,7 @@ me); /* Tell the world we are a disk. */ - device_add_string_property(me, "device_type", "disk"); + device_add_string_property(me, "device_type", "block"); /* get the name of the file specifying the disk image */ disk->name_index = 0; --------------020100010205080508030403--