-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdated-Legacy-code-in-arm-edb7312.patch
155 lines (138 loc) · 5.06 KB
/
Updated-Legacy-code-in-arm-edb7312.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
From 893d66937a17c4bb9fb3b909cf884948b466a3b5 Mon Sep 17 00:00:00 2001
From: Vipul Nayyar <[email protected]>
Date: Wed, 10 Jul 2013 09:52:28 -0500
Subject: [PATCH] Updated Legacy code in arm edb7312
---
c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c | 49 +++++++++++---------------
c/src/lib/libbsp/arm/edb7312/network/network.c | 27 +++++++++-----
2 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c b/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
index bd77dd6..af0448ff7 100644
--- a/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
+++ b/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
@@ -12,24 +12,14 @@
#include <ep7312.h>
#include <bsp.h>
#include <bsp/irq.h>
+#include <assert.h>
#if ON_SKYEYE==1
#define CLOCK_DRIVER_USE_FAST_IDLE
#endif
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_TC1OI,
- .hdl = Clock_isr,
- .handle = NULL,
- .on = clock_isr_on,
- .off = clock_isr_off,
- .isOn = clock_isr_is_on,
-};
+uint32_t clock_driver_get_nanoseconds_since_last_tick(void);
#define Clock_driver_support_at_tick() \
do { \
@@ -38,8 +28,16 @@ rtems_irq_connect_data clock_isr_data = {
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
+ rtems_status_code status = RTEMS_SUCCESSFUL; \
(_old) = NULL; /* avoid warning */; \
- BSP_install_rtems_irq_handler(&clock_isr_data); \
+ status = rtems_interrupt_handler_install( \
+ BSP_TC1OI, \
+ "Clock", \
+ RTEMS_INTERRUPT_UNIQUE, \
+ Clock_isr, \
+ NULL \
+ ); \
+ assert(status == RTEMS_SUCCESSFUL); \
} while(0)
/*
@@ -60,9 +58,15 @@ rtems_irq_connect_data clock_isr_data = {
*EP7312_TC1EOI = 0xFFFFFFFF; \
} 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_TC1OI, \
+ Clock_isr, \
+ NULL \
+ ); \
+ assert(status == RTEMS_SUCCESSFUL); \
} while (0)
/**
@@ -76,17 +80,4 @@ uint32_t clock_driver_get_nanoseconds_since_last_tick(void)
#define Clock_driver_nanoseconds_since_last_tick \
clock_driver_get_nanoseconds_since_last_tick
-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)
-{
- return 1;
-}
-
#include "../../../shared/clockdrv_shell.h"
diff --git a/c/src/lib/libbsp/arm/edb7312/network/network.c b/c/src/lib/libbsp/arm/edb7312/network/network.c
index 1db4d02..ce139ec 100644
--- a/c/src/lib/libbsp/arm/edb7312/network/network.c
+++ b/c/src/lib/libbsp/arm/edb7312/network/network.c
@@ -2,18 +2,13 @@
#include <sys/mbuf.h>
#include <bsp/irq.h>
#include <libchip/cs8900.h>
+#include <assert.h>
#define CS8900_BASE 0x20000300
unsigned int bsp_cs8900_io_base = 0;
unsigned int bsp_cs8900_memory_base = 0;
cs8900_device *g_cs;
void cs8900_isr(rtems_irq_hdl_param unused);
-rtems_irq_connect_data cs8900_isr_data = {BSP_EINT3,
- cs8900_isr,
- NULL,
- NULL,
- NULL,
- NULL};
char g_enetbuf[1520];
@@ -68,13 +63,29 @@ unsigned short cs8900_mem_get_reg (cs8900_device *cs, unsigned long reg)
void cs8900_attach_interrupt (cs8900_device *cs)
{
+ rtems_status_code status = RTEMS_SUCCESSFUL;
g_cs = cs;
- BSP_install_rtems_irq_handler(&cs8900_isr_data);
+
+ status = rtems_interrupt_handler_install(
+ BSP_EINT3,
+ "Network",
+ RTEMS_INTERRUPT_UNIQUE,
+ cs8900_isr,
+ NULL
+ );
+ assert(status == RTEMS_SUCCESSFUL);
}
void cs8900_detach_interrupt (cs8900_device *cs)
{
- BSP_remove_rtems_irq_handler(&cs8900_isr_data);
+ rtems_status_code status = RTEMS_SUCCESSFUL;
+
+ status = rtems_interrupt_handler_remove(
+ BSP_EINT3,
+ cs8900_isr,
+ NULL
+ );
+ assert(status == RTEMS_SUCCESSFUL);
}
unsigned short cs8900_get_data_block (cs8900_device *cs, unsigned char *data)
--
1.7.11.7