mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 23:28:29 +00:00
usb: fix regression in setup_timer
introduced by update to 4.16.3. Fixes page faults in OHCI USB driver part. Issue #2963
This commit is contained in:
committed by
Norman Feske
parent
2049498af0
commit
dbb37607c5
@ -622,6 +622,10 @@ ktime_t ktime_mono_to_real(ktime_t mono);
|
|||||||
#define from_timer(var, callback_timer, timer_fieldname) \
|
#define from_timer(var, callback_timer, timer_fieldname) \
|
||||||
container_of(callback_timer, typeof(*var), timer_fieldname)
|
container_of(callback_timer, typeof(*var), timer_fieldname)
|
||||||
|
|
||||||
|
void setup_timer(struct timer_list *timer, void (*function)(unsigned long),
|
||||||
|
unsigned long data);
|
||||||
|
void init_timer(struct timer_list *);
|
||||||
|
void set_timer_slack(struct timer_list *, int);
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
** linux/delay.h **
|
** linux/delay.h **
|
||||||
|
@ -1127,10 +1127,24 @@ int hex2bin(u8 *dst, const char *src, size_t count)
|
|||||||
|
|
||||||
extern "C" void init_timer(struct timer_list *) { }
|
extern "C" void init_timer(struct timer_list *) { }
|
||||||
|
|
||||||
|
struct callback_timer {
|
||||||
|
void (*function)(unsigned long);
|
||||||
|
unsigned long data;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void timer_callback(struct timer_list *t)
|
||||||
|
{
|
||||||
|
struct callback_timer * tc = (struct callback_timer *)t->data;
|
||||||
|
tc->function(tc->data);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" void setup_timer(struct timer_list *timer, void (*function)(unsigned long),
|
extern "C" void setup_timer(struct timer_list *timer, void (*function)(unsigned long),
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
timer_setup(timer, function, 0u);
|
callback_timer * tc = new (Lx::Malloc::mem()) callback_timer;
|
||||||
timer->data = data;
|
tc->function = function;
|
||||||
|
tc->data = data;
|
||||||
|
|
||||||
|
timer_setup(timer, timer_callback, 0u);
|
||||||
|
timer->data = (unsigned long)tc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user