Function report | 
Source Code:kernel\time\posix-cpu-timers.c | 
Create Date:2022-07-28 10:47:48 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Guts of sys_timer_settime for CPU timers.* This is called with the timer locked and interrupts disabled.* If we return TIMER_RETRY, it's necessary to release the timer's lock* and try again. (This happens when the timer is in the middle of firing.)
Proto:static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, struct itimerspec64 *new, struct itimerspec64 *old)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct k_itimer * | timer | |
| int | timer_flags | |
| struct itimerspec64 * | new | |
| struct itimerspec64 * | old | 
| 564 | clkid = CPUCLOCK_WHICH(it_clock) | 
| 570 | ret = 0 | 
| 572 | If WARN_ON_ONCE(!p) Then Return -EINVAL | 
| 585 | sighand = lock_task_sighand(p, & flags) | 
| 590 | If Value for the false possibility is greater at compile time(sighand == NULL) Then Return -ESRCH | 
| 596 | old_incr = it_interval | 
| 597 | old_expires = cpu_timer_getexpires(ctmr) | 
| 600 | firing = -1 | 
| 602 | Else | 
| 603 | cpu_timer_dequeue(ctmr) | 
| 614 | If CPUCLOCK_PERTHREAD(it_clock) Then val = Sample a per-thread clock for the given task. clkid is validated. | 
| 619 | If old Then | 
| 620 | If old_expires == 0 Then | 
| 621 | seconds = 0 | 
| 622 | nanoseconds = 0 | 
| 623 | Else | 
| 631 | exp = Update expiry time from increment, and increase overrun count,* given the current clock sample. | 
| 634 | old_expires = exp - val | 
| 636 | Else | 
| 637 | nanoseconds = 1 | 
| 638 | seconds = 0 | 
| 650 | unlock_task_sighand(p, & flags) | 
| 651 | Go to out | 
| 654 | If new_expires != 0 && Not (timer_flags & The various flags for setting POSIX.1b interval timers:) Then | 
| 655 | new_expires += val | 
| 664 | If new_expires != 0 && val < new_expires Then | 
| 668 | unlock_task_sighand(p, & flags) | 
| 680 | it_requeue_pending = it_requeue_pending + 2 & ~REQUEUE_PENDING | 
| 682 | it_overrun_last = 0 | 
| 683 | it_overrun = -1 | 
| 685 | If new_expires != 0 && Not (val < new_expires) Then | 
| 694 | ret = 0 | 
| 695 | out : | 
| 696 | If old Then it_interval = s_to_timespec64 - Convert nanoseconds to timespec64*@nsec: the nanoseconds value to be converted* Returns the timespec64 representation of the nsec parameter. | 
| 699 | Return ret | 
| Name | Describe | 
|---|---|
| do_cpu_nanosleep | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |