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( int kprintf, (const char *fmt, ...) );
|
---|
24 | _PROTOTYPE( void panic, (_CONST char *s, int n) );
|
---|
25 |
|
---|
26 | /* proc.c */
|
---|
27 | _PROTOTYPE( int sys_call, (int call_nr, int src_dst,
|
---|
28 | message *m_ptr, long bit_map) );
|
---|
29 | _PROTOTYPE( int lock_notify, (int src, int dst) );
|
---|
30 | _PROTOTYPE( int lock_send, (int dst, message *m_ptr) );
|
---|
31 | _PROTOTYPE( void lock_enqueue, (struct proc *rp) );
|
---|
32 | _PROTOTYPE( void lock_dequeue, (struct proc *rp) );
|
---|
33 | _PROTOTYPE( void balance_queues, (struct timer *tp) );
|
---|
34 | #if DEBUG_ENABLE_IPC_WARNINGS
|
---|
35 | _PROTOTYPE( int isokendpt_f, (char *file, int line, int e, int *p, int f));
|
---|
36 | #define isokendpt_d(e, p, f) isokendpt_f(__FILE__, __LINE__, (e), (p), (f))
|
---|
37 | #else
|
---|
38 | _PROTOTYPE( int isokendpt_f, (int e, int *p, int f) );
|
---|
39 | #define isokendpt_d(e, p, f) isokendpt_f((e), (p), (f))
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | /* start.c */
|
---|
43 | _PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds,
|
---|
44 | U16_t parmoff, U16_t parmsize) );
|
---|
45 |
|
---|
46 | /* system.c */
|
---|
47 | _PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
|
---|
48 | _PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
|
---|
49 | _PROTOTYPE( void cause_sig, (int proc_nr, int sig_nr) );
|
---|
50 | _PROTOTYPE( void sys_task, (void) );
|
---|
51 | _PROTOTYPE( void get_randomness, (int source) );
|
---|
52 | _PROTOTYPE( int virtual_copy, (struct vir_addr *src, struct vir_addr *dst,
|
---|
53 | vir_bytes bytes) );
|
---|
54 | #define numap_local(proc_nr, vir_addr, bytes) \
|
---|
55 | umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
|
---|
56 | _PROTOTYPE( phys_bytes umap_local, (struct proc *rp, int seg,
|
---|
57 | vir_bytes vir_addr, vir_bytes bytes) );
|
---|
58 | _PROTOTYPE( phys_bytes umap_remote, (struct proc *rp, int seg,
|
---|
59 | vir_bytes vir_addr, vir_bytes bytes) );
|
---|
60 | _PROTOTYPE( phys_bytes umap_bios, (struct proc *rp, vir_bytes vir_addr,
|
---|
61 | vir_bytes bytes) );
|
---|
62 | _PROTOTYPE( void clear_endpoint, (struct proc *rc) );
|
---|
63 |
|
---|
64 | #if (CHIP == INTEL)
|
---|
65 |
|
---|
66 | /* exception.c */
|
---|
67 | _PROTOTYPE( void exception, (unsigned vec_nr) );
|
---|
68 |
|
---|
69 | /* i8259.c */
|
---|
70 | _PROTOTYPE( void intr_init, (int mine) );
|
---|
71 | _PROTOTYPE( void intr_handle, (irq_hook_t *hook) );
|
---|
72 | _PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
|
---|
73 | irq_handler_t handler) );
|
---|
74 | _PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
|
---|
75 |
|
---|
76 | /* klib*.s */
|
---|
77 | _PROTOTYPE( void int86, (void) );
|
---|
78 | _PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,vir_bytes src_offset,
|
---|
79 | phys_clicks dst_clicks, vir_bytes dst_offset) );
|
---|
80 | _PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
|
---|
81 | _PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
|
---|
82 | _PROTOTYPE( u16_t mem_rdw, (U16_t segm, vir_bytes offset) );
|
---|
83 | _PROTOTYPE( void phys_copy, (phys_bytes source, phys_bytes dest,
|
---|
84 | phys_bytes count) );
|
---|
85 | _PROTOTYPE( void phys_memset, (phys_bytes source, unsigned long pattern,
|
---|
86 | phys_bytes count) );
|
---|
87 | _PROTOTYPE( void phys_insb, (U16_t port, phys_bytes buf, size_t count) );
|
---|
88 | _PROTOTYPE( void phys_insw, (U16_t port, phys_bytes buf, size_t count) );
|
---|
89 | _PROTOTYPE( void phys_outsb, (U16_t port, phys_bytes buf, size_t count) );
|
---|
90 | _PROTOTYPE( void phys_outsw, (U16_t port, phys_bytes buf, size_t count) );
|
---|
91 | _PROTOTYPE( void reset, (void) );
|
---|
92 | _PROTOTYPE( void level0, (void (*func)(void)) );
|
---|
93 | _PROTOTYPE( void monitor, (void) );
|
---|
94 | _PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );
|
---|
95 | _PROTOTYPE( unsigned long read_cr0, (void) );
|
---|
96 | _PROTOTYPE( void write_cr0, (unsigned long value) );
|
---|
97 | _PROTOTYPE( void write_cr3, (unsigned long value) );
|
---|
98 | _PROTOTYPE( unsigned long read_cpu_flags, (void) );
|
---|
99 |
|
---|
100 | /* mpx*.s */
|
---|
101 | _PROTOTYPE( void idle_task, (void) );
|
---|
102 | _PROTOTYPE( void restart, (void) );
|
---|
103 |
|
---|
104 | /* The following are never called from C (pure asm procs). */
|
---|
105 |
|
---|
106 | /* Exception handlers (real or protected mode), in numerical order. */
|
---|
107 | void _PROTOTYPE( int00, (void) ), _PROTOTYPE( divide_error, (void) );
|
---|
108 | void _PROTOTYPE( int01, (void) ), _PROTOTYPE( single_step_exception, (void) );
|
---|
109 | void _PROTOTYPE( int02, (void) ), _PROTOTYPE( nmi, (void) );
|
---|
110 | void _PROTOTYPE( int03, (void) ), _PROTOTYPE( breakpoint_exception, (void) );
|
---|
111 | void _PROTOTYPE( int04, (void) ), _PROTOTYPE( overflow, (void) );
|
---|
112 | void _PROTOTYPE( int05, (void) ), _PROTOTYPE( bounds_check, (void) );
|
---|
113 | void _PROTOTYPE( int06, (void) ), _PROTOTYPE( inval_opcode, (void) );
|
---|
114 | void _PROTOTYPE( int07, (void) ), _PROTOTYPE( copr_not_available, (void) );
|
---|
115 | void _PROTOTYPE( double_fault, (void) );
|
---|
116 | void _PROTOTYPE( copr_seg_overrun, (void) );
|
---|
117 | void _PROTOTYPE( inval_tss, (void) );
|
---|
118 | void _PROTOTYPE( segment_not_present, (void) );
|
---|
119 | void _PROTOTYPE( stack_exception, (void) );
|
---|
120 | void _PROTOTYPE( general_protection, (void) );
|
---|
121 | void _PROTOTYPE( page_fault, (void) );
|
---|
122 | void _PROTOTYPE( copr_error, (void) );
|
---|
123 |
|
---|
124 | /* Hardware interrupt handlers. */
|
---|
125 | _PROTOTYPE( void hwint00, (void) );
|
---|
126 | _PROTOTYPE( void hwint01, (void) );
|
---|
127 | _PROTOTYPE( void hwint02, (void) );
|
---|
128 | _PROTOTYPE( void hwint03, (void) );
|
---|
129 | _PROTOTYPE( void hwint04, (void) );
|
---|
130 | _PROTOTYPE( void hwint05, (void) );
|
---|
131 | _PROTOTYPE( void hwint06, (void) );
|
---|
132 | _PROTOTYPE( void hwint07, (void) );
|
---|
133 | _PROTOTYPE( void hwint08, (void) );
|
---|
134 | _PROTOTYPE( void hwint09, (void) );
|
---|
135 | _PROTOTYPE( void hwint10, (void) );
|
---|
136 | _PROTOTYPE( void hwint11, (void) );
|
---|
137 | _PROTOTYPE( void hwint12, (void) );
|
---|
138 | _PROTOTYPE( void hwint13, (void) );
|
---|
139 | _PROTOTYPE( void hwint14, (void) );
|
---|
140 | _PROTOTYPE( void hwint15, (void) );
|
---|
141 |
|
---|
142 | /* Software interrupt handlers, in numerical order. */
|
---|
143 | _PROTOTYPE( void trp, (void) );
|
---|
144 | _PROTOTYPE( void s_call, (void) ), _PROTOTYPE( p_s_call, (void) );
|
---|
145 | _PROTOTYPE( void level0_call, (void) );
|
---|
146 |
|
---|
147 | /* protect.c */
|
---|
148 | _PROTOTYPE( void prot_init, (void) );
|
---|
149 | _PROTOTYPE( void init_codeseg, (struct segdesc_s *segdp, phys_bytes base,
|
---|
150 | vir_bytes size, int privilege) );
|
---|
151 | _PROTOTYPE( void init_dataseg, (struct segdesc_s *segdp, phys_bytes base,
|
---|
152 | vir_bytes size, int privilege) );
|
---|
153 | _PROTOTYPE( phys_bytes seg2phys, (U16_t seg) );
|
---|
154 | _PROTOTYPE( void phys2seg, (u16_t *seg, vir_bytes *off, phys_bytes phys));
|
---|
155 | _PROTOTYPE( void enable_iop, (struct proc *pp) );
|
---|
156 | _PROTOTYPE( void alloc_segments, (struct proc *rp) );
|
---|
157 |
|
---|
158 | /* system/do_vm.c */
|
---|
159 | _PROTOTYPE( void vm_map_default, (struct proc *pp) );
|
---|
160 |
|
---|
161 | #endif /* (CHIP == INTEL) */
|
---|
162 |
|
---|
163 | #if (CHIP == M68000)
|
---|
164 | /* M68000 specific prototypes go here. */
|
---|
165 | #endif /* (CHIP == M68000) */
|
---|
166 |
|
---|
167 | #endif /* PROTO_H */
|
---|