xref: /xv6-public/defs.h (revision 856e1fc1)
1 // kalloc.c
2 char *kalloc(int n);
3 void kfree(char *cp, int len);
4 void kinit(void);
5 
6 // console.c
7 void cprintf(char *fmt, ...);
8 void panic(char *s);
9 void cons_putc(int);
10 
11 // proc.c
12 struct proc;
13 struct jmpbuf;
14 void setupsegs(struct proc *);
15 struct proc * copyproc(struct proc*);
16 struct spinlock;
17 void sleep(void *, struct spinlock *);
18 void wakeup(void *);
19 void scheduler(void);
20 void proc_exit(void);
21 int proc_kill(int);
22 int proc_wait(void);
23 void yield(void);
24 
25 // swtch.S
26 struct jmpbuf;
27 int setjmp(struct jmpbuf*);
28 void longjmp(struct jmpbuf*);
29 
30 // trap.c
31 void tvinit(void);
32 void idtinit(void);
33 
34 // string.c
35 void * memset(void *dst, int c, unsigned n);
36 int memcmp(const void *v1, const void *v2, unsigned n);
37 void *memmove(void *dst, const void *src, unsigned n);
38 int strncmp(const char *p, const char *q, unsigned n);
39 
40 // syscall.c
41 void syscall(void);
42 
43 // picirq.c
44 extern uint16_t irq_mask_8259A;
45 void irq_setmask_8259A(uint16_t mask);
46 void pic_init(void);
47 
48 // mp.c
49 void mp_init(void);
50 void mp_startthem(void);
51 int mp_bcpu(void);
52 
53 // lapic
54 extern uint32_t *lapicaddr;
55 void lapic_init(int);
56 void lapic_startap(uint8_t, int);
57 void lapic_timerinit(void);
58 void lapic_timerintr(void);
59 void lapic_enableintr(void);
60 void lapic_disableintr(void);
61 int cpu(void);
62 
63 // spinlock.c
64 struct spinlock;
65 void acquire(struct spinlock * lock);
66 void release(struct spinlock * lock);
67 void acquire1(struct spinlock * lock, struct proc *);
68 void release1(struct spinlock * lock, struct proc *);
69 
70 // main.c
71 void load_icode(struct proc *p, uint8_t *binary, unsigned size);
72 
73 // pipe.c
74 struct pipe;
75 struct fd;
76 int pipe_alloc(struct fd **fd1, struct fd **fd2);
77 void pipe_close(struct pipe *p, int writeable);
78 int pipe_write(struct pipe *p, char *addr, int n);
79 int pipe_read(struct pipe *p, char *addr, int n);
80 
81 // fd.c
82 int fd_ualloc();
83 struct fd * fd_alloc();
84 void fd_close(struct fd *);
85 int fd_read(struct fd *fd, char *addr, int n);
86 int fd_write(struct fd *fd, char *addr, int n);
87 void fd_reference(struct fd *fd);
88 
89 // ide.c
90 void ide_init(void);
91 void ide_intr(void);
92 void* ide_start_read(uint32_t secno, void *dst, unsigned nsecs);
93 int ide_finish_read(void *);
94 
95