-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefs.h
More file actions
164 lines (163 loc) · 5.92 KB
/
Copy pathdefs.h
File metadata and controls
164 lines (163 loc) · 5.92 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#include "mmu.h"
#define total_defs 100
#define total_defs_1 200
#define total_defs_3 300
struct buf;
struct context;
struct file;
struct inode;
struct pipe;
struct proc;
struct rtcdate;
struct spinlock;
#define total_defs_4 400
struct sleeplock;
struct stat;
struct superblock;
#define total_defs_5 500
void handle_signal(int);
void binit(void);
struct buf* bread(uint, uint);
void brelse(struct buf*);
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))
void bwrite(struct buf*);
void consoleinit(void);
void cprintf(char*, ...);
void consoleintr(int(*)(void));
void panic(char*) __attribute__((noreturn));
int exec(char*, char**);
struct file* filealloc(void);
void fileclose(struct file*);
struct file* filedup(struct file*);
#define total_defs_6 500
void fileinit(void);
int fileread(struct file*, char*, int n);
int filestat(struct file*, struct stat*);
int filewrite(struct file*, char*, int n);
void readsb(int dev, struct superblock *sb);
int dirlink(struct inode*, char*, uint);
struct inode* dirlookup(struct inode*, char*, uint*);
struct inode* ialloc(uint, short);
struct inode* idup(struct inode*);
#define total_defs_7 500
void iinit(int dev);
void adaptive_swap(void);
void ilock(struct inode*);
void iput(struct inode*);
void iunlock(struct inode*);
void iunlockput(struct inode*);
void iupdate(struct inode*);
int namecmp(const char*, const char*);
struct inode* namei(char*);
#define total_defs_8 500
struct inode* nameiparent(char*, char*);
int readi(struct inode*, char*, uint, uint);
void stati(struct inode*, struct stat*);
int writei(struct inode*, char*, uint, uint);
void ideinit(void);
void ideintr(void);
void iderw(struct buf*);
void ioapicenable(int irq, int cpu);
extern uchar ioapicid;
void ioapicinit(void);
char* kalloc(void);
void kfree(char*);
void acquire(struct spinlock*);
void kinit1(void*, void*);
void kinit2(void*, void*);
void kbdintr(void);
#define total_defs_9 500
void cmostime(struct rtcdate *r);
int lapicid(void);
extern volatile uint* lapic;
void lapiceoi(void);
void lapicinit(void);
void lapicstartap(uchar, uint);
void microdelay(int);
void initlog(int dev);
void log_write(struct buf*);
void begin_op();
void end_op();
extern int ismp;
void mpinit(void);
void picenable(int);
void picinit(void);
#define total_defs10 500
int pipealloc(struct file**, struct file**);
void pipeclose(struct pipe*, int);
int piperead(struct pipe*, char*, int);
int pipewrite(struct pipe*, char*, int);
void getcallerpcs(void*, uint*);
int cpuid(void);
void exit(void);
int fork(void);
int growproc(int);
int kill(int);
struct cpu* mycpu(void);
struct proc* myproc();
void pinit(void);
int holding(struct spinlock*);
void procdump(void);
void scheduler(void) __attribute__((noreturn));
void sched(void);
void setproc(struct proc*);
void sleep(void*, struct spinlock*);
void userinit(void);
#define total_defs_11 500
int wait(void);
void wakeup(void*);
void yield(void);
void swtch(struct context**, struct context*);
void swap_init(void);
void acquire(struct spinlock*);
void initlock(struct spinlock*, char*);
void release(struct spinlock*);
void pushcli(void);
void popcli(void);
void acquiresleep(struct sleeplock*);
void releasesleep(struct sleeplock*);
int holdingsleep(struct sleeplock*);
void initsleeplock(struct sleeplock*, char*);
int swap_alloc(int perm);
int memcmp(const void*, const void*, uint);
void* memmove(void*, const void*, uint);
void* memset(void*, int, uint);
char* safestrcpy(char*, const char*, int);
int strlen(const char*);
int strncmp(const char*, const char*, uint);
char* strncpy(char*, const char*, int);
void swap_free(int slot_index);
int argint(int, int*);
int argptr(int, char**, int);
int argstr(int, char**);
int fetchint(uint, int*);
int fetchstr(uint, char**);
void syscall(void);
void timerinit(void);
void swap_write(int slot_index, void *page);
void idtinit(void);
extern uint ticks;
#define total_defs_14 500
void tvinit(void);
extern struct spinlock tickslock;
void swap_read(int slot_index, void *page);
void uartinit(void);
void uartintr(void);
void uartputc(int);
void seginit(void);
void kvmalloc(void);
pde_t* setupkvm(void);
void swap_out(void);
char* uva2ka(pde_t*, char*);
int allocuvm(pde_t*, uint, uint,struct proc*);
int deallocuvm(pde_t*, uint, uint,struct proc*);
void freevm(pde_t*,struct proc*);
void inituvm(pde_t*, char*, uint);
int loaduvm(pde_t*, char*, struct inode*, uint, uint);
pde_t* copyuvm(pde_t*, uint ,struct proc*);
void switchuvm(struct proc*);
void switchkvm(void);
void handle_pgfault(pde_t *pgdir, uint va,uint n);
int copyout(pde_t*, uint, void*, uint);
void clearpteu(pde_t *pgdir, char *uva);
pte_t* walkpgdir(pde_t*, const void*, int);