/* This file is part of the program psim.
- Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
+ Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
return -1;
phandle = external_to_device(data->root, args.phandle);
- emul_read_string(previous,
- args.previous,
- sizeof(previous),
- processor, cia);
+ if (args.previous != 0)
+ emul_read_string(previous,
+ args.previous,
+ sizeof(previous),
+ processor, cia);
+ else
+ /* If previous is NULL, make it look like the empty string. The
+ next property after the empty string is the first property. */
+ strcpy (previous, "");
TRACE(trace_os_emul, ("nextprop - in - phandle=0x%lx(0x%lx`%s') previous=`%s' buf=0x%lx\n",
(unsigned long)args.phandle,
(unsigned long)phandle,
else {
const device_property *prev_prop = device_find_property(phandle, previous);
if (prev_prop == NULL) {
- args.flag = -1; /* name invalid */
+ if (strcmp (previous, "") == 0)
+ args.flag = 0; /* No properties */
+ else
+ args.flag = -1; /* name invalid */
}
else {
const device_property *next_prop;
- next_prop = device_next_property(prev_prop);
+ if (strcmp (previous, "") == 0) {
+ next_prop = prev_prop; /* The first property. */
+ }
+ else {
+ next_prop = device_next_property(prev_prop);
+ }
if (next_prop == NULL) {
args.flag = 0; /* last property */
}
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;
+ note->desc.load_base = (signed32)-1;
}
}
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);
+ }
+
return chirp;
}