From 7820584503766e5d2a5c1533a0f91d39765e29c2 Mon Sep 17 00:00:00 2001 From: Takashi Mori Date: Fri, 5 Feb 2021 08:19:22 +0900 Subject: [PATCH] fix #29 --- src/device/mpu/loader/loader.c | 2 +- src/inc/athrill_exdev_header.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device/mpu/loader/loader.c b/src/device/mpu/loader/loader.c index 21b60a85..a9de23ce 100644 --- a/src/device/mpu/loader/loader.c +++ b/src/device/mpu/loader/loader.c @@ -192,7 +192,7 @@ static Std_ReturnType Elf_LoadProgram(const Elf32_Ehdr *elf_image, MemoryAddress } } for (i = 0; i < memap->dev_num; i++) { - ptr = mpu_address_set_dev(memap->dev[i].start, memap->dev[i].size * 1024, memap->dev[i].extdev_handle); + ptr = mpu_address_set_dev(memap->dev[i].start, memap->dev[i].size, memap->dev[i].extdev_handle); if (ptr == NULL) { printf("Invalid dev file: can not load dev addr=0x%x\n", memap->dev[i].start); return STD_E_INVALID; diff --git a/src/inc/athrill_exdev_header.h b/src/inc/athrill_exdev_header.h index 3ee64982..d6ad0a97 100644 --- a/src/inc/athrill_exdev_header.h +++ b/src/inc/athrill_exdev_header.h @@ -2,11 +2,11 @@ #define _ATHRILL_EXDEV_HEADER_H_ #define ATHRILL_EXTERNAL_DEVICE_MAGICNO 0xBEAFDEAD -#define ATHRILL_EXTERNAL_DEVICE_VERSION 0x00000001 +#define ATHRILL_EXTERNAL_DEVICE_VERSION 0x00000002 typedef struct { unsigned int magicno; /* ATHRILL_EXTERNAL_DEVICE_MAGICNO */ unsigned int version; /* ATHRILL_EXTERNAL_DEVICE_VERSION */ - int memory_size; /* KB */ + int memory_size; /* Bytes */ } AthrillExDeviceHeaderType;