-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdated-Legacy-code-in-arm-gba.patch
106 lines (95 loc) · 3.32 KB
/
Updated-Legacy-code-in-arm-gba.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From 9b6add418c0fefba50f7360453d4ca93a1379968 Mon Sep 17 00:00:00 2001
From: Vipul Nayyar <[email protected]>
Date: Fri, 12 Jul 2013 17:04:17 +0530
Subject: [PATCH] Updated Legacy code in arm gba
---
c/src/lib/libbsp/arm/gba/clock/clockdrv.c | 68 +++++++++----------------------
1 file changed, 20 insertions(+), 48 deletions(-)
diff --git a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
index ea9c539..1217892 100644
--- a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
+++ b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
@@ -18,33 +18,36 @@
#include <bsp.h>
#include <bsp/irq.h>
#include <gba.h>
+#include <assert.h>
-void Clock_isr(rtems_irq_hdl_param arg);
-static void clock_isr_on(const rtems_irq_connect_data *unused);
-static void clock_isr_off(const rtems_irq_connect_data *unused);
-static int clock_isr_is_on(const rtems_irq_connect_data *irq);
-
-rtems_irq_connect_data clock_isr_data = {
- .name = BSP_IRQ_TIMER3,
- .hdl = Clock_isr,
- .handle = NULL,
- .on = clock_isr_on,
- .off = clock_isr_off,
- .isOn = clock_isr_is_on,
-};
+void Clock_isr(void * arg);
#define Clock_driver_support_at_tick()
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
- BSP_install_rtems_irq_handler(&clock_isr_data); \
+ rtems_status_code status = RTEMS_SUCCESSFUL; \
+ status = rtems_interrupt_handler_install( \
+ BSP_IRQ_TIMER3, \
+ "Clock", \
+ RTEMS_INTERRUPT_UNIQUE, \
+ Clock_isr, \
+ NULL \
+ ); \
+ assert(status == RTEMS_SUCCESSFUL); \
_old = NULL; \
} while(0)
-#define Clock_driver_support_shutdown_hardware() \
- do { \
- BSP_remove_rtems_irq_handler(&clock_isr_data); \
+#define Clock_driver_support_shutdown_hardware() \
+ do { \
+ rtems_status_code status = RTEMS_SUCCESSFUL; \
+ status = rtems_interrupt_handler_remove( \
+ BSP_IRQ_TIMER3, \
+ Clock_isr, \
+ NULL \
+ ); \
+ assert(status == RTEMS_SUCCESSFUL); \
} while (0)
@@ -86,35 +89,4 @@ void Clock_driver_support_initialize_hardware(void)
GBA_REG_TM3CNT = (0x00c0|GBA_TMCNT_PS);
}
-/**
- * @brief This function is empty
- *
- * @param unused an unused parameter
- * @return None
- */
-static void clock_isr_on(const rtems_irq_connect_data *unused)
-{
-}
-
-/**
- * @brief This function is empty
- *
- * @param unused an unused parameter
- * @return None
- */
-static void clock_isr_off(const rtems_irq_connect_data *unused)
-{
-}
-
-/**
- * @brief This function is empty
- *
- * @param irq unused
- * @return constant 1
- */
-static int clock_isr_is_on(const rtems_irq_connect_data *irq)
-{
- return 1;
-}
-
#include "../../../shared/clockdrv_shell.h"
--
1.7.11.7