mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
armv7m: Split systick out from NVIC
The SysTick timer isn't really part of the NVIC proper; we just modelled it that way back when we couldn't easily have devices that only occupied a small chunk of a memory region. Split it out into its own device. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1487604965-23220-10-git-send-email-peter.maydell@linaro.org Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
743eb70560
commit
ff68dacbc7
6 changed files with 318 additions and 133 deletions
34
include/hw/timer/armv7m_systick.h
Normal file
34
include/hw/timer/armv7m_systick.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* ARMv7M SysTick timer
|
||||
*
|
||||
* Copyright (c) 2006-2007 CodeSourcery.
|
||||
* Written by Paul Brook
|
||||
* Copyright (c) 2017 Linaro Ltd
|
||||
* Written by Peter Maydell
|
||||
*
|
||||
* This code is licensed under the GPL (version 2 or later).
|
||||
*/
|
||||
|
||||
#ifndef HW_TIMER_ARMV7M_SYSTICK_H
|
||||
#define HW_TIMER_ARMV7M_SYSTICK_H
|
||||
|
||||
#include "hw/sysbus.h"
|
||||
|
||||
#define TYPE_SYSTICK "armv7m_systick"
|
||||
|
||||
#define SYSTICK(obj) OBJECT_CHECK(SysTickState, (obj), TYPE_SYSTICK)
|
||||
|
||||
typedef struct SysTickState {
|
||||
/*< private >*/
|
||||
SysBusDevice parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
uint32_t control;
|
||||
uint32_t reload;
|
||||
int64_t tick;
|
||||
QEMUTimer *timer;
|
||||
MemoryRegion iomem;
|
||||
qemu_irq irq;
|
||||
} SysTickState;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue