register a periodic timer; * ret: <0 on error * Hint: if you need it in a module, register it from mod_init or it * won't work otherwise*/
| 249 | * Hint: if you need it in a module, register it from mod_init or it |
| 250 | * won't work otherwise*/ |
| 251 | int register_timer(char *label, timer_function f, void* param, |
| 252 | unsigned int interval, unsigned short flags) |
| 253 | { |
| 254 | struct os_timer* t; |
| 255 | |
| 256 | flags = flags & (~TIMER_FLAG_IS_UTIMER); /* just to be sure */ |
| 257 | t = new_os_timer( label, flags, f, param, interval); |
| 258 | if (t==NULL) |
| 259 | return E_OUT_OF_MEM; |
| 260 | /* insert it into the timer list*/ |
| 261 | t->next = timer_list; |
| 262 | timer_list = t; |
| 263 | return t->id; |
| 264 | } |
| 265 | |
| 266 | |
| 267 | int register_utimer(char *label, utimer_function f, void* param, |
no test coverage detected