函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:perform_atomic_semop[_slow] - Attempt to perform semaphore* operations on a given array

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

返回类型:int

参数:

类型参数名称
struct sem_array *sma
struct sem_queue *q
634  sops等于array of pending operations
635  nsops等于umber of operations
636  un等于undo structure
638 sop小于sopsnsops循环
639  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 )
640  curr等于sems[idx]
641  sem_op等于semaphore operation
642  result等于current value
644  如果非sem_opresult则转到:would_block
647  result加等于sem_op
648  如果result小于0则转到:would_block
650  如果result大于<= 32767 semaphore maximum value 则转到:out_of_range
661  current value 等于result
664  sop自减
665  pid等于process id of requesting process
666 sop大于等于sops循环
667  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)., pid)
668  sop自减
671  返回:0
673  out_of_range :
674  result等于负ERANGE
675  转到:undo
677  would_block :
678  he operation that blocked 等于sop
680  如果peration flags 按位与urn error on wait result等于负EAGAIN
682  否则result等于1
685  undo :
686  sop自减
687 sop大于等于sops循环
688  sem_op等于semaphore operation
689  current value 减等于sem_op
690  如果peration flags 按位与undo the operation on exit array of adjustments [semaphore index in array ]加等于sem_op
692  sop自减
695  返回:result
调用者
名称描述
perform_atomic_semop