slight tuning of /etc/mk situation when making release.
[minix.git] / kernel / proto.h
blob1d03c6f2601ad3a3043d7fab1b7afddb78e7774c
1 /* Function prototypes. */
3 #ifndef PROTO_H
4 #define PROTO_H
6 #include <minix/safecopies.h>
7 #include <archtypes.h>
8 #include <a.out.h>
10 /* Struct declarations. */
11 struct proc;
12 struct timer;
14 /* clock.c */
15 _PROTOTYPE( void clock_init, (void) );
16 _PROTOTYPE( clock_t get_uptime, (void) );
17 _PROTOTYPE( void set_timer, (struct timer *tp, clock_t t, tmr_func_t f) );
18 _PROTOTYPE( void reset_timer, (struct timer *tp) );
19 _PROTOTYPE( void ser_dump_proc, (void) );
21 _PROTOTYPE( void cycles_accounting_init, (void) );
23 * This functions start and stop accounting for process, kernel or idle cycles.
24 * It inherently have to account for some kernel cycles for process too,
25 * therefore it should be called asap after trapping to kernel and as late as
26 * possible before returning to userspace. These function is architecture
27 * dependent
29 _PROTOTYPE( void cycles_accounting_stop, (struct proc * p) );
30 /* this is a wrapper to make calling it from assembly easier */
31 _PROTOTYPE( void cycles_accounting_stop_idle, (void) );
33 /* main.c */
34 _PROTOTYPE( void main, (void) );
35 _PROTOTYPE( void prepare_shutdown, (int how) );
36 _PROTOTYPE( void minix_shutdown, (struct timer *tp) );
38 /* utility.c */
39 _PROTOTYPE( int kprintf, (const char *fmt, ...) );
40 _PROTOTYPE( void minix_panic, (char *s, int n) );
42 /* proc.c */
43 _PROTOTYPE( int do_ipc, (int call_nr, int src_dst,
44 message *m_ptr, long bit_map) );
45 _PROTOTYPE( int mini_notify, (struct proc *src, endpoint_t dst) );
46 _PROTOTYPE( void enqueue, (struct proc *rp) );
47 _PROTOTYPE( void dequeue, (struct proc *rp) );
48 _PROTOTYPE( void balance_queues, (struct timer *tp) );
49 _PROTOTYPE( struct proc * schedcheck, (void) );
50 _PROTOTYPE( struct proc * arch_finish_schedcheck, (void) );
51 _PROTOTYPE( struct proc *endpoint_lookup, (endpoint_t ep) );
52 #if DEBUG_ENABLE_IPC_WARNINGS
53 _PROTOTYPE( int isokendpt_f, (char *file, int line, endpoint_t e, int *p, int f));
54 #define isokendpt_d(e, p, f) isokendpt_f(__FILE__, __LINE__, (e), (p), (f))
55 #else
56 _PROTOTYPE( int isokendpt_f, (endpoint_t e, int *p, int f) );
57 #define isokendpt_d(e, p, f) isokendpt_f((e), (p), (f))
58 #endif
60 /* start.c */
61 _PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds,
62 U16_t parmoff, U16_t parmsize) );
64 /* system.c */
65 _PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
66 _PROTOTYPE( void set_sendto_bit, (struct proc *rc, int id) );
67 _PROTOTYPE( void unset_sendto_bit, (struct proc *rc, int id) );
68 _PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
69 _PROTOTYPE( void cause_sig, (proc_nr_t proc_nr, int sig_nr) );
70 _PROTOTYPE( void sig_delay_done, (struct proc *rp) );
71 _PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) );
72 _PROTOTYPE( void system_init, (void) );
73 #define numap_local(proc_nr, vir_addr, bytes) \
74 umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
75 _PROTOTYPE( phys_bytes umap_grant, (struct proc *, cp_grant_id_t, vir_bytes));
76 _PROTOTYPE( void clear_endpoint, (struct proc *rc) );
77 _PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes));
78 _PROTOTYPE( void kernel_call_resume, (struct proc *p));
80 /* system/do_newmap.c */
81 _PROTOTYPE( int newmap, (struct proc * caller, struct proc *rp,
82 struct mem_map *map_ptr));
84 /* system/do_vtimer.c */
85 _PROTOTYPE( void vtimer_check, (struct proc *rp) );
87 /* interrupt.c */
88 _PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
89 irq_handler_t handler) );
90 _PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
91 _PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
92 _PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
94 /* debug.c */
95 #if DEBUG_SCHED_CHECK
96 #define CHECK_RUNQUEUES check_runqueues_f(__FILE__, __LINE__)
97 _PROTOTYPE( void check_runqueues_f, (char *file, int line) );
98 #endif
99 _PROTOTYPE( char *rtsflagstr, (int flags) );
100 _PROTOTYPE( char *miscflagstr, (int flags) );
102 /* system/do_safemap.c */
103 _PROTOTYPE( int map_invoke_vm, (struct proc * caller, int req_type,
104 endpoint_t end_d, int seg_d, vir_bytes off_d,
105 endpoint_t end_s, int seg_s, vir_bytes off_s,
106 size_t size, int flag));
108 /* system/do_safecopy.c */
109 _PROTOTYPE( int verify_grant, (endpoint_t, endpoint_t,
110 cp_grant_id_t, vir_bytes, int,
111 vir_bytes, vir_bytes *, endpoint_t *));
113 /* system/do_sysctl.c */
114 _PROTOTYPE( int do_sysctl, (struct proc * caller, message *m));
116 #if SPROFILE
117 /* profile.c */
118 _PROTOTYPE( void init_profile_clock, (u32_t) );
119 _PROTOTYPE( void stop_profile_clock, (void) );
120 #endif
122 /* functions defined in architecture-dependent files. */
123 _PROTOTYPE( void prot_init, (void) );
124 _PROTOTYPE( phys_bytes phys_copy, (phys_bytes source, phys_bytes dest,
125 phys_bytes count) );
126 _PROTOTYPE( void phys_copy_fault, (void));
127 _PROTOTYPE( void phys_copy_fault_in_kernel, (void));
128 #define virtual_copy(src, dst, bytes) \
129 virtual_copy_f(NULL, src, dst, bytes, 0)
130 #define virtual_copy_vmcheck(caller, src, dst, bytes) \
131 virtual_copy_f(caller, src, dst, bytes, 1)
132 _PROTOTYPE( int virtual_copy_f, (struct proc * caller,
133 struct vir_addr *src, struct vir_addr *dst,
134 vir_bytes bytes, int vmcheck) );
135 _PROTOTYPE( int data_copy, (endpoint_t from, vir_bytes from_addr,
136 endpoint_t to, vir_bytes to_addr, size_t bytes));
137 _PROTOTYPE( int data_copy_vmcheck, (struct proc *,
138 endpoint_t from, vir_bytes from_addr,
139 endpoint_t to, vir_bytes to_addr, size_t bytes));
140 _PROTOTYPE( void alloc_segments, (struct proc *rp) );
141 _PROTOTYPE( void vm_init, (struct proc *first) );
142 _PROTOTYPE( phys_bytes umap_local, (register struct proc *rp, int seg,
143 vir_bytes vir_addr, vir_bytes bytes));
144 _PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,
145 vir_bytes src_offset, phys_clicks dst_clicks, vir_bytes dst_offset));
146 _PROTOTYPE( phys_bytes umap_remote, (struct proc* rp, int seg,
147 vir_bytes vir_addr, vir_bytes bytes) );
148 _PROTOTYPE( phys_bytes umap_virtual, (struct proc* rp,
149 int seg, vir_bytes vir_addr, vir_bytes bytes) );
150 _PROTOTYPE( phys_bytes seg2phys, (U16_t) );
151 _PROTOTYPE( int vm_phys_memset, (phys_bytes source, u8_t pattern,
152 phys_bytes count) );
153 _PROTOTYPE( vir_bytes alloc_remote_segment, (u32_t *, segframe_t *,
154 int, phys_bytes, vir_bytes, int));
155 _PROTOTYPE( int intr_init, (int, int) );
156 _PROTOTYPE( int intr_disabled, (void) );
157 _PROTOTYPE( void halt_cpu, (void) );
158 _PROTOTYPE( void arch_init, (void) );
159 _PROTOTYPE( void ser_putc, (char) );
160 _PROTOTYPE( void arch_shutdown, (int) );
161 _PROTOTYPE( void arch_monitor, (void) );
162 _PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) );
163 _PROTOTYPE( void restart, (void) );
164 _PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );
165 _PROTOTYPE( int arch_init_profile_clock, (u32_t freq) );
166 _PROTOTYPE( void arch_stop_profile_clock, (void) );
167 _PROTOTYPE( void arch_ack_profile_clock, (void) );
168 _PROTOTYPE( void do_ser_debug, (void) );
169 _PROTOTYPE( int arch_get_params, (char *parm, int max));
170 _PROTOTYPE( int arch_set_params, (char *parm, int max));
171 _PROTOTYPE( void arch_pre_exec, (struct proc *pr, u32_t, u32_t));
172 _PROTOTYPE( int arch_umap, (struct proc *pr, vir_bytes, vir_bytes,
173 int, phys_bytes *));
174 _PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p));
175 _PROTOTYPE( int vm_contiguous, (struct proc *targetproc, u32_t vir_buf, size_t count));
176 _PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
177 _PROTOTYPE( int vm_lookup, (struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
178 _PROTOTYPE( int delivermsg, (struct proc *target));
179 _PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
180 _PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,
181 phys_bytes *len, int *flags));
182 _PROTOTYPE( int arch_phys_map_reply, (int index, vir_bytes addr));
183 _PROTOTYPE( int arch_enable_paging, (void));
185 _PROTOTYPE( int copy_msg_from_user, (struct proc * p, message * user_mbuf,
186 message * dst));
187 _PROTOTYPE( int copy_msg_to_user, (struct proc * p, message * src,
188 message * user_mbuf));
189 _PROTOTYPE(void switch_address_space, (struct proc * p));
190 #endif /* PROTO_H */