1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-12-11 11:35:39 -05:00
kernel/kernelmq/process.h

77 lines
1.9 KiB
C
Raw Normal View History

2020-11-26 04:43:20 -05:00
#ifndef KERNELMQ_INCLUDED_PROCESS
#define KERNELMQ_INCLUDED_PROCESS 1
2020-11-26 05:37:53 -05:00
#include "info.h"
2020-11-26 04:43:20 -05:00
#define KERNELMQ_PROCESS_LIST_LENGTH 20
#define KERNELMQ_PROCESS_CMDLINE_SIZE_MAX 256
#define KERNELMQ_PROCESS_CMDLINE_SLEN_MAX (KERNELMQ_PROCESS_CMDLINE_SIZE_MAX - 1)
#define KERNELMQ_PROCESS_AREAS_LENGTH_MAX 20
#ifdef __cplusplus
extern "C" {
#endif
2020-11-26 07:07:08 -05:00
enum KernelMQ_Process_Error {
KERNELMQ_PROCESS_ERROR_OK = 0,
KERNELMQ_PROCESS_ERROR_CMDLINE_TOO_LONG = 1,
KERNELMQ_PROCESS_ERROR_ADDR_TOO_BIG = 2,
2020-11-26 07:22:33 -05:00
KERNELMQ_PROCESS_ERROR_INVALID_AREA = 3,
KERNELMQ_PROCESS_ERROR_KERNEL_AREAS_LENGTH_TOO_LONG = 4,
KERNELMQ_PROCESS_ERROR_MODULES_TOO_MANY = 5,
2020-11-26 04:43:20 -05:00
};
enum KernelMQ_Process_CreatedFrom {
KERNELMQ_PROCESS_CREATED_FROM_KERNEL = 0,
KERNELMQ_PROCESS_CREATED_FROM_MODULE = 1,
};
struct KernelMQ_Process_Area {
unsigned long base;
unsigned long size;
unsigned long limit;
};
struct KernelMQ_Process {
unsigned char is_present;
enum KernelMQ_Process_CreatedFrom created_from;
char cmdline[KERNELMQ_PROCESS_CMDLINE_SIZE_MAX];
struct KernelMQ_Process_Area areas[KERNELMQ_PROCESS_AREAS_LENGTH_MAX];
unsigned int areas_length;
};
typedef struct KernelMQ_Process
KernelMQ_Process_List[KERNELMQ_PROCESS_LIST_LENGTH];
2020-11-26 07:42:16 -05:00
void KernelMQ_Process_List_print(const KernelMQ_Process_List *process_list)
__attribute__((nonnull));
2020-11-26 07:07:08 -05:00
enum KernelMQ_Process_Error KernelMQ_Process_List_init(
2020-11-26 05:37:53 -05:00
KernelMQ_Process_List *process_list,
const struct KernelMQ_Info *kinfo
)
__attribute__((nonnull));
2020-11-26 04:43:20 -05:00
2020-11-26 07:07:08 -05:00
enum KernelMQ_Process_Error KernelMQ_Process_create_from_kernel(
2020-11-26 06:56:28 -05:00
struct KernelMQ_Process *process,
const struct KernelMQ_Info *kinfo
)
__attribute__((nonnull));
2020-11-26 07:07:08 -05:00
enum KernelMQ_Process_Error KernelMQ_Process_create_from_module(
2020-11-26 06:56:28 -05:00
struct KernelMQ_Process *process,
2020-11-26 07:01:38 -05:00
const struct KernelMQ_Info_Module *kinfo_module
2020-11-26 06:56:28 -05:00
)
__attribute__((nonnull));
2020-11-26 04:43:20 -05:00
#ifdef __cplusplus
}
#endif
#endif