Files
mkrtos-real/mkrtos_user/lib/sys_svr/inc/pm_svr.h

37 lines
697 B
C
Raw Normal View History

2023-11-28 22:33:37 +08:00
/**
* @file pm_svr.h
* @author ATShining (1358745329@qq.com)
2023-12-02 14:36:49 +08:00
* @brief
2023-11-28 22:33:37 +08:00
* @version 0.1
* @date 2023-11-28
2023-12-02 14:36:49 +08:00
*
2023-11-28 22:33:37 +08:00
* @copyright Copyright (c) 2023
2023-12-02 14:36:49 +08:00
*
2023-11-28 22:33:37 +08:00
*/
#pragma once
#include "u_rpc_svr.h"
#include "u_slist.h"
#include "u_types.h"
typedef struct watch_entry
{
pid_t watch_pid;
pid_t src_pid;
obj_handler_t sig_hd;
int flags;
slist_head_t node;
} watch_entry_t;
2023-11-28 22:33:37 +08:00
typedef struct pm
{
rpc_svr_obj_t svr_obj;
slist_head_t watch_head;
2023-11-28 22:33:37 +08:00
} pm_t;
2023-12-02 14:36:49 +08:00
#define PM_APP_BG_RUN 0x1
2023-11-28 22:33:37 +08:00
void pm_svr_obj_init(pm_t *pm);
2023-12-02 14:36:49 +08:00
int pm_rpc_run_app(const char *path, int flags);
int pm_rpc_kill_task(int pid, int flags);
int pm_rpc_watch_pid(pm_t *pm, obj_handler_t sig_rcv_hd, pid_t pid, int flags);