github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/netbsd/lwp.txt (about)

     1  # Copyright 2019 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <sys/types.h>
     5  include <sys/lwp.h>
     6  include <sys/ksem.h>
     7  include <sys/fcntl.h>
     8  include <sys/lwpctl.h>
     9  include <sys/ucontext.h>
    10  include <sys/signal.h>
    11  
    12  resource lwpid[int32]: 0, 0xffffffffffffffff
    13  
    14  _lwp_create(uc ptr[in, ucontext_t], flags flags[lwp_flags], new_lwp ptr[out, lwpid])
    15  _lwp_exit()
    16  _lwp_self() lwpid
    17  _lwp_wait(wait_for lwpid, departed ptr[in, lwpid])
    18  _lwp_suspend(target lwpid)
    19  _lwp_continue(target lwpid)
    20  _lwp_wakeup(target lwpid)
    21  _lwp_getprivate()
    22  _lwp_setprivate(data ptr[in, intptr])
    23  _lwp_kill(target lwpid, sig int32)
    24  _lwp_detach(target lwpid)
    25  compat_50__lwp_park(ts ptr[in, timespec50], unpark lwpid, hint ptr[in, intptr, opt], unparkhint ptr[in, intptr, opt])
    26  compat_60__lwp_park(ts ptr[in, timespec], unpark lwpid, hint ptr[in, intptr, opt], unparkhint ptr[in, intptr, opt])
    27  _lwp_unpark(target lwpid, hint ptr[in, intptr, opt])
    28  _lwp_unpark_all(targets ptr[in, array[lwpid]], ntargets len[targets], hint ptr[in, intptr, opt])
    29  _lwp_setname(target lwpid, name ptr[in, string])
    30  _lwp_getname(target lwpid, name ptr[out, string], size bytesize[name])
    31  _lwp_ctl(features int32, address ptr[in, ptr[in, lwpctl]])
    32  
    33  resource semid[intptr]: 0, KSEM_PSHARED
    34  
    35  _ksem_init(val int32, idp ptr[inout, semid[opt]])
    36  _ksem_open(name buffer[in], oflag flags[semopen_flags], mode flags[open_mode], val int32, idp ptr[out, semid])
    37  _ksem_unlink(name buffer[in])
    38  _ksem_close(id semid)
    39  _ksem_post(id semid)
    40  _ksem_wait(id semid)
    41  _ksem_trywait(id semid)
    42  _ksem_getvalue(id semid, val ptr[out, int32])
    43  _ksem_destroy(id semid)
    44  _ksem_timedwait(id semid, abstime ptr[in, timespec])
    45  
    46  ucontext_t {
    47  	uc_flags	flags[ucontext_flags, int32]
    48  	uc_link		ptr[in, ucontext_t, opt]
    49  	uc_sigmask	sigset_t
    50  	uc_stack	stack_t
    51  	uc_mcontext	mcontext_t
    52  }
    53  
    54  stack_t {
    55  	ss_sp		int64
    56  	ss_size		int64
    57  	ss_flags	flags[stack_flags, int32]
    58  }
    59  
    60  mcontext_t {
    61  	__gregs		int64
    62  	_mc_tlsbase	int64
    63  	__fpregs	string
    64  }
    65  
    66  sigset_t {
    67  	__bits	array[int32, 4]
    68  }
    69  
    70  lwpctl {
    71  	lc_curcpu	int32
    72  	lc_pctr		int32
    73  }
    74  
    75  lwp_flags = LWP_DETACHED, LWP_SUSPENDED
    76  ucontext_flags = _UC_SIGMASK, _UC_STACK, _UC_CPU, _UC_FPU, _UC_MD
    77  stack_flags = SS_DISABLE, SS_ONSTACK
    78  semopen_flags = O_CREAT, O_EXCL