los_process_pri.h 17.3 KB
Newer Older
W
wenjun 已提交
1
/*
M
mamingshuai 已提交
2
 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
Z
zhushengle 已提交
3
 * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved.
W
wenjun 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 *    conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 *    of conditions and the following disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
 *    to endorse or promote products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _LOS_PROCESS_PRI_H
#define _LOS_PROCESS_PRI_H

#include "los_task_pri.h"
Z
zhushengle 已提交
36
#include "sched.h"
W
wenjun 已提交
37 38 39
#include "los_sem_pri.h"
#include "los_process.h"
#include "los_vm_map.h"
40
#ifdef LOSCFG_KERNEL_LITEIPC
W
wenjun 已提交
41 42 43 44 45 46 47 48
#include "hm_liteipc.h"
#endif
#ifdef LOSCFG_SECURITY_CAPABILITY
#include "capability_type.h"
#endif
#ifdef LOSCFG_SECURITY_VID
#include "vid_type.h"
#endif
49
#include "sys/resource.h"
Z
zhushengle 已提交
50 51 52
#ifdef LOSCFG_KERNEL_CONTAINER
#include "los_container_pri.h"
#endif
W
wenjun 已提交
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */

#define OS_PCB_NAME_LEN OS_TCB_NAME_LEN

#ifdef LOSCFG_SECURITY_CAPABILITY
#define OS_GROUPS_NUMBER_MAX 256

typedef struct {
    UINT32  userID;
    UINT32  effUserID;
    UINT32  gid;
    UINT32  effGid;
    UINT32  groupNumber;
    UINT32  groups[1];
} User;
#endif

Z
zhushengle 已提交
75 76 77 78 79
typedef struct ProcessGroup {
    UINTPTR      pgroupLeader;    /**< Process group leader is the the process that created the group */
    LOS_DL_LIST  processList;     /**< List of processes under this process group */
    LOS_DL_LIST  exitProcessList; /**< List of closed processes (zombie processes) under this group */
    LOS_DL_LIST  groupList;       /**< Process group list */
W
wenjun 已提交
80 81 82 83
} ProcessGroup;

typedef struct ProcessCB {
    CHAR                 processName[OS_PCB_NAME_LEN]; /**< Process name */
84 85
    UINT32               processID;                    /**< Process ID */
    UINT16               processStatus;                /**< [15:4] Process Status; [3:0] The number of threads currently
W
wenjun 已提交
86 87 88
                                                            running in the process */
    UINT16               consoleID;                    /**< The console id of task belongs  */
    UINT16               processMode;                  /**< Kernel Mode:0; User Mode:1; */
Z
zhushengle 已提交
89
    struct ProcessCB     *parentProcess;               /**< Parent process */
90
    UINT32               exitCode;                     /**< Process exit status */
W
wenjun 已提交
91
    LOS_DL_LIST          pendList;                     /**< Block list to which the process belongs */
92 93 94
    LOS_DL_LIST          childrenList;                 /**< Children process list */
    LOS_DL_LIST          exitChildList;                /**< Exit children process list */
    LOS_DL_LIST          siblingList;                  /**< Linkage in parent's children list */
Z
zhushengle 已提交
95
    ProcessGroup         *pgroup;                      /**< Process group to which a process belongs */
96
    LOS_DL_LIST          subordinateGroupList;         /**< Linkage in group list */
Z
zhushengle 已提交
97
    LosTaskCB            *threadGroup;
W
wenjun 已提交
98 99 100 101
    LOS_DL_LIST          threadSiblingList;            /**< List of threads under this process */
    volatile UINT32      threadNumber; /**< Number of threads alive under this process */
    UINT32               threadCount;  /**< Total number of threads created under this process */
    LOS_DL_LIST          waitList;     /**< The process holds the waitLits to support wait/waitpid */
102
#ifdef LOSCFG_KERNEL_SMP
W
wenjun 已提交
103 104
    UINT32               timerCpu;     /**< CPU core number of this task is delayed or pended */
#endif
105 106
    UINTPTR              sigHandler;   /**< Signal handler */
    sigset_t             sigShare;     /**< Signal share bit */
107
#ifdef LOSCFG_KERNEL_LITEIPC
Z
zhushengle 已提交
108
    ProcIpcInfo          *ipcInfo;      /**< Memory pool for lite ipc */
W
wenjun 已提交
109
#endif
Y
YOUR_NAME 已提交
110
#ifdef LOSCFG_KERNEL_VM
M
mamingshuai 已提交
111
    LosVmSpace           *vmSpace;     /**< VMM space for processes */
Y
YOUR_NAME 已提交
112
#endif
W
wenjun 已提交
113
#ifdef LOSCFG_FS_VFS
M
mamingshuai 已提交
114
    struct files_struct  *files;       /**< Files held by the process */
W
wenjun 已提交
115
#endif
M
mamingshuai 已提交
116
    timer_t              timerID;      /**< ITimer */
W
wenjun 已提交
117 118 119 120 121 122

#ifdef LOSCFG_SECURITY_CAPABILITY
    User                *user;
    UINT32              capability;
#endif
#ifdef LOSCFG_SECURITY_VID
M
mamingshuai 已提交
123
    TimerIdMap           timerIdMap;
W
wenjun 已提交
124 125
#endif
#ifdef LOSCFG_DRIVERS_TZDRIVER
126
    struct Vnode        *execVnode;   /**< Exec bin of the process */
M
mamingshuai 已提交
127 128 129
#endif
    mode_t               umask;
#ifdef LOSCFG_KERNEL_CPUP
130
    OsCpupBase           *processCpup; /**< Process cpu usage */
W
wenjun 已提交
131
#endif
132
    struct rlimit        *resourceLimit;
Z
zhushengle 已提交
133
#ifdef LOSCFG_KERNEL_CONTAINER
Z
zhushengle 已提交
134
    Container            *container;
Z
zhushengle 已提交
135 136 137
#ifdef LOSCFG_USER_CONTAINER
    struct Credentials   *credentials;
#endif
Z
zhushengle 已提交
138
#endif
139 140 141
#ifdef LOSCFG_PROC_PROCESS_DIR
    struct ProcDirEntry *procDir;
#endif
W
wenjun 已提交
142 143
} LosProcessCB;

Z
zhushengle 已提交
144 145
extern LosProcessCB *g_processCBArray;
extern UINT32 g_processMaxNum;
W
wenjun 已提交
146

Z
zhushengle 已提交
147 148 149 150 151 152 153 154 155 156 157
#define OS_PCB_FROM_RPID(processID)     (((LosProcessCB *)g_processCBArray) + (processID))
#ifdef LOSCFG_PID_CONTAINER
#define OS_PCB_FROM_PID(processID)      OsGetPCBFromVpid(processID)
#else
#define OS_PCB_FROM_PID(processID)      OS_PCB_FROM_RPID(processID)
#endif
#define OS_PCB_FROM_TCB(taskCB)         ((LosProcessCB *)((taskCB)->processCB))
#define OS_PCB_FROM_TID(taskID)         ((LosProcessCB *)(OS_TCB_FROM_TID(taskID)->processCB))
#define OS_GET_PGROUP_LEADER(pgroup)    ((LosProcessCB *)((pgroup)->pgroupLeader))
#define OS_PCB_FROM_SIBLIST(ptr)        LOS_DL_LIST_ENTRY((ptr), LosProcessCB, siblingList)
#define OS_PCB_FROM_PENDLIST(ptr)       LOS_DL_LIST_ENTRY((ptr), LosProcessCB, pendList)
W
wenjun 已提交
158 159 160 161 162 163 164

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is created but does not participate in scheduling.
 */
165
#define OS_PROCESS_STATUS_INIT           OS_TASK_STATUS_INIT
W
wenjun 已提交
166 167 168 169 170 171 172

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is ready.
 */
173
#define OS_PROCESS_STATUS_READY          OS_TASK_STATUS_READY
W
wenjun 已提交
174 175 176 177 178 179 180

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is running.
 */
181
#define OS_PROCESS_STATUS_RUNNING        OS_TASK_STATUS_RUNNING
W
wenjun 已提交
182 183 184 185 186

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
M
mamingshuai 已提交
187
 * The process is pending
W
wenjun 已提交
188
 */
189
#define OS_PROCESS_STATUS_PENDING       (OS_TASK_STATUS_PENDING | OS_TASK_STATUS_DELAY | OS_TASK_STATUS_SUSPENDED)
W
wenjun 已提交
190 191 192 193 194 195 196

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is run out but the resources occupied by the process are not recovered.
 */
197
#define OS_PROCESS_STATUS_ZOMBIES        0x0100U
W
wenjun 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process status equal this is process control block unused,
 * coexisting with OS_PROCESS_STATUS_ZOMBIES means that the control block is not recovered.
 */
#define OS_PROCESS_FLAG_UNUSED            0x0200U

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process has been call exit, it only works with multiple cores.
 */
#define OS_PROCESS_FLAG_EXIT              0x0400U

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is the leader of the process group.
 */
#define OS_PROCESS_FLAG_GROUP_LEADER      0x0800U

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process has performed the exec operation.
 */
#define OS_PROCESS_FLAG_ALREADY_EXEC      0x1000U

/**
 * @ingroup los_process
 * Flag that indicates the process or process control block status.
 *
 * The process is dying or already dying.
 */
#define OS_PROCESS_STATUS_INACTIVE       (OS_PROCESS_FLAG_EXIT | OS_PROCESS_STATUS_ZOMBIES)

/**
 * @ingroup los_process
 * Used to check if the process control block is unused.
 */
STATIC INLINE BOOL OsProcessIsUnused(const LosProcessCB *processCB)
{
    return ((processCB->processStatus & OS_PROCESS_FLAG_UNUSED) != 0);
}

/**
 * @ingroup los_process
 * Used to check if the process is inactive.
 */
STATIC INLINE BOOL OsProcessIsInactive(const LosProcessCB *processCB)
{
    return ((processCB->processStatus & (OS_PROCESS_FLAG_UNUSED | OS_PROCESS_STATUS_INACTIVE)) != 0);
}

/**
 * @ingroup los_process
 * Used to check if the process is dead.
 */
STATIC INLINE BOOL OsProcessIsDead(const LosProcessCB *processCB)
{
Z
zhushengle 已提交
264
    return ((processCB->processStatus & OS_PROCESS_STATUS_ZOMBIES) != 0);
W
wenjun 已提交
265 266
}

267 268
STATIC INLINE BOOL OsProcessIsInit(const LosProcessCB *processCB)
{
Z
zhushengle 已提交
269 270 271 272 273 274
    return ((processCB->processStatus & OS_PROCESS_STATUS_INIT) != 0);
}

STATIC INLINE BOOL OsProcessIsPGroupLeader(const LosProcessCB *processCB)
{
    return ((processCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) != 0);
275 276
}

W
wenjun 已提交
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
/**
 * @ingroup los_process
 * The highest priority of a kernel mode process.
 */
#define OS_PROCESS_PRIORITY_HIGHEST      0

/**
 * @ingroup los_process
 * The lowest priority of a kernel mode process
 */
#define OS_PROCESS_PRIORITY_LOWEST       31

/**
 * @ingroup los_process
 * The highest priority of a user mode process.
 */
#define OS_USER_PROCESS_PRIORITY_HIGHEST 10

/**
 * @ingroup los_process
 * The lowest priority of a user mode process
 */
#define OS_USER_PROCESS_PRIORITY_LOWEST  OS_PROCESS_PRIORITY_LOWEST

/**
 * @ingroup los_process
 * User state root process default priority
 */
#define OS_PROCESS_USERINIT_PRIORITY     28

Z
zhushengle 已提交
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
/**
 * @ingroup los_process
 * ID of the kernel idle process
 */
#define OS_KERNEL_IDLE_PROCESS_ID       0U

/**
 * @ingroup los_process
 * ID of the user root process
 */
#define OS_USER_ROOT_PROCESS_ID         1U

/**
 * @ingroup los_process
 * ID of the kernel root process
 */
#define OS_KERNEL_ROOT_PROCESS_ID       2U

W
wenjun 已提交
325
#define OS_TASK_DEFAULT_STACK_SIZE      0x2000
R
rtos-lover 已提交
326
#define OS_USER_TASK_SYSCALL_STACK_SIZE 0x3000
W
wenjun 已提交
327 328 329 330 331 332 333 334 335 336 337 338 339
#define OS_USER_TASK_STACK_SIZE         0x100000

#define OS_KERNEL_MODE 0x0U
#define OS_USER_MODE   0x1U
STATIC INLINE BOOL OsProcessIsUserMode(const LosProcessCB *processCB)
{
    return (processCB->processMode == OS_USER_MODE);
}

#define LOS_PRIO_PROCESS  0U
#define LOS_PRIO_PGRP     1U
#define LOS_PRIO_USER     2U

Z
zhushengle 已提交
340 341
#define OS_USER_PRIVILEGE_PROCESS_GROUP ((UINTPTR)OsGetUserInitProcess())
#define OS_KERNEL_PROCESS_GROUP         ((UINTPTR)OsGetKernelInitProcess())
W
wenjun 已提交
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386

/*
 * Process exit code
 * 31    15           8           7        0
 * |     | exit code  | core dump | signal |
 */
#define OS_PRO_EXIT_OK 0

STATIC INLINE VOID OsProcessExitCodeCoreDumpSet(LosProcessCB *processCB)
{
    processCB->exitCode |= 0x80U;
}

STATIC INLINE VOID OsProcessExitCodeSignalSet(LosProcessCB *processCB, UINT32 signal)
{
    processCB->exitCode |= signal & 0x7FU;
}

STATIC INLINE VOID OsProcessExitCodeSignalClear(LosProcessCB *processCB)
{
    processCB->exitCode &= (~0x7FU);
}

STATIC INLINE BOOL OsProcessExitCodeSignalIsSet(LosProcessCB *processCB)
{
    return (processCB->exitCode) & 0x7FU;
}

STATIC INLINE VOID OsProcessExitCodeSet(LosProcessCB *processCB, UINT32 code)
{
    processCB->exitCode |= ((code & 0x000000FFU) << 8U) & 0x0000FF00U; /* 8: Move 8 bits to the left, exitCode */
}

#define OS_PID_CHECK_INVALID(pid) (((UINT32)(pid)) >= g_processMaxNum)

STATIC INLINE BOOL OsProcessIDUserCheckInvalid(UINT32 pid)
{
    return ((pid >= g_processMaxNum) || (pid == 0));
}

STATIC INLINE LosProcessCB *OsCurrProcessGet(VOID)
{
    UINT32 intSave;

    intSave = LOS_IntLock();
Z
zhushengle 已提交
387
    LosProcessCB *runProcess = OS_PCB_FROM_TCB(OsCurrTaskGet());
W
wenjun 已提交
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
    LOS_IntRestore(intSave);
    return runProcess;
}

#ifdef LOSCFG_SECURITY_CAPABILITY
STATIC INLINE User *OsCurrUserGet(VOID)
{
    User *user = NULL;
    UINT32 intSave;

    intSave = LOS_IntLock();
    user = OsCurrProcessGet()->user;
    LOS_IntRestore(intSave);
    return user;
}
403 404 405 406 407 408

STATIC INLINE UINT32 OsProcessUserIDGet(const LosTaskCB *taskCB)
{
    UINT32 intSave = LOS_IntLock();
    UINT32 uid = OS_INVALID;

Z
zhushengle 已提交
409
    LosProcessCB *process = OS_PCB_FROM_TCB(taskCB);
410 411 412 413 414 415
    if (process->user != NULL) {
        uid = process->user->userID;
    }
    LOS_IntRestore(intSave);
    return uid;
}
W
wenjun 已提交
416 417
#endif

Z
zhushengle 已提交
418
STATIC INLINE BOOL OsIsProcessThreadGroup(const LosTaskCB *taskCB)
419
{
Z
zhushengle 已提交
420
    return (OS_PCB_FROM_TCB(taskCB)->threadGroup == taskCB);
421 422
}

423 424
STATIC INLINE UINT32 OsProcessThreadNumberGet(const LosTaskCB *taskCB)
{
Z
zhushengle 已提交
425
    return OS_PCB_FROM_TCB(taskCB)->threadNumber;
426 427 428 429 430 431 432 433 434
}

#ifdef LOSCFG_KERNEL_VM
STATIC INLINE LosVmSpace *OsProcessVmSpaceGet(const LosProcessCB *processCB)
{
    return processCB->vmSpace;
}
#endif

435 436 437 438 439 440
#ifdef LOSCFG_DRIVERS_TZDRIVER
STATIC INLINE struct Vnode *OsProcessExecVnodeGet(const LosProcessCB *processCB)
{
    return processCB->execVnode;
}
#endif
Z
zhushengle 已提交
441 442 443 444 445 446 447 448 449 450 451

STATIC INLINE UINT32 OsGetPid(const LosProcessCB *processCB)
{
#ifdef LOSCFG_PID_CONTAINER
    if (OS_PROCESS_CONTAINER_CHECK(processCB, OsCurrProcessGet())) {
        return OsGetVpidFromCurrContainer(processCB);
    }
#endif
    return processCB->processID;
}

452 453 454 455 456 457 458 459 460
STATIC INLINE UINT32 OsGetRootPid(const LosProcessCB *processCB)
{
#ifdef LOSCFG_PID_CONTAINER
    return OsGetVpidFromRootContainer(processCB);
#else
    return processCB->processID;
#endif
}

W
wenjun 已提交
461 462 463 464 465 466 467 468 469 470 471
/*
 * return immediately if no child has exited.
 */
#define LOS_WAIT_WNOHANG   (1 << 0U)

/*
 * return if a child has stopped (but not traced via ptrace(2)).
 * Status for traced children which have stopped is provided even
 * if this option is not specified.
 */
#define LOS_WAIT_WUNTRACED (1 << 1U)
W
wjj 已提交
472 473 474 475 476 477
#define LOS_WAIT_WSTOPPED (1 << 1U)

/*
 * Wait for exited processes
 */
#define LOS_WAIT_WEXITED (1 << 2U)
W
wenjun 已提交
478 479 480 481 482 483 484

/*
 * return if a stopped child has been resumed by delivery of SIGCONT.
 * (For Linux-only options, see below.)
 */
#define LOS_WAIT_WCONTINUED (1 << 3U)

W
wjj 已提交
485 486 487 488 489 490
/*
 * Leave the child in a waitable state;
 * a later wait call can be used to again retrieve the child status information.
 */
#define LOS_WAIT_WNOWAIT (1 << 24U)

W
wenjun 已提交
491 492 493 494 495 496 497 498
/*
 * Indicates that you are already in a wait state
 */
#define OS_PROCESS_WAIT     (1 << 15U)

/*
 * Wait for any child process to finish
 */
M
mamingshuai 已提交
499
#define OS_PROCESS_WAIT_ANY OS_TASK_WAIT_ANYPROCESS
W
wenjun 已提交
500 501 502 503

/*
 * Wait for the child process specified by the pid to finish
 */
M
mamingshuai 已提交
504
#define OS_PROCESS_WAIT_PRO OS_TASK_WAIT_PROCESS
W
wenjun 已提交
505 506 507 508

/*
 * Waits for any child process in the specified process group to finish.
 */
M
mamingshuai 已提交
509
#define OS_PROCESS_WAIT_GID OS_TASK_WAIT_GID
W
wenjun 已提交
510 511 512 513 514 515 516 517

#define OS_PROCESS_INFO_ALL 1
#define OS_PROCESS_DEFAULT_UMASK 0022

extern UINTPTR __user_init_entry;
extern UINTPTR __user_init_bss;
extern UINTPTR __user_init_end;
extern UINTPTR __user_init_load_addr;
Z
zhushengle 已提交
518
extern UINT32 OsProcessInit(VOID);
M
mamingshuai 已提交
519
extern UINT32 OsSystemProcessCreate(VOID);
520
extern VOID OsProcessNaturalExit(LosProcessCB *processCB, UINT32 status);
521
extern VOID OsProcessCBRecycleToFree(VOID);
W
wenjun 已提交
522 523 524
extern VOID OsProcessResourcesToFree(LosProcessCB *processCB);
extern UINT32 OsUserInitProcess(VOID);
extern INT32 OsClone(UINT32 flags, UINTPTR sp, UINT32 size);
525 526 527
extern VOID OsExecProcessVmSpaceRestore(LosVmSpace *oldSpace);
extern LosVmSpace *OsExecProcessVmSpaceReplace(LosVmSpace *newSpace, UINTPTR stackBase, INT32 randomDevFD);
extern UINT32 OsExecRecycleAndInit(LosProcessCB *processCB, const CHAR *name, LosVmSpace *oldAspace, UINTPTR oldFiles);
W
wenjun 已提交
528
extern UINT32 OsExecStart(const TSK_ENTRY_FUNC entry, UINTPTR sp, UINTPTR mapBase, UINT32 mapSize);
529
extern UINT32 OsSetProcessName(LosProcessCB *processCB, const CHAR *name);
M
mamingshuai 已提交
530
extern INT32 OsSetProcessScheduler(INT32 which, INT32 pid, UINT16 prio, UINT16 policy);
W
wenjun 已提交
531
extern INT32 OsGetProcessPriority(INT32 which, INT32 pid);
Z
zhushengle 已提交
532 533
extern LosProcessCB *OsGetUserInitProcess(VOID);
extern LosProcessCB *OsGetIdleProcess(VOID);
W
wenjun 已提交
534 535
extern INT32 OsSetProcessGroupID(UINT32 pid, UINT32 gid);
extern INT32 OsSetCurrProcessGroupID(UINT32 gid);
Z
zhushengle 已提交
536
extern LosProcessCB *OsGetKernelInitProcess(VOID);
W
wenjun 已提交
537 538
extern VOID OsSetSigHandler(UINTPTR addr);
extern UINTPTR OsGetSigHandler(VOID);
539
extern VOID OsWaitWakeTask(LosTaskCB *taskCB, UINT32 wakePID);
W
wjj 已提交
540 541
extern INT32 OsSendSignalToProcessGroup(INT32 pid, siginfo_t *info, INT32 permission);
extern INT32 OsSendSignalToAllProcess(siginfo_t *info, INT32 permission);
Z
zhushengle 已提交
542
extern UINT32 OsProcessAddNewTask(UINTPTR processID, LosTaskCB *taskCB, SchedParam *param, UINT32 *numCount);
543 544
extern VOID OsDeleteTaskFromProcess(LosTaskCB *taskCB);
extern VOID OsProcessThreadGroupDestroy(VOID);
Z
zhushengle 已提交
545 546
extern UINT32 OsGetProcessGroupCB(UINT32 pid, UINTPTR *ppgroupLeader);
extern LosProcessCB *OsGetDefaultProcessCB(VOID);
Z
zhushengle 已提交
547
extern ProcessGroup *OsCreateProcessGroup(LosProcessCB *processCB);
W
wenjun 已提交
548 549 550 551 552 553 554
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */

#endif