This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/sim/ppc] CHRP fixes
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch/sim/ppc] CHRP fixes
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 26 Oct 2001 00:40:44 -0400
Just FYI,
This fixes some minor bugs with the OpenFirmware emulation in PSIM.
Andrew
2001-10-25 Andrew Cagney <ac131313@redhat.com>
* hw_htab.c (htab_map_binary): Don't try to map the text section
when it is empty.
* emul_chirp.c (map_over_chirp_note): Default load-base to -1 not
CHIRP_LOAD_BASE.
(emul_chirp_create): Map in the interrupt table.
Index: emul_chirp.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/emul_chirp.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 emul_chirp.c
*** emul_chirp.c 1999/04/16 01:35:09 1.1.1.1
--- emul_chirp.c 2001/10/26 04:34:53
*************** map_over_chirp_note(bfd *image,
*** 1537,1543 ****
if (head.descsz == sizeof(note->desc))
note->desc.load_base = bfd_get_32(image, (void*)¬e->desc.load_base);
else
! note->desc.load_base = CHIRP_LOAD_BASE;
}
}
--- 1537,1543 ----
if (head.descsz == sizeof(note->desc))
note->desc.load_base = bfd_get_32(image, (void*)¬e->desc.load_base);
else
! note->desc.load_base = (signed32)-1;
}
}
*************** emul_chirp_create(device *root,
*** 1900,1905 ****
--- 1900,1917 ----
tree_parse(node, "./psim,description \"load & map the binary");
tree_parse(node, "./claim 1");
tree_parse(node, "./file-name \"%s", bfd_get_filename(image));
+ tree_parse(node, "./wimg %d", 0x7);
+ tree_parse(node, "./pp %d", 0x2);
+ }
+
+ /* map in the interrupt vectors */
+
+ if (!chirp->real_mode) {
+ node = tree_parse(root, "/openprom/init/htab/pte@0x0");
+ tree_parse(node, "./psim,description \"map in interrupt vectors");
+ tree_parse(node, "./virtual-address 0x0");
+ tree_parse(node, "./real-address 0x0");
+ tree_parse(node, "./nr-bytes 0x3000");
tree_parse(node, "./wimg %d", 0x7);
tree_parse(node, "./pp %d", 0x2);
}
Index: hw_htab.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_htab.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 hw_htab.c
*** hw_htab.c 1999/04/16 01:35:09 1.1.1.1
--- hw_htab.c 2001/10/26 04:34:54
*************** htab_map_binary(device *me,
*** 571,580 ****
}
/* set up virtual memory maps for each of the regions */
! htab_map_region(me, memory, sizes.text_ra, sizes.text_base,
! sizes.text_bound - sizes.text_base,
! wimg, pp,
! htaborg, htabmask);
htab_map_region(me, memory, sizes.data_ra, sizes.data_base,
sizes.data_bound - sizes.data_base,
--- 571,582 ----
}
/* set up virtual memory maps for each of the regions */
! if (sizes.text_bound - sizes.text_base > 0) {
! htab_map_region(me, memory, sizes.text_ra, sizes.text_base,
! sizes.text_bound - sizes.text_base,
! wimg, pp,
! htaborg, htabmask);
! }
htab_map_region(me, memory, sizes.data_ra, sizes.data_base,
sizes.data_bound - sizes.data_base,