qemu-devel
[Top][All Lists]
Advanced

[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: Philippe Mathieu-Daudé
Subject: Re: [PATCH rc3 02/30] target/avr: Introduce AVR CPU class object
Date: Mon, 27 Jan 2020 09:03:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]