00001
00002
00003 #ifndef PROTO_H
00004 #define PROTO_H
00005
00006 #include <minix/safecopies.h>
00007 #include <archtypes.h>
00008 #include <a.out.h>
00009
00010
00011 struct proc;
00012 struct timer;
00013
00014
00015 _PROTOTYPE( void clock_task, (void) );
00016 _PROTOTYPE( clock_t get_uptime, (void) );
00017 _PROTOTYPE( void set_timer, (struct timer *tp, clock_t t, tmr_func_t f) );
00018 _PROTOTYPE( void reset_timer, (struct timer *tp) );
00019 _PROTOTYPE( void ser_dump_proc, (void) );
00020
00021
00022 _PROTOTYPE( void main, (void) );
00023 _PROTOTYPE( void prepare_shutdown, (int how) );
00024 _PROTOTYPE( void minix_shutdown, (struct timer *tp) );
00025
00026
00027 _PROTOTYPE( int kprintf, (const char *fmt, ...) );
00028 _PROTOTYPE( void minix_panic, (char *s, int n) );
00029
00030
00031 _PROTOTYPE( int sys_call, (int call_nr, int src_dst,
00032 message *m_ptr, long bit_map) );
00033 _PROTOTYPE( int lock_notify, (int src, int dst) );
00034 _PROTOTYPE( int mini_notify, (struct proc *src, endpoint_t dst) );
00035 _PROTOTYPE( int lock_send, (int dst, message *m_ptr) );
00036 _PROTOTYPE( void enqueue, (struct proc *rp) );
00037 _PROTOTYPE( void dequeue, (struct proc *rp) );
00038 _PROTOTYPE( void balance_queues, (struct timer *tp) );
00039 _PROTOTYPE( struct proc * schedcheck, (void) );
00040 _PROTOTYPE( struct proc * arch_finish_schedcheck, (void) );
00041 _PROTOTYPE( struct proc *endpoint_lookup, (endpoint_t ep) );
00042 #if DEBUG_ENABLE_IPC_WARNINGS
00043 _PROTOTYPE( int isokendpt_f, (char *file, int line, endpoint_t e, int *p, int f));
00044 #define isokendpt_d(e, p, f) isokendpt_f(__FILE__, __LINE__, (e), (p), (f))
00045 #else
00046 _PROTOTYPE( int isokendpt_f, (endpoint_t e, int *p, int f) );
00047 #define isokendpt_d(e, p, f) isokendpt_f((e), (p), (f))
00048 #endif
00049
00050
00051 _PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds,
00052 U16_t parmoff, U16_t parmsize) );
00053
00054
00055 _PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
00056 _PROTOTYPE( void set_sendto_bit, (struct proc *rc, int id) );
00057 _PROTOTYPE( void unset_sendto_bit, (struct proc *rc, int id) );
00058 _PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
00059 _PROTOTYPE( void cause_sig, (proc_nr_t proc_nr, int sig_nr) );
00060 _PROTOTYPE( void sig_delay_done, (struct proc *rp) );
00061 _PROTOTYPE( void sys_task, (void) );
00062 #define numap_local(proc_nr, vir_addr, bytes) \
00063 umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
00064 _PROTOTYPE( phys_bytes umap_grant, (struct proc *, cp_grant_id_t,
00065 vir_bytes));
00066 _PROTOTYPE( void clear_endpoint, (struct proc *rc) );
00067 _PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes));
00068
00069
00070 _PROTOTYPE( int newmap, (struct proc *rp, struct mem_map *map_ptr) );
00071
00072
00073 _PROTOTYPE( void vtimer_check, (struct proc *rp) );
00074
00075
00076 _PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
00077 irq_handler_t handler) );
00078 _PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
00079 _PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
00080 _PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
00081
00082
00083 #if DEBUG_SCHED_CHECK
00084 #define CHECK_RUNQUEUES check_runqueues_f(__FILE__, __LINE__)
00085 _PROTOTYPE( void check_runqueues_f, (char *file, int line) );
00086 #endif
00087 _PROTOTYPE( char *rtsflagstr, (int flags) );
00088 _PROTOTYPE( char *miscflagstr, (int flags) );
00089
00090
00091 _PROTOTYPE( int map_invoke_vm, (int req_type,
00092 endpoint_t end_d, int seg_d, vir_bytes off_d,
00093 endpoint_t end_s, int seg_s, vir_bytes off_s,
00094 size_t size, int flag));
00095
00096
00097 _PROTOTYPE( int verify_grant, (endpoint_t, endpoint_t, cp_grant_id_t, vir_bytes,
00098 int, vir_bytes, vir_bytes *, endpoint_t *));
00099
00100
00101 _PROTOTYPE( int do_sysctl, (message *m));
00102
00103 #if SPROFILE
00104
00105 _PROTOTYPE( void init_profile_clock, (u32_t) );
00106 _PROTOTYPE( void stop_profile_clock, (void) );
00107 #endif
00108
00109
00110 _PROTOTYPE( void prot_init, (void) );
00111 _PROTOTYPE( phys_bytes phys_copy, (phys_bytes source, phys_bytes dest,
00112 phys_bytes count) );
00113 _PROTOTYPE( void phys_copy_fault, (void));
00114 _PROTOTYPE( void phys_copy_fault_in_kernel, (void));
00115 #define virtual_copy(src, dst, bytes) virtual_copy_f(src, dst, bytes, 0)
00116 #define virtual_copy_vmcheck(src, dst, bytes) virtual_copy_f(src, dst, bytes, 1)
00117 _PROTOTYPE( int virtual_copy_f, (struct vir_addr *src, struct vir_addr *dst,
00118 vir_bytes bytes, int vmcheck) );
00119 _PROTOTYPE( int data_copy, (endpoint_t from, vir_bytes from_addr,
00120 endpoint_t to, vir_bytes to_addr, size_t bytes));
00121 _PROTOTYPE( int data_copy_vmcheck, (endpoint_t from, vir_bytes from_addr,
00122 endpoint_t to, vir_bytes to_addr, size_t bytes));
00123 _PROTOTYPE( void alloc_segments, (struct proc *rp) );
00124 _PROTOTYPE( void vm_init, (struct proc *first) );
00125 _PROTOTYPE( phys_bytes umap_local, (register struct proc *rp, int seg,
00126 vir_bytes vir_addr, vir_bytes bytes));
00127 _PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,
00128 vir_bytes src_offset, phys_clicks dst_clicks, vir_bytes dst_offset));
00129 _PROTOTYPE( phys_bytes umap_remote, (struct proc* rp, int seg,
00130 vir_bytes vir_addr, vir_bytes bytes) );
00131 _PROTOTYPE( phys_bytes umap_virtual, (struct proc* rp, int seg,
00132 vir_bytes vir_addr, vir_bytes bytes) );
00133 _PROTOTYPE( phys_bytes seg2phys, (U16_t) );
00134 _PROTOTYPE( int vm_phys_memset, (phys_bytes source, u8_t pattern,
00135 phys_bytes count) );
00136 _PROTOTYPE( vir_bytes alloc_remote_segment, (u32_t *, segframe_t *,
00137 int, phys_bytes, vir_bytes, int));
00138 _PROTOTYPE( int intr_init, (int, int) );
00139 _PROTOTYPE( int intr_disabled, (void) );
00140 _PROTOTYPE( void halt_cpu, (void) );
00141 _PROTOTYPE( void arch_init, (void) );
00142 _PROTOTYPE( void ser_putc, (char) );
00143 _PROTOTYPE( void arch_shutdown, (int) );
00144 _PROTOTYPE( void arch_monitor, (void) );
00145 _PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) );
00146 _PROTOTYPE( void restart, (void) );
00147 _PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );
00148 _PROTOTYPE( int arch_init_profile_clock, (u32_t freq) );
00149 _PROTOTYPE( void arch_stop_profile_clock, (void) );
00150 _PROTOTYPE( void arch_ack_profile_clock, (void) );
00151 _PROTOTYPE( void do_ser_debug, (void) );
00152 _PROTOTYPE( int arch_get_params, (char *parm, int max));
00153 _PROTOTYPE( int arch_set_params, (char *parm, int max));
00154 _PROTOTYPE( int arch_pre_exec, (struct proc *pr, u32_t, u32_t));
00155 _PROTOTYPE( int arch_umap, (struct proc *pr, vir_bytes, vir_bytes,
00156 int, phys_bytes *));
00157 _PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p));
00158 _PROTOTYPE( int vm_contiguous, (struct proc *targetproc, u32_t vir_buf, size_t count));
00159 _PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
00160 _PROTOTYPE( int vm_lookup, (struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
00161 _PROTOTYPE( int delivermsg, (struct proc *target));
00162 _PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
00163 _PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,
00164 phys_bytes *len, int *flags));
00165 _PROTOTYPE( int arch_phys_map_reply, (int index, vir_bytes addr));
00166 _PROTOTYPE( int arch_enable_paging, (void));
00167
00168 #endif