Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* add disk device to PowerPC sim
@ 2002-03-28 15:11 David O'Brien
  2002-03-28 15:17 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: David O'Brien @ 2002-03-28 15:11 UTC (permalink / raw)
  To: gdb-patches

I make this commit needed by the FreeBSD/powerpc porting effort.

2002-03-24  David O'Brien  <obrien@FreeBSD.org>
        * 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",


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add disk device to PowerPC sim
  2002-03-28 15:11 add disk device to PowerPC sim David O'Brien
@ 2002-03-28 15:17 ` Andrew Cagney
  2002-03-28 17:42   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-03-28 15:17 UTC (permalink / raw)
  To: obrien; +Cc: gdb-patches

> I make this commit needed by the FreeBSD/powerpc porting effort.
> 
> 2002-03-24  David O'Brien  <obrien@FreeBSD.org>
> * 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.

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add disk device to PowerPC sim
  2002-03-28 15:17 ` Andrew Cagney
@ 2002-03-28 17:42   ` Andrew Cagney
  2002-09-27 14:03     ` [patch/5.3] ppc "disk" -> "block"; Was: " Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-03-28 17:42 UTC (permalink / raw)
  To: obrien; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]

> I make this commit needed by the FreeBSD/powerpc porting effort.
> 
> 2002-03-24  David O'Brien  <obrien@FreeBSD.org>
> * 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.

enjoy,
Andrew

[-- Attachment #2: tree --]
[-- Type: text/plain, Size: 1184 bytes --]

/#address-cells 1

/openprom/options
	./os-emul "chrp
	./oea-memory-size 0x400000
	./use-stdio? false
/openprom/trace
#	./events 1
#	./interrupts 1

/aliases
	./ofdisk0 "/phb/ide/cdrom@0


/phb@0x80000000
	./device_type "pci
	./name "pci
	./#address-cells 3
	./#size-cells 2
	./ranges ni0,0,0,0 0xc0000000 0x10000

/phb/ide@1
	./device_type "ide
	./name "ide
	./assigned-addresses \
		ni0,0,10,1f0 8 \
		ni0,0,14,3f0 8 \
		ni0,0,18,170 8 \
		ni0,0,1c,370 8 \
		ni0,0,20,200 8
	./reg \
		1 0 \
		i0,0,10,0 8 \
		i0,0,18,0 8 \
		i0,0,14,6 1 \
		i0,0,1c,6 1 \
		i0,0,20,0 8
	./ready-delay 1000

/phb/ide@1/cdrom@0
	./device_type "block
	./name "cdrom
	./file "/dev/wd0a"

/phb/com@2
	./device_type "serial"
	./name "com"
	./assigned-addresses \
		ni0,0,10,3f8 8
	./reg \
		2 0 \
		i0,0,10,0 8

# TMP for NetBSD
/cpus
	./device_type "cpus
	./name "cpus
	./timebase-frequency 1000000
/cpus/cpu@0
	./device_type "cpu
	./name "cpu
	./timebase-frequency 1000000



#/options/real-mode? true
#/chosen/netbsd-args "/phb/ide/cdrom@0/netbsd
/chosen/netbsd-args "ofdisk0/netbsd -sd
/chosen/bootpath "ofdisk0:\boot.ppc"
/chosen/bootargs "-s"

/chosen/stdin */phb/com
/chosen/stdout !/chosen/stdin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch/5.3] ppc "disk" -> "block"; Was: add disk device to PowerPC sim
  2002-03-28 17:42   ` Andrew Cagney
@ 2002-09-27 14:03     ` Andrew Cagney
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2002-09-27 14:03 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: obrien, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1891 bytes --]

> I make this commit needed by the FreeBSD/powerpc porting effort.
> 
> 2002-03-24  David O'Brien  <obrien@FreeBSD.org>
> * 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


[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 666 bytes --]

2002-09-27  Andrew Cagney  <ac131313@redhat.com>

	* 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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-27 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-28 15:11 add disk device to PowerPC sim David O'Brien
2002-03-28 15:17 ` Andrew Cagney
2002-03-28 17:42   ` Andrew Cagney
2002-09-27 14:03     ` [patch/5.3] ppc "disk" -> "block"; Was: " Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox