Commit be6baaf4 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU: removed unused entries; moved ML helpers to a different GPIO range.

Old range was not accessible on certain models, such as PowerShots and DIGIC 7.
Old GPIOs are still accepted (debugging existing code from experimental branches is still possible without merging latest qemu).

--HG--
branch : qemu
parent 59a663e69170
......@@ -241,7 +241,8 @@ EOSRegionHandler eos_handlers[] =
{ "DIGIC6", 0xD0000000, 0xDFFFFFFF, eos_handle_digic6, 0 },
{ "DIGIC6", 0xC8100000, 0xC8100FFF, eos_handle_digic6, 1 },
{ "ML helpers", 0xCF123000, 0xCF123EFF, eos_handle_ml_helpers, 0 },
{ "ML helpers", 0xCF123000, 0xCF1230FF, eos_handle_ml_helpers, 0 },
{ "ML helpers", 0xC0123400, 0xC01234FF, eos_handle_ml_helpers, 1 },
};
/* io range access */
......
......@@ -28,15 +28,15 @@ unsigned int eos_handle_ml_helpers ( unsigned int parm, EOSState *s, unsigned in
{
if(type & MODE_WRITE)
{
switch (address)
switch (address & 0xFF)
{
case REG_PRINT_CHAR: /* print in blue */
case REG_PRINT_CHAR & 0xFF: /* print in blue */
{
print_char(value);
return 0;
}
case REG_PRINT_NUM: /* print an int32 from the guest */
case REG_PRINT_NUM & 0xFF: /* print an int32 from the guest */
{
char num[32];
snprintf(num, sizeof(num), "0x%x (%d) ", (uint32_t)value, (uint32_t)value);
......@@ -47,66 +47,11 @@ unsigned int eos_handle_ml_helpers ( unsigned int parm, EOSState *s, unsigned in
return 0;
}
case REG_DISAS_32: /* disassemble address (32-bit, ARM or Thumb) */
case REG_DISAS_32 & 0xFF: /* disassemble address (32-bit, ARM or Thumb) */
fprintf(stderr, KGRN);
target_disas(stderr, CPU(arm_env_get_cpu(&s->cpu0->env)), value & ~1, 4, value & 1);
fprintf(stderr, KRESET);
return 0;
case REG_SHUTDOWN:
fprintf(stderr, "Goodbye!\n");
qemu_system_shutdown_request();
return 0;
case REG_BMP_VRAM:
s->disp.bmp_vram = (uint32_t) value;
return 0;
case REG_IMG_VRAM:
s->disp.img_vram = (uint32_t) value;
if (value)
{
eos_load_image(s, "VRAM/PH-LV/LV-000.422", 0, -1, value, 0);
}
else
{
fprintf(stderr, "Image buffer disabled\n");
}
return 0;
case REG_RAW_BUFF:
s->disp.raw_buff = (uint32_t) value;
if (value)
{
/* fixme: hardcoded strip offset */
eos_load_image(s, "VRAM/PH-LV/RAW-000.DNG", 33792, -1, value, 1);
}
else
{
fprintf(stderr, "Raw buffer disabled\n");
}
return 0;
case REG_DISP_TYPE:
s->disp.type = (uint32_t) value;
return 0;
}
}
else
{
switch (address)
{
case REG_BMP_VRAM:
return s->disp.bmp_vram;
case REG_IMG_VRAM:
return s->disp.img_vram;
case REG_RAW_BUFF:
return s->disp.raw_buff;
case REG_DISP_TYPE:
return s->disp.type;
}
}
......
......@@ -8,16 +8,10 @@
unsigned int eos_handle_ml_helpers ( unsigned int parm, EOSState *s, unsigned int address, unsigned char type, unsigned int value );
/** Some small engio API **/
#define REG_PRINT_CHAR 0xCF123000
#define REG_SHUTDOWN 0xCF123004
#define REG_DUMP_VRAM 0xCF123008
#define REG_PRINT_NUM 0xCF12300C
#define REG_DISAS_32 0xCF123010
#define REG_BMP_VRAM 0xCF123014
#define REG_IMG_VRAM 0xCF123018
#define REG_RAW_BUFF 0xCF12301C
#define REG_DISP_TYPE 0xCF123020
#define REG_CALLSTACK 0xCF123030
#define REG_PRINT_CHAR 0xC0123000
#define REG_PRINT_NUM 0xC012300C
#define REG_DISAS_32 0xC0123010
#define REG_CALLSTACK 0xC0123030
#endif
......@@ -101,7 +101,7 @@ macro define CURRENT_TASK_NAME (((int*)CURRENT_TASK)[0] ? ((char***)CURRENT_TASK
# requires -d callstack, for example:
# ./run_canon_fw 1300D,firmware="boot=0" -d callstack -s -S & arm-none-eabi-gdb -x 1300D/debugmsg.gdb
define print_callstack
set $_ = *0xCF123030
set $_ = *0xC0123430
end
# print current task name and return address
......
......@@ -6,16 +6,10 @@
#include <stdarg.h>
/** Some small engio API **/
#define REG_PRINT_CHAR 0xCF123000
#define REG_SHUTDOWN 0xCF123004
#define REG_DUMP_VRAM 0xCF123008
#define REG_PRINT_NUM 0xCF12300C
#define REG_DISAS_32 0xCF123010
#define REG_BMP_VRAM 0xCF123014
#define REG_IMG_VRAM 0xCF123018
#define REG_RAW_BUFF 0xCF12301C
#define REG_DISP_TYPE 0xCF123020
#define REG_CALLSTACK 0xCF123030
#define REG_PRINT_CHAR 0xC0123400
#define REG_PRINT_NUM 0xC012340C
#define REG_DISAS_32 0xC0123410
#define REG_CALLSTACK 0xC0123430
/**
* The following functions will print to QEMU console only when compiling
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment