logo       

Re: [Adeos-main] [PATCH] let ipipe_catch_event return old handler: msg#00185

linux.real-time.xenomai.devel

Subject: Re: [Adeos-main] [PATCH] let ipipe_catch_event return old handler

Jan Kiszka wrote:
Philippe Gerum wrote:

Jan Kiszka wrote:

<snip>

Don't you mean this instead?


-int ipipe_catch_event(struct ipipe_domain *ipd,
- unsigned event,
- int (*handler)(unsigned event, struct ipipe_domain
*ipd, void *data))
+ipipe_event_handler_t ipipe_catch_event(struct ipipe_domain *ipd,
+ unsigned event,
+ ipipe_event_handler_t handler)
{

+ ipipe_event_handler_t old_handler;

int self = 0;

@@ -278,7 +278,7 @@
}

if (event >= IPIPE_NR_EVENTS)
- return -EINVAL;
+ return NULL;


- if (!xchg(&ipd->evhand[event],handler)) {
+ if (!(old_handler = xchg(&ipd->evhand[event],handler))) {

if (handler) {
@@ -301,7 +301,7 @@
ipd->evself |= (1LL << event);
}

- return 0;
+ return handler;

- return handler;
+ return old_handler;

}

cpumask_t ipipe_set_irq_affinity (unsigned irq, cpumask_t cpumask)




Ouch, obviously. A quick hack which was only tested for not breaking
existing software.


Ok, will merge. Thanks.

--

Philippe.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise