From d4481806706a96409801815f4a1fa105e767788b Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 10 May 2001 17:48:10 +0000 Subject: Don't loose last block during a dma. --- sim/ppc/ChangeLog | 5 +++++ sim/ppc/hw_init.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'sim') diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 8fee13a4d9..2b9e6669a5 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 7 10:45:12 HST 2001 Glen Nakamura + + * hw_init.c (dma_file): Fixed problem with loading last 1KB of + file. + 2001-03-04 Andrew Cagney * emul_netbsd.c [WITH_NetBSD_HOST]: Include and diff --git a/sim/ppc/hw_init.c b/sim/ppc/hw_init.c index b486f6f786..86e753c608 100644 --- a/sim/ppc/hw_init.c +++ b/sim/ppc/hw_init.c @@ -47,7 +47,7 @@ dma_file(device *me, count = 0; while (1) { inc = fread(buf, 1, sizeof(buf), image); - if (feof(image) || ferror(image)) + if (inc <= 0) break; if (device_dma_write_buffer(device_parent(me), buf, -- cgit v1.2.1