mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-13 22:23:45 +00:00
lxip: implement more needed functions
- rtnl_notify() - round_jiffies() - round_jiffies_relative() - round_jiffies_up() - schedule_delayed_work() Fixes #2261
This commit is contained in:
parent
8fcfcbce0e
commit
c5b58a2df4
@ -175,7 +175,6 @@ DUMMY_SKIP(-1, wake_up)
|
||||
DUMMY_SKIP(-1, rtmsg_ifinfo)
|
||||
DUMMY_RET(0, rtnl_is_locked)
|
||||
DUMMY_SKIP(-1, rtnl_lock)
|
||||
DUMMY(-1, rtnl_notify)
|
||||
DUMMY(-1, rtnl_set_sk_err)
|
||||
DUMMY_SKIP(-1, rtnl_unlock)
|
||||
DUMMY_RET(0, rtnetlink_put_metrics)
|
||||
@ -401,14 +400,10 @@ DUMMY(-1, release_net)
|
||||
DUMMY(-1, remove_proc_entry)
|
||||
DUMMY(-1, remove_wait_queue)
|
||||
DUMMY(-1, request_module)
|
||||
DUMMY(-1, round_jiffies)
|
||||
DUMMY(-1, round_jiffies_relative)
|
||||
DUMMY(-1, round_jiffies_up)
|
||||
DUMMY(-1, rt_genid_bump)
|
||||
DUMMY(-1, rtnetlink_init)
|
||||
DUMMY(-1, __rtnl_unlock)
|
||||
DUMMY_STOP(-1, schedule)
|
||||
DUMMY_STOP(-1, schedule_delayed_work)
|
||||
DUMMY_STOP(-1, schedule_timeout_interruptible)
|
||||
DUMMY_STOP(-1, schedule_work)
|
||||
DUMMY(-1, scm_destroy)
|
||||
|
@ -1022,7 +1022,7 @@ void setup_timer(struct timer_list *timer,void (*function)(unsigned long),
|
||||
int timer_pending(const struct timer_list * timer);
|
||||
int del_timer(struct timer_list *timer);
|
||||
void timer_stats_timer_clear_start_info(struct timer_list *);
|
||||
long round_jiffies_relative(unsigned long);
|
||||
unsigned long round_jiffies_relative(unsigned long);
|
||||
|
||||
unsigned long round_jiffies(unsigned long);
|
||||
unsigned long round_jiffies_up(unsigned long);
|
||||
|
@ -161,6 +161,12 @@ struct netdev_queue *dev_ingress_queue(struct net_device *dev)
|
||||
return dev->ingress_queue;
|
||||
}
|
||||
|
||||
void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
|
||||
struct nlmsghdr *nlh, gfp_t flags)
|
||||
{
|
||||
nlmsg_free(skb);
|
||||
}
|
||||
|
||||
|
||||
/****************
|
||||
** linux/ip.h **
|
||||
|
@ -718,3 +718,54 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int schedule_delayed_work(struct delayed_work *dwork, unsigned long delay)
|
||||
{
|
||||
return mod_delayed_work(0, dwork, delay);
|
||||
}
|
||||
|
||||
|
||||
/*******************
|
||||
** linux/timer.h **
|
||||
*******************/
|
||||
|
||||
static unsigned long round_jiffies(unsigned long j, bool force_up)
|
||||
{
|
||||
unsigned remainder = j % HZ;
|
||||
|
||||
/*
|
||||
* from timer.c
|
||||
*
|
||||
* If the target jiffie is just after a whole second (which can happen
|
||||
* due to delays of the timer irq, long irq off times etc etc) then
|
||||
* we should round down to the whole second, not up. Use 1/4th second
|
||||
* as cutoff for this rounding as an extreme upper bound for this.
|
||||
* But never round down if @force_up is set.
|
||||
*/
|
||||
|
||||
/* per default round down */
|
||||
j = j - remainder;
|
||||
|
||||
/* round up if remainder more than 1/4 second (or if we're forced to) */
|
||||
if (remainder >= HZ/4 || force_up)
|
||||
j += HZ;
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
unsigned long round_jiffies(unsigned long j)
|
||||
{
|
||||
return round_jiffies(j, false);
|
||||
}
|
||||
|
||||
|
||||
unsigned long round_jiffies_up(unsigned long j)
|
||||
{
|
||||
return round_jiffies(j, true);
|
||||
}
|
||||
|
||||
|
||||
unsigned long round_jiffies_relative(unsigned long j)
|
||||
{
|
||||
return round_jiffies(j + jiffies, false) - jiffies;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user