Handle process arguments
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include "bitmap/bitmap.h"
|
||||
#include "vfs/vfs.h"
|
||||
#include "ipc/pipe/pipe.h"
|
||||
#include "sysdefs/processctl.h"
|
||||
|
||||
#define PROC_NAME_MAX 0x100
|
||||
|
||||
@ -33,6 +34,11 @@ enum {
|
||||
PROC_WAITING = 3,
|
||||
};
|
||||
|
||||
typedef struct ProcArg {
|
||||
struct ProcArg *next;
|
||||
char string[PROC_ARG_MAX];
|
||||
} ProcArg;
|
||||
|
||||
typedef struct Proc {
|
||||
struct Proc *next;
|
||||
|
||||
@ -53,6 +59,10 @@ typedef struct Proc {
|
||||
IpcPipe *list;
|
||||
SpinLock spinlock;
|
||||
} bcast_pipes;
|
||||
struct {
|
||||
ProcArg *list;
|
||||
size_t len;
|
||||
} procargs;
|
||||
|
||||
uint64_t mman_map_base;
|
||||
} Proc;
|
||||
@ -79,4 +89,12 @@ void proc_kill(Proc *proc);
|
||||
for(;;); \
|
||||
} while(0)
|
||||
|
||||
|
||||
#define PROC_ARG(proc, str) \
|
||||
do { \
|
||||
ProcArg *__arg = dlmalloc(sizeof(*__arg)); \
|
||||
hal_strcpy(__arg->string, (str)); \
|
||||
LL_APPEND((proc)->procargs.list, __arg); \
|
||||
(proc)->procargs.len++; \
|
||||
} while(0)
|
||||
#endif // PROC_PROC_H_
|
||||
|
Reference in New Issue
Block a user