diff --git a/include/uc_priv.h b/include/uc_priv.h index df22a50c..ccb72d56 100644 --- a/include/uc_priv.h +++ b/include/uc_priv.h @@ -13,7 +13,7 @@ // These are masks of supported modes for each cpu/arch. // They should be updated when changes are made to the uc_mode enum typedef. -#define UC_MODE_ARM_MASK (UC_MODE_ARM|UC_MODE_THUMB|UC_MODE_LITTLE_ENDIAN) +#define UC_MODE_ARM_MASK (UC_MODE_ARM|UC_MODE_THUMB|UC_MODE_LITTLE_ENDIAN|UC_MODE_MCLASS) #define UC_MODE_MIPS_MASK (UC_MODE_MIPS32|UC_MODE_MIPS64|UC_MODE_LITTLE_ENDIAN|UC_MODE_BIG_ENDIAN) #define UC_MODE_X86_MASK (UC_MODE_16|UC_MODE_32|UC_MODE_64|UC_MODE_LITTLE_ENDIAN) #define UC_MODE_PPC_MASK (UC_MODE_PPC64|UC_MODE_BIG_ENDIAN) diff --git a/qemu/hw/arm/tosa.c b/qemu/hw/arm/tosa.c index 607878ac..f6649f45 100644 --- a/qemu/hw/arm/tosa.c +++ b/qemu/hw/arm/tosa.c @@ -19,8 +19,11 @@ static int tosa_init(struct uc_struct *uc, MachineState *machine) { - //cpu_arm_init(uc, "pxa255"); - uc->cpu = (CPUState *)cpu_arm_init(uc, "cortex-a15"); // FIXME + if (uc->mode & UC_MODE_MCLASS) { + uc->cpu = (CPUState *)cpu_arm_init(uc, "cortex-m3"); + } else { + uc->cpu = (CPUState *)cpu_arm_init(uc, "cortex-a15"); + } return 0; } diff --git a/windows_export.bat b/windows_export.bat index 4ff67fba..ebed5106 100644 --- a/windows_export.bat +++ b/windows_export.bat @@ -1,16 +1,16 @@ @echo on -:: This script invokes the visual studio linker to construct a static library file that can be used outside of mingw. -:: The unicorn.def file that it references below is produced by the mingw compiler via a linker flag. +:: This script invokes the Visual Studio linker to construct a static library file that can be used outside of Mingw. +:: The unicorn.def file that it references below is produced by the Mingw compiler via a linker flag. :: The arch (x86 or x64) we are working on should be passed via the first argument to this script. :: Look up the Visual Studio install path via the registry :: http://stackoverflow.com/questions/445167/how-can-i-get-the-value-of-a-registry-key-from-within-a-batch-script -:: If anyone ever tells you that windows is a reasonable operating system, they are wrong +:: If anyone ever tells you that Windows is a reasonable operating system, they are wrong FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0" /v InstallDir`) DO ( set appdir=%%A %%B ) -:: Add the visual studio binaries to our path and run the linker +:: Add the Visual Studio binaries to our path and run the linker call "%appdir%..\..\VC\vcvarsall.bat" %1 call lib /machine:%1 /def:unicorn.def