forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/xen/events/events_fifo.c
....@@ -82,7 +82,7 @@
8282
8383 #endif
8484
85
-static inline event_word_t *event_word_from_port(unsigned port)
85
+static inline event_word_t *event_word_from_port(evtchn_port_t port)
8686 {
8787 unsigned i = port / EVENT_WORDS_PER_PAGE;
8888
....@@ -138,9 +138,8 @@
138138 array_page[i] = 1 << EVTCHN_FIFO_MASKED;
139139 }
140140
141
-static int evtchn_fifo_setup(struct irq_info *info)
141
+static int evtchn_fifo_setup(evtchn_port_t port)
142142 {
143
- unsigned port = info->evtchn;
144143 unsigned new_array_pages;
145144 int ret;
146145
....@@ -186,36 +185,37 @@
186185 return ret;
187186 }
188187
189
-static void evtchn_fifo_bind_to_cpu(struct irq_info *info, unsigned cpu)
188
+static void evtchn_fifo_bind_to_cpu(evtchn_port_t evtchn, unsigned int cpu,
189
+ unsigned int old_cpu)
190190 {
191191 /* no-op */
192192 }
193193
194
-static void evtchn_fifo_clear_pending(unsigned port)
194
+static void evtchn_fifo_clear_pending(evtchn_port_t port)
195195 {
196196 event_word_t *word = event_word_from_port(port);
197197 sync_clear_bit(EVTCHN_FIFO_BIT(PENDING, word), BM(word));
198198 }
199199
200
-static void evtchn_fifo_set_pending(unsigned port)
200
+static void evtchn_fifo_set_pending(evtchn_port_t port)
201201 {
202202 event_word_t *word = event_word_from_port(port);
203203 sync_set_bit(EVTCHN_FIFO_BIT(PENDING, word), BM(word));
204204 }
205205
206
-static bool evtchn_fifo_is_pending(unsigned port)
206
+static bool evtchn_fifo_is_pending(evtchn_port_t port)
207207 {
208208 event_word_t *word = event_word_from_port(port);
209209 return sync_test_bit(EVTCHN_FIFO_BIT(PENDING, word), BM(word));
210210 }
211211
212
-static void evtchn_fifo_mask(unsigned port)
212
+static void evtchn_fifo_mask(evtchn_port_t port)
213213 {
214214 event_word_t *word = event_word_from_port(port);
215215 sync_set_bit(EVTCHN_FIFO_BIT(MASKED, word), BM(word));
216216 }
217217
218
-static bool evtchn_fifo_is_masked(unsigned port)
218
+static bool evtchn_fifo_is_masked(evtchn_port_t port)
219219 {
220220 event_word_t *word = event_word_from_port(port);
221221 return sync_test_bit(EVTCHN_FIFO_BIT(MASKED, word), BM(word));
....@@ -231,6 +231,9 @@
231231 w = *word;
232232
233233 do {
234
+ if (!(w & (1 << EVTCHN_FIFO_MASKED)))
235
+ return true;
236
+
234237 if (w & (1 << EVTCHN_FIFO_PENDING))
235238 return false;
236239
....@@ -242,7 +245,7 @@
242245 return true;
243246 }
244247
245
-static void evtchn_fifo_unmask(unsigned port)
248
+static void evtchn_fifo_unmask(evtchn_port_t port)
246249 {
247250 event_word_t *word = event_word_from_port(port);
248251
....@@ -275,7 +278,7 @@
275278 {
276279 struct evtchn_fifo_queue *q = &per_cpu(cpu_queue, cpu);
277280 uint32_t head;
278
- unsigned port;
281
+ evtchn_port_t port;
279282 event_word_t *word;
280283
281284 head = q->head[priority];