[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/13] hw/timer/allwinner: Move definitions from header to source
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 04/13] hw/timer/allwinner: Move definitions from header to source |
Date: |
Thu, 19 Dec 2019 19:51:18 +0100 |
These definitions are only used in the implementation, thus don't
need to be exported. Move them in the source file.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/timer/allwinner-a10-pit.h | 28 --------------------------
hw/timer/allwinner-a10-pit.c | 30 ++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/include/hw/timer/allwinner-a10-pit.h
b/include/hw/timer/allwinner-a10-pit.h
index e4a644add9..c28ee5ca47 100644
--- a/include/hw/timer/allwinner-a10-pit.h
+++ b/include/hw/timer/allwinner-a10-pit.h
@@ -5,37 +5,9 @@
#include "hw/sysbus.h"
#define TYPE_AW_A10_PIT "allwinner-A10-timer"
-#define AW_A10_PIT(obj) OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT)
#define AW_PIT_TIMER_MAX 6
-#define AW_A10_PIT_TIMER_NR 6
-
-#define AW_A10_PIT_TIMER_IRQ_EN 0
-#define AW_A10_PIT_TIMER_IRQ_ST 0x4
-
-#define AW_A10_PIT_TIMER_CONTROL 0x0
-#define AW_A10_PIT_TIMER_EN 0x1
-#define AW_A10_PIT_TIMER_RELOAD 0x2
-#define AW_A10_PIT_TIMER_MODE 0x80
-
-#define AW_A10_PIT_TIMER_INTERVAL 0x4
-#define AW_A10_PIT_TIMER_COUNT 0x8
-#define AW_A10_PIT_WDOG_CONTROL 0x90
-#define AW_A10_PIT_WDOG_MODE 0x94
-
-#define AW_A10_PIT_COUNT_CTL 0xa0
-#define AW_A10_PIT_COUNT_RL_EN 0x2
-#define AW_A10_PIT_COUNT_CLR_EN 0x1
-#define AW_A10_PIT_COUNT_LO 0xa4
-#define AW_A10_PIT_COUNT_HI 0xa8
-
-#define AW_A10_PIT_TIMER_BASE 0x10
-#define AW_A10_PIT_TIMER_BASE_END \
- (AW_A10_PIT_TIMER_BASE * AW_A10_PIT_TIMER_NR + AW_A10_PIT_TIMER_COUNT)
-
-#define AW_A10_PIT_DEFAULT_CLOCK 0x4
-
typedef struct AwA10PITState AwA10PITState;
typedef struct AwA10TimerContext {
diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c
index b31a0bcd43..00f7cc492d 100644
--- a/hw/timer/allwinner-a10-pit.c
+++ b/hw/timer/allwinner-a10-pit.c
@@ -24,6 +24,36 @@
#include "qemu/log.h"
#include "qemu/module.h"
+#define AW_A10_PIT_TIMER_NR 6
+
+#define AW_A10_PIT_TIMER_IRQ_EN 0
+#define AW_A10_PIT_TIMER_IRQ_ST 0x4
+
+#define AW_A10_PIT_TIMER_CONTROL 0x0
+#define AW_A10_PIT_TIMER_EN 0x1
+#define AW_A10_PIT_TIMER_RELOAD 0x2
+#define AW_A10_PIT_TIMER_MODE 0x80
+
+#define AW_A10_PIT_TIMER_INTERVAL 0x4
+#define AW_A10_PIT_TIMER_COUNT 0x8
+#define AW_A10_PIT_WDOG_CONTROL 0x90
+#define AW_A10_PIT_WDOG_MODE 0x94
+
+#define AW_A10_PIT_COUNT_CTL 0xa0
+#define AW_A10_PIT_COUNT_RL_EN 0x2
+#define AW_A10_PIT_COUNT_CLR_EN 0x1
+#define AW_A10_PIT_COUNT_LO 0xa4
+#define AW_A10_PIT_COUNT_HI 0xa8
+
+#define AW_A10_PIT_TIMER_BASE 0x10
+#define AW_A10_PIT_TIMER_BASE_END \
+ (AW_A10_PIT_TIMER_BASE * AW_A10_PIT_TIMER_NR + AW_A10_PIT_TIMER_COUNT)
+
+#define AW_A10_PIT_DEFAULT_CLOCK 0x4
+
+#define AW_A10_PIT(obj) \
+ OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT)
+
static void a10_pit_update_irq(AwA10PITState *s)
{
int i;
--
2.21.0
- [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 03/13] hw/timer/allwinner: Remove unused definitions, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 02/13] hw/timer/allwinner: Add AW_PIT_TIMER_MAX definition, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 04/13] hw/timer/allwinner: Move definitions from header to source,
Philippe Mathieu-Daudé <=
- [RFC PATCH 05/13] hw/timer/allwinner: Rename the ptimer field, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 06/13] hw/timer/allwinner: Rename 'timer_context' as 'timer', Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 07/13] hw/timer/allwinner: Move timer specific fields into AwA10TimerContext, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 08/13] hw/timer/allwinner: Add a timer_count field, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 09/13] hw/timer/allwinner: Rename AwA10TimerContext as AllwinnerTmrState, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 10/13] hw/timer/allwinner: Rename AwA10PITState as AllwinnerTmrCtrlState, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 11/13] hw/timer/allwinner: Introduce TYPE_AW_COMMON_PIT abstract device, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 12/13] hw/timer/allwinner: Rename AW_A10_PIT() as AW_TIMER_CTRL(), Philippe Mathieu-Daudé, 2019/12/19