qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] armv7-m: exit on external reset request


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] armv7-m: exit on external reset request
Date: Fri, 9 Oct 2015 17:59:06 +0100

On 8 October 2015 at 16:40, Michael Davidsaver <address@hidden> wrote:
> Signed-off-by: Michael Davidsaver <address@hidden>
> ---
>  hw/intc/armv7m_nvic.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index 3ec8408..a671d84 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -15,6 +15,7 @@
>  #include "hw/arm/arm.h"
>  #include "exec/address-spaces.h"
>  #include "gic_internal.h"
> +#include "sysemu/sysemu.h"
>
>  typedef struct {
>      GICState gic;
> @@ -348,10 +349,13 @@ static void nvic_writel(nvic_state *s, uint32_t offset, 
> uint32_t value)
>          break;
>      case 0xd0c: /* Application Interrupt/Reset Control.  */
>          if ((value >> 16) == 0x05fa) {
> +            if (value & 4) {
> +                qemu_system_reset_request();
> +            }
>              if (value & 2) {
>                  qemu_log_mask(LOG_UNIMP, "VECTCLRACTIVE unimplemented\n");
>              }
> -            if (value & 5) {
> +            if (value & 1) {
>                  qemu_log_mask(LOG_UNIMP, "AIRCR system reset 
> unimplemented\n");
>              }
>              if (value & 0x700) {

Strictly speaking what this bit does is assert a signal out of
the CPU to some external power management or similar device
in the SoC, which then is responsible for doing the reset.
So just calling qemu_system_reset_request() here is a bit of
a shortcut. But maybe it's a pragmatic shortcut?

thanks
-- PMM



reply via email to

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