summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--image.c6
-rw-r--r--image.h10
2 files changed, 9 insertions, 7 deletions
diff --git a/image.c b/image.c
index 1f12238..c7517bd 100644
--- a/image.c
+++ b/image.c
@@ -14,10 +14,10 @@
#include <errno.h>
#include "nios2sim-ng.h"
+#include "memory.h"
#include "image.h"
-int image_load(const char *image_path, int image_format, uint8_t *mem_base,
- size_t mem_size)
+int image_load(const char *image_path, int image_format, struct memory *mem)
{
FILE *fp;
loader_func_t loader;
@@ -41,7 +41,7 @@ int image_load(const char *image_path, int image_format, uint8_t *mem_base,
return -1;
}
- ret = loader(fp, image_path, mem_base, mem_size);
+ ret = loader(fp, image_path, mem);
fclose(fp);
diff --git a/image.h b/image.h
index 01f94c9..3df996d 100644
--- a/image.h
+++ b/image.h
@@ -4,12 +4,14 @@
#ifndef _IMAGE_H_
#define _IMAGE_H_
-extern int image_load(const char *image_path, int image_format, uint8_t *mem_base, size_t mem_size);
+#include "memory.h"
+
+extern int image_load(const char *image_path, int image_format, struct memory *mem);
/* Image file loader functions */
-typedef int (*loader_func_t)(FILE *, const char *, uint8_t *, size_t);
-extern int srec_load(FILE *fp, const char *name, uint8_t *mem_base, size_t mem_size);
-extern int elf_load(FILE *fp, const char *name, uint8_t *mem_base, size_t mem_size);
+typedef int (*loader_func_t)(FILE *, const char *, struct memory *);
+extern int srec_load(FILE *fp, const char *name, struct memory *mem);
+extern int elf_load(FILE *fp, const char *name, struct memory *mem);
enum {
FORMAT_SREC,