This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
sim/1183: bug in the allocation of Open Firmware's htab for PowerPC
- From: obrien at freebsd dot org
- To: gdb-gnats at sources dot redhat dot com
- Cc: freebsd-ppc at freebsd dot org
- Date: 20 Apr 2003 21:42:57 -0000
- Subject: sim/1183: bug in the allocation of Open Firmware's htab for PowerPC
- Reply-to: obrien at freebsd dot org
>Number: 1183
>Category: sim
>Synopsis: bug in the allocation of Open Firmware's htab for PowerPC
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: patch
>Submitter-Id: net
>Arrival-Date: Sun Apr 20 21:48:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Joshua LeVasseur <jtl at bothan dot net>
>Release: unknown-1.0
>Organization:
>Environment:
GDB 5.3
>Description:
1. The allocation of Open Firmware's htab. The bug exposes itself when you simulate with lots of memory, causing psim to complain that the htab location is incompatible with the htabmask. The code calculates an incorrect htabmask.
2. The client Open Firmware interface function "nextprop" never returns the first property.
>How-To-Repeat:
>Fix:
See attached "original-fbsd-report.txt" file.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="original-fbsd-report.txt"
Content-Disposition: inline; filename="original-fbsd-report.txt"
From: Joshua LeVasseur <jtl at bothan dot net>
Subject: some psim bugs
Date: Fri, 11 Apr 2003 17:18:22 +0200
To: freebsd-ppc at freebsd dot org
X-Image-Url: jtl at bothan dot net
X-Mailer: Apple Mail (2.552)
X-BeenThere: freebsd-ppc at freebsd dot org
X-Mailman-Version: 2.1.1
Errors-To: owner-freebsd-ppc at freebsd dot org
In case any of you still use psim, I uncovered two more bugs (sorry if
these are repeats) ...
The first concerns the allocation of Open Firmware's htab. The bug
exposes itself when you simulate with lots of memory, causing psim to
complain that the htab location is incompatible with the htabmask. The
code calculates an incorrect htabmask. In file gdb/sim/ppc/hw_htab.c,
function htab_decode_hash_table(), look for:
if ((htab_ra & INSERTED32(*htabmask, 7, 15)) != 0) {
device_error(parent, "htaborg 0x%lx not aligned to htabmask
0x%lx",
(unsigned long)*htaborg, (unsigned long)*htabmask);
}
And change to:
if ((htab_ra & (htab_nr_bytes-1)) != 0) {
device_error(parent, "htaborg 0x%lx not aligned to htabmask
0x%lx",
(unsigned long)*htaborg, (unsigned long)*htabmask);
}
After fixing this problem, it is no longer necessary to manually
configure OpenFirmware's layout in memory.
The second bug also concerns the emulated Open Firmware. The client
interface function "nextprop" never returns the first property. In the
file gdb/sim/ppc/emul_chirp.c, in chirp_emul_nextprop(), look for the
statement:
next_prop = device_next_property(prev_prop);
And change to:
if( *previous == '\0' )
next_prop = prev_prop; /* Return the first property! */
else
next_prop = device_next_property(prev_prop);
-Josh
_______________________________________________
freebsd-ppc at freebsd dot org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "freebsd-ppc-unsubscribe at freebsd dot org"