From df95ab477f2aafaef9982ecfe54293c5152d02dd Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Thu, 31 May 2012 10:48:59 +0200 Subject: [PATCH] Added methods to load a firmware without specifying a memory. --- se/sics/mspsim/platform/GenericNode.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/se/sics/mspsim/platform/GenericNode.java b/se/sics/mspsim/platform/GenericNode.java index 156ee81..4bdfdcf 100644 --- a/se/sics/mspsim/platform/GenericNode.java +++ b/se/sics/mspsim/platform/GenericNode.java @@ -295,7 +295,11 @@ public abstract class GenericNode extends Chip implements Runnable { } } - public ELF loadFirmware(URL url, int[] memory) throws IOException { + public ELF loadFirmware(URL url) throws IOException { + return loadFirmware(url, cpu.memory); + } + + @Deprecated public ELF loadFirmware(URL url, int[] memory) throws IOException { DataInputStream inputStream = new DataInputStream(url.openStream()); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); byte[] firmwareData = new byte[2048]; @@ -309,11 +313,19 @@ public abstract class GenericNode extends Chip implements Runnable { return loadFirmware(elf, memory); } - public ELF loadFirmware(String name, int[] memory) throws IOException { + public ELF loadFirmware(String name) throws IOException { + return loadFirmware(name, cpu.memory); + } + + @Deprecated public ELF loadFirmware(String name, int[] memory) throws IOException { return loadFirmware(ELF.readELF(firmwareFile = name), memory); } - public ELF loadFirmware(ELF elf, int[] memory) { + public ELF loadFirmware(ELF elf) { + return loadFirmware(elf, cpu.memory); + } + + @Deprecated public ELF loadFirmware(ELF elf, int[] memory) { if (cpu.isRunning()) { stop(); }