Compare commits
2 Commits
44893aeeb0
...
91ecc2dc6a
| Author | SHA1 | Date | |
|---|---|---|---|
| 91ecc2dc6a | |||
| 1f793f287f |
@ -33,7 +33,9 @@ int32_t ipc_pipewrite(IpcPipe *pipe, const uint8_t *const buffer, size_t n) {
|
||||
size_t i = 0;
|
||||
spinlock_acquire(&pipe->spinlock);
|
||||
for (; i < n; i++) {
|
||||
rbuf_push(&pipe->rbuf, buffer[i]);
|
||||
if (rbuf_push(&pipe->rbuf, buffer[i]) < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
spinlock_release(&pipe->spinlock);
|
||||
return i;
|
||||
|
||||
@ -141,7 +141,6 @@ Proc *proc_spawnuser(char *mountpoint, char *path) {
|
||||
proc->pid = pids++;
|
||||
proc->mman_map_base = PROC_MMAN_MAP_BASE;
|
||||
spinlock_init(&proc->pipes_spinlock);
|
||||
spinlock_init(&proc->devs_spinlock);
|
||||
|
||||
proc->pipes[0] = dlmalloc(sizeof(IpcPipe));
|
||||
ipc_pipeinit(proc->pipes[0], proc->pid);
|
||||
|
||||
@ -61,7 +61,6 @@ typedef struct Proc {
|
||||
SpinLock pipes_spinlock;
|
||||
|
||||
Dev *devs[PROC_DEVHANDLES_MAX];
|
||||
SpinLock devs_spinlock;
|
||||
|
||||
struct {
|
||||
ProcArg *list;
|
||||
@ -88,13 +87,6 @@ void proc_sched(void *cpustate);
|
||||
void proc_killself(void);
|
||||
void proc_kill(Proc *proc);
|
||||
|
||||
#define PROC_DIE() \
|
||||
do { \
|
||||
proc_killself(); \
|
||||
for(;;); \
|
||||
} while(0)
|
||||
|
||||
|
||||
#define PROC_ARG(proc, str) \
|
||||
do { \
|
||||
ProcArg *__arg = dlmalloc(sizeof(*__arg)); \
|
||||
|
||||
Reference in New Issue
Block a user