1 | /* Function prototypes. */
|
---|
2 |
|
---|
3 | #ifndef PROTO_H
|
---|
4 | #define PROTO_H
|
---|
5 |
|
---|
6 | /* Struct declarations. */
|
---|
7 | struct proc;
|
---|
8 | struct timer;
|
---|
9 |
|
---|
10 | /* clock.c */
|
---|
11 | _PROTOTYPE( void clock_task, (void) );
|
---|
12 | _PROTOTYPE( void clock_stop, (void) );
|
---|
13 | _PROTOTYPE( clock_t get_uptime, (void) );
|
---|
14 | _PROTOTYPE( unsigned long read_clock, (void) );
|
---|
15 | _PROTOTYPE( void set_timer, (struct timer *tp, clock_t t, tmr_func_t f) );
|
---|
16 | _PROTOTYPE( void reset_timer, (struct timer *tp) );
|
---|
17 |
|
---|
18 | /* main.c */
|
---|
19 | _PROTOTYPE( void main, (void) );
|
---|
20 | _PROTOTYPE( void prepare_shutdown, (int how) );
|
---|
21 |
|
---|
22 | /* utility.c */
|
---|
23 | _PROTOTYPE( void kprintf, (const char *fmt, ...) );
|
---|
24 | _PROTOTYPE( void panic, (_CONST char *s, int n) );
|
---|
25 |
|
---|
26 | /* proc.c */
|
---|
27 | _PROTOTYPE( int sys_call, (int function, int src_dest, message *m_ptr) );
|
---|
28 | _PROTOTYPE( int lock_notify, (int src, int dst) );
|
---|
29 | _PROTOTYPE( int lock_send, (int dst, message *m_ptr) );
|
---|
30 | _PROTOTYPE( void lock_enqueue, (struct proc *rp) );
|
---|
31 | _PROTOTYPE( void lock_dequeue, (struct proc *rp) );
|
---|
32 |
|
---|
33 | /* start.c */
|
---|
34 | _PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds,
|
---|
35 | U16_t parmoff, U16_t parmsize) );
|
---|
36 |
|
---|
37 | /* system.c */
|
---|
38 | _PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
|
---|
39 | _PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
|
---|
40 | _PROTOTYPE( void cause_sig, (int proc_nr, int sig_nr) );
|
---|
41 | _PROTOTYPE( void sys_task, (void) );
|
---|
42 | _PROTOTYPE( void get_randomness, (int source) );
|
---|
43 | _PROTOTYPE( int virtual_copy, (struct vir_addr *src, struct vir_addr *dst,
|
---|
44 | vir_bytes bytes) );
|
---|
45 | #define numap_local(proc_nr, vir_addr, bytes) \
|
---|
46 | umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
|
---|
47 | _PROTOTYPE( phys_bytes umap_local, (struct proc *rp, int seg,
|
---|
48 | vir_bytes vir_addr, vir_bytes bytes) );
|
---|
49 | _PROTOTYPE( phys_bytes umap_remote, (struct proc *rp, int seg,
|
---|
50 | vir_bytes vir_addr, vir_bytes bytes) );
|
---|
51 | _PROTOTYPE( phys_bytes umap_bios, (struct proc *rp, vir_bytes vir_addr,
|
---|
52 | vir_bytes bytes) );
|
---|
53 |
|
---|
54 | /* exception.c */
|
---|
55 | _PROTOTYPE( void exception, (unsigned vec_nr) );
|
---|
56 |
|
---|
57 | /* i8259.c */
|
---|
58 | _PROTOTYPE( void intr_init, (int mine) );
|
---|
59 | _PROTOTYPE( void intr_handle, (irq_hook_t *hook) );
|
---|
60 | _PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
|
---|
61 | irq_handler_t handler) );
|
---|
62 | _PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
|
---|
63 |
|
---|
64 | /* klib*.s */
|
---|
65 | _PROTOTYPE( void int86, (void) );
|
---|
66 | _PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,vir_bytes src_offset,
|
---|
67 | phys_clicks dst_clicks, vir_bytes dst_offset) );
|
---|
68 | _PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
|
---|
69 | _PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
|
---|
70 | _PROTOTYPE( u16_t mem_rdw, (U16_t segm, vir_bytes offset) );
|
---|
71 | _PROTOTYPE( void phys_copy, (phys_bytes source, phys_bytes dest,
|
---|
72 | phys_bytes count) );
|
---|
73 | _PROTOTYPE( void phys_memset, (phys_bytes source, unsigned long pattern,
|
---|
74 | phys_bytes count) );
|
---|
75 | _PROTOTYPE( void phys_insb, (U16_t port, phys_bytes buf, size_t count) );
|
---|
76 | _PROTOTYPE( void phys_insw, (U16_t port, phys_bytes buf, size_t count) );
|
---|
77 | _PROTOTYPE( void phys_outsb, (U16_t port, phys_bytes buf, size_t count) );
|
---|
78 | _PROTOTYPE( void phys_outsw, (U16_t port, phys_bytes buf, size_t count) );
|
---|
79 | _PROTOTYPE( void reset, (void) );
|
---|
80 | _PROTOTYPE( void level0, (void (*func)(void)) );
|
---|
81 | _PROTOTYPE( void monitor, (void) );
|
---|
82 | _PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );
|
---|
83 | _PROTOTYPE( unsigned long read_cpu_flags, (void) );
|
---|
84 |
|
---|
85 | /* mpx*.s */
|
---|
86 | _PROTOTYPE( void idle_task, (void) );
|
---|
87 | _PROTOTYPE( void restart, (void) );
|
---|
88 |
|
---|
89 | /* The following are never called from C (pure asm procs). */
|
---|
90 |
|
---|
91 | /* Exception handlers (real or protected mode), in numerical order. */
|
---|
92 | void _PROTOTYPE( int00, (void) ), _PROTOTYPE( divide_error, (void) );
|
---|
93 | void _PROTOTYPE( int01, (void) ), _PROTOTYPE( single_step_exception, (void) );
|
---|
94 | void _PROTOTYPE( int02, (void) ), _PROTOTYPE( nmi, (void) );
|
---|
95 | void _PROTOTYPE( int03, (void) ), _PROTOTYPE( breakpoint_exception, (void) );
|
---|
96 | void _PROTOTYPE( int04, (void) ), _PROTOTYPE( overflow, (void) );
|
---|
97 | void _PROTOTYPE( int05, (void) ), _PROTOTYPE( bounds_check, (void) );
|
---|
98 | void _PROTOTYPE( int06, (void) ), _PROTOTYPE( inval_opcode, (void) );
|
---|
99 | void _PROTOTYPE( int07, (void) ), _PROTOTYPE( copr_not_available, (void) );
|
---|
100 | void _PROTOTYPE( double_fault, (void) );
|
---|
101 | void _PROTOTYPE( copr_seg_overrun, (void) );
|
---|
102 | void _PROTOTYPE( inval_tss, (void) );
|
---|
103 | void _PROTOTYPE( segment_not_present, (void) );
|
---|
104 | void _PROTOTYPE( stack_exception, (void) );
|
---|
105 | void _PROTOTYPE( general_protection, (void) );
|
---|
106 | void _PROTOTYPE( page_fault, (void) );
|
---|
107 | void _PROTOTYPE( copr_error, (void) );
|
---|
108 |
|
---|
109 | /* Hardware interrupt handlers. */
|
---|
110 | _PROTOTYPE( void hwint00, (void) );
|
---|
111 | _PROTOTYPE( void hwint01, (void) );
|
---|
112 | _PROTOTYPE( void hwint02, (void) );
|
---|
113 | _PROTOTYPE( void hwint03, (void) );
|
---|
114 | _PROTOTYPE( void hwint04, (void) );
|
---|
115 | _PROTOTYPE( void hwint05, (void) );
|
---|
116 | _PROTOTYPE( void hwint06, (void) );
|
---|
117 | _PROTOTYPE( void hwint07, (void) );
|
---|
118 | _PROTOTYPE( void hwint08, (void) );
|
---|
119 | _PROTOTYPE( void hwint09, (void) );
|
---|
120 | _PROTOTYPE( void hwint10, (void) );
|
---|
121 | _PROTOTYPE( void hwint11, (void) );
|
---|
122 | _PROTOTYPE( void hwint12, (void) );
|
---|
123 | _PROTOTYPE( void hwint13, (void) );
|
---|
124 | _PROTOTYPE( void hwint14, (void) );
|
---|
125 | _PROTOTYPE( void hwint15, (void) );
|
---|
126 |
|
---|
127 | /* Software interrupt handlers, in numerical order. */
|
---|
128 | _PROTOTYPE( void trp, (void) );
|
---|
129 | _PROTOTYPE( void s_call, (void) ), _PROTOTYPE( p_s_call, (void) );
|
---|
130 | _PROTOTYPE( void level0_call, (void) );
|
---|
131 |
|
---|
132 | /* protect.c */
|
---|
133 | _PROTOTYPE( void prot_init, (void) );
|
---|
134 | _PROTOTYPE( void init_codeseg, (struct segdesc_s *segdp, phys_bytes base,
|
---|
135 | vir_bytes size, int privilege) );
|
---|
136 | _PROTOTYPE( void init_dataseg, (struct segdesc_s *segdp, phys_bytes base,
|
---|
137 | vir_bytes size, int privilege) );
|
---|
138 | _PROTOTYPE( phys_bytes seg2phys, (U16_t seg) );
|
---|
139 | _PROTOTYPE( void phys2seg, (u16_t *seg, vir_bytes *off, phys_bytes phys));
|
---|
140 | _PROTOTYPE( void enable_iop, (struct proc *pp) );
|
---|
141 | _PROTOTYPE( void alloc_segments, (struct proc *rp) );
|
---|
142 |
|
---|
143 | #endif /* PROTO_H */
|
---|
144 |
|
---|
145 |
|
---|