This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Committed, sim/cris: fix mmap2 anon call unaligned length.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 18 Apr 2005 05:09:54 +0200
- Subject: Committed, sim/cris: fix mmap2 anon call unaligned length.
Oh right, the testsuite isn't committed. I *have* a test-case
for this anyway. Spotted for libffi testing.
Committed.
* cris/traps.c (cris_break_13_handler) <case TARGET_SYS_mmap2>:
For ((len & 8191) != 0 && fd == (USI) -1), don't say this isn't
implemented. In call to create_map, pad length argument to 8k.
Index: traps.c
===================================================================
RCS file: /cvs/src/src/sim/cris/traps.c,v
retrieving revision 1.2
diff -p -c -u -p -r1.2 traps.c
cvs diff: conflicting specifications of output style
--- traps.c 24 Mar 2005 01:14:09 -0000 1.2
+++ traps.c 18 Apr 2005 03:04:00 -0000
@@ -1530,8 +1530,7 @@ cris_break_13_handler (SIM_CPU *current_
&& flags != TARGET_MAP_PRIVATE
&& flags != TARGET_MAP_SHARED)
|| (fd != (USI) -1 && prot != TARGET_PROT_READ)
- || pgoff != 0
- || ((len & 8191) != 0 && fd == (USI) -1))
+ || pgoff != 0)
{
sim_io_eprintf (sd, "Unimplemented mmap2 call "
"(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx)\n",
@@ -1611,7 +1610,8 @@ cris_break_13_handler (SIM_CPU *current_
else
{
USI newaddr
- = create_map (sd, ¤t_cpu->highest_mmapped_page, addr, len);
+ = create_map (sd, ¤t_cpu->highest_mmapped_page, addr,
+ (len + 8191) & ~8191);
if (newaddr >= (USI) -8191)
retval = -cb_host_to_target_errno (cb, -(SI) newaddr);
brgds, H-P