summaryrefslogtreecommitdiff
path: root/include/kernel/proc.h
blob: cbf2902a53a31d41a9c4ae326306c1be948616e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include "common/types.h"
#include "kernel/proc_def.h"
#include "kernel/spinlock.h"

namespace ProcManager
{
    void init();
    void scheduler();
    void yield();

    void create_kernel_thread(void (*func)(), const char *name);

    void user_init();
    void exit(int status);
    int wait(uint64 addr);

    void sleep(void *chan, Spinlock *lk);
    void wakeup(void *chan);

    int growproc(int n);
}

void forkret();
struct Proc *myproc();
void usertrapret();
int fork();