[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH rc3 02/30] target/avr: Introduce AVR CPU class object
From: |
Aleksandar Markovic |
Subject: |
Re: [PATCH rc3 02/30] target/avr: Introduce AVR CPU class object |
Date: |
Mon, 27 Jan 2020 09:43:22 +0100 |
09:03 Pon, 27.01.2020. Philippe Mathieu-Daudé <address@hidden> је написао/ла:
>
> On 1/27/20 3:39 AM, Aleksandar Markovic wrote:
> >> +static void avr_cpu_initfn(Object *obj)
> >> +{
> >> + AVRCPU *cpu = AVR_CPU(obj);
> >> +
> >> + cpu_set_cpustate_pointers(cpu);
> >> +
> >> +#ifndef CONFIG_USER_ONLY
> >> + /* Set the number of interrupts supported by the CPU. */
> >> + qdev_init_gpio_in(DEVICE(cpu), avr_cpu_set_int,
> >> + sizeof(cpu->env.intsrc) * 8);
> >> +#endif
> >> +}
> >
> > A question for Michael:
> >
> > What is CONFIG_USER_ONLY doing here, if we know AVR cores from this
> > series doesn't have and will never have user mode, since they do not
> > work with the kernel?
> >
> > Do you plan to support some AVR 32-bit CPUs in the same file, which
> > would be able to have linux-user mode? But, in this case, many files
> > must be completely redone. My advice is to separate them completely,
> > and that this file supports only 8-bit AVR cores, and in that case
> > checks for CONFIG_USER_ONLY do not make sense.
>
> You are right, CONFIG_USER_ONLY doesn't make sense.
>
> Suggestion: add in target/avr/cpu.h:
>
> #ifdef CONFIG_USER_ONLY
> #error "AVR 8-bit does not support user mode"
> #endif
>
I agree with your suggestion, in fact, it is an excellent one.
- [PATCH rc3 06/30] target/avr: Add defintions of AVR core types, (continued)
- [PATCH rc3 06/30] target/avr: Add defintions of AVR core types, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 12/30] target/avr: Add instruction translation - Bit and Bit-test Instructions, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 14/30] target/avr: Add instruction translation - CPU main translation function, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 09/30] target/avr: Add instruction translation - Arithmetic and Logic Instructions, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 10/30] target/avr: Add instruction translation - Branch Instructions, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 03/30] target/avr: Add migration support, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 04/30] target/avr: Add GDB support, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 02/30] target/avr: Introduce AVR CPU class object, Aleksandar Markovic, 2020/01/26
- Re: [PATCH rc3 02/30] target/avr: Introduce AVR CPU class object, Sarah Harris, 2020/01/29
[PATCH rc3 11/30] target/avr: Add instruction translation - Data Transfer Instructions, Aleksandar Markovic, 2020/01/26
[PATCH rc3 13/30] target/avr: Add instruction translation - MCU Control Instructions, Aleksandar Markovic, 2020/01/26
[PATCH rc3 21/30] target/avr: Add machine none test, Aleksandar Markovic, 2020/01/26
[PATCH rc3 18/30] hw/misc: Add Atmel power device, Aleksandar Markovic, 2020/01/26
[PATCH rc3 24/30] hw/avr: Add helper to load raw/ELF firmware binaries, Aleksandar Markovic, 2020/01/26