On 04/28/2017 07:09 AM, Peter Maydell wrote: > On 28 April 2017 at 01:10, Wei Huang <w...@redhat.com> wrote: >> In our downstream code, we try to minimize the number of supported >> devices to reduce the maintenance effort. ARM v7M is not in the >> supported list. >> >> For most unsupported devices, we can remove them by configuring >> default-configs file, except for CONFIG_ARM_V7M=y. This is because the >> ARMv7m code in target/arm/helper.c intertwines with NVIC code. As a >> result we have to keep NVIC and SysTick in order to compile helper.c, >> which is not desirable. >> >> This patchset tries to address the problem by making NVIC and SysTick >> removable. > > I think that's the wrong way to do it. If you want to not compile > in ARMv7M support then you need more ifdeffery in the target/arm > code to disable the v7M code and CPUs entirely. NVIC and systick
We do disable most CPUs, which means only a limited number of CPUs (host, cortex-a15, cortex-53/57) are left. Using #ifdef is indeed a cleaner solution. However I can't use "#ifdef CONFIG_ARM_V7M" & co inside target/arm/cpu.c file because CONFIG_xxx aren't available as preprocessor directives. From what I saw the CONFIG_xxx options can only control compiling source file. One solution is to extract out all v7M code into separate files and use CONFIG_ARM_V7M to direct compilation. A bit messy though. Any other suggestions? > are required core parts of v7M CPUs and so if they are not > present then QEMU will claim to support the v7M cores but not > in fact correctly do so. > > thanks > -- PMM >