函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\sem.c Create Date:2022-07-27 18:19:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perform_atomic_semop

函数原型:static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q)

返回类型:int

参数:

类型参数名称
struct sem_array *sma
struct sem_queue *q
706  sops等于array of pending operations
707  nsops等于umber of operations
708  un等于undo structure
710  如果此条件成立可能性小(为编译器优化)(sops on more than one sem_num )则返回:perform_atomic_semop[_slow] - Attempt to perform semaphore* operations on a given array
719 sop小于sopsnsops循环
720  idx等于array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (semaphore index in array , . of semaphores in array )
722  curr等于sems[idx]
723  sem_op等于semaphore operation
724  result等于current value
726  如果非sem_opresult则转到:would_block
729  result加等于sem_op
730  如果result小于0则转到:would_block
733  如果result大于<= 32767 semaphore maximum value 则返回:负ERANGE
740  如果undo小于负adjust on exit max value 减1或undo大于adjust on exit max value 则返回:负ERANGE
745 sop小于sopsnsops循环
746  curr等于sems[semaphore index in array ]
747  sem_op等于semaphore operation
748  result等于current value
755  current value 加等于sem_op
756  ipc_update_pid( & PID of the process that last modified the semaphore. For* Linux, specifically these are:* - semop* - semctl, via SETVAL and SETALL.* - at task exit when performing undo adjustments (see exit_sem)., process id of requesting process )
759  返回:0
761  would_block :
762  he operation that blocked 等于sop
763  返回:如果peration flags 按位与urn error on wait 则负EAGAIN否则1
调用者
名称描述
wake_const_opswake_const_ops - wake up non-alter tasks*@sma: semaphore array.*@semnum: semaphore that was modified.*@wake_q: lockless wake-queue head.* wake_const_ops must be called after a semaphore in a semaphore array* was set to 0
update_queuepdate_queue - look for tasks that can be completed.*@sma: semaphore array.*@semnum: semaphore that was modified.*@wake_q: lockless wake-queue head.* update_queue must be called after a semaphore in a semaphore array* was modified
do_semtimedop