2005-05-03 17:35:52 +02:00
|
|
|
/* Function prototypes. */
|
|
|
|
|
|
|
|
struct mproc;
|
|
|
|
struct stat;
|
|
|
|
struct mem_map;
|
2005-06-17 11:10:30 +02:00
|
|
|
struct memory;
|
2005-05-03 17:35:52 +02:00
|
|
|
|
2005-07-14 17:16:12 +02:00
|
|
|
#include <timers.h>
|
|
|
|
|
2005-05-03 17:35:52 +02:00
|
|
|
/* alloc.c */
|
|
|
|
_PROTOTYPE( phys_clicks alloc_mem, (phys_clicks clicks) );
|
|
|
|
_PROTOTYPE( void free_mem, (phys_clicks base, phys_clicks clicks) );
|
2005-06-17 11:10:30 +02:00
|
|
|
_PROTOTYPE( void mem_init, (struct memory *chunks, phys_clicks *free) );
|
2005-05-03 17:35:52 +02:00
|
|
|
#if ENABLE_SWAP
|
|
|
|
_PROTOTYPE( int swap_on, (char *file, u32_t offset, u32_t size) );
|
|
|
|
_PROTOTYPE( int swap_off, (void) );
|
|
|
|
_PROTOTYPE( void swap_in, (void) );
|
|
|
|
_PROTOTYPE( void swap_inqueue, (struct mproc *rmp) );
|
|
|
|
#else /* !SWAP */
|
|
|
|
#define swap_in() ((void)0)
|
|
|
|
#define swap_inqueue(rmp) ((void)0)
|
|
|
|
#endif /* !SWAP */
|
2005-10-18 19:21:11 +02:00
|
|
|
_PROTOTYPE(int mem_holes_copy, (struct hole *, size_t *, u32_t *) );
|
2005-05-03 17:35:52 +02:00
|
|
|
|
|
|
|
/* break.c */
|
|
|
|
_PROTOTYPE( int adjust, (struct mproc *rmp,
|
|
|
|
vir_clicks data_clicks, vir_bytes sp) );
|
|
|
|
_PROTOTYPE( int do_brk, (void) );
|
2006-06-30 16:35:38 +02:00
|
|
|
_PROTOTYPE( int real_brk, (struct mproc *pr, vir_bytes v) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int size_ok, (int file_type, vir_clicks tc, vir_clicks dc,
|
|
|
|
vir_clicks sc, vir_clicks dvir, vir_clicks s_vir) );
|
|
|
|
|
|
|
|
/* devio.c */
|
|
|
|
_PROTOTYPE( int do_dev_io, (void) );
|
|
|
|
_PROTOTYPE( int do_dev_io, (void) );
|
|
|
|
|
2005-05-13 10:57:08 +02:00
|
|
|
/* dmp.c */
|
|
|
|
_PROTOTYPE( int do_fkey_pressed, (void) );
|
|
|
|
|
2005-05-03 17:35:52 +02:00
|
|
|
/* exec.c */
|
|
|
|
_PROTOTYPE( int do_exec, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( int exec_newmem, (void) );
|
|
|
|
_PROTOTYPE( int do_execrestart, (void) );
|
|
|
|
_PROTOTYPE( void exec_restart, (struct mproc *rmp, int result) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( struct mproc *find_share, (struct mproc *mp_ign, Ino_t ino,
|
|
|
|
Dev_t dev, time_t ctime) );
|
|
|
|
|
|
|
|
/* forkexit.c */
|
|
|
|
_PROTOTYPE( int do_fork, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( int do_fork_nb, (void) );
|
2005-08-10 11:37:54 +02:00
|
|
|
_PROTOTYPE( int do_pm_exit, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int do_waitpid, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( void pm_exit, (struct mproc *rmp, int exit_status,
|
|
|
|
int for_trace) );
|
|
|
|
_PROTOTYPE (void tell_parent, (struct mproc *child) );
|
|
|
|
_PROTOTYPE( void real_cleanup, (struct mproc *rmp) );
|
2005-05-03 17:35:52 +02:00
|
|
|
|
|
|
|
/* getset.c */
|
|
|
|
_PROTOTYPE( int do_getset, (void) );
|
|
|
|
|
|
|
|
/* main.c */
|
2005-08-25 14:05:09 +02:00
|
|
|
_PROTOTYPE( int main, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
|
|
|
|
/* misc.c */
|
|
|
|
_PROTOTYPE( int do_reboot, (void) );
|
2006-03-10 17:10:05 +01:00
|
|
|
_PROTOTYPE( int do_procstat, (void) );
|
2006-05-19 14:19:37 +02:00
|
|
|
_PROTOTYPE( int do_sysuname, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int do_getsysinfo, (void) );
|
2005-05-19 11:36:44 +02:00
|
|
|
_PROTOTYPE( int do_getprocnr, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int do_svrctl, (void) );
|
2005-06-03 15:55:06 +02:00
|
|
|
_PROTOTYPE( int do_allocmem, (void) );
|
|
|
|
_PROTOTYPE( int do_freemem, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( int do_getsetpriority, (void) );
|
endpoint-aware conversion of servers.
'who', indicating caller number in pm and fs and some other servers, has
been removed in favour of 'who_e' (endpoint) and 'who_p' (proc nr.).
In both PM and FS, isokendpt() convert endpoints to process slot
numbers, returning OK if it was a valid and consistent endpoint number.
okendpt() does the same but panic()s if it doesn't succeed. (In PM,
this is pm_isok..)
pm and fs keep their own records of process endpoints in their proc tables,
which are needed to make kernel calls about those processes.
message field names have changed.
fs drivers are endpoints.
fs now doesn't try to get out of driver deadlock, as the protocol isn't
supposed to let that happen any more. (A warning is printed if ELOCKED
is detected though.)
fproc[].fp_task (indicating which driver the process is suspended on)
became an int.
PM and FS now get endpoint numbers of initial boot processes from the
kernel. These happen to be the same as the old proc numbers, to let
user processes reach them with the old numbers, but FS and PM don't know
that. All new processes after INIT, even after the generation number
wraps around, get endpoint numbers with generation 1 and higher, so
the first instances of the boot processes are the only processes ever
to have endpoint numbers in the old proc number range.
More return code checks of sys_* functions have been added.
IS has become endpoint-aware. Ditched the 'text' and 'data' fields
in the kernel dump (which show locations, not sizes, so aren't terribly
useful) in favour of the endpoint number. Proc number is still visible.
Some other dumps (e.g. dmap, rs) show endpoint numbers now too which got
the formatting changed.
PM reading segments using rw_seg() has changed - it uses other fields
in the message now instead of encoding the segment and process number and
fd in the fd field. For that it uses _read_pm() and _write_pm() which to
_taskcall()s directly in pm/misc.c.
PM now sys_exit()s itself on panic(), instead of sys_abort().
RS also talks in endpoints instead of process numbers.
2006-03-03 11:20:58 +01:00
|
|
|
|
2005-05-03 17:35:52 +02:00
|
|
|
|
|
|
|
#if (MACHINE == MACINTOSH)
|
|
|
|
_PROTOTYPE( phys_clicks start_click, (void) );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
_PROTOTYPE( void setreply, (int proc_nr, int result) );
|
|
|
|
|
|
|
|
/* signal.c */
|
|
|
|
_PROTOTYPE( int do_alarm, (void) );
|
|
|
|
_PROTOTYPE( int do_kill, (void) );
|
2005-06-01 16:31:00 +02:00
|
|
|
_PROTOTYPE( int ksig_pending, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int do_pause, (void) );
|
|
|
|
_PROTOTYPE( int set_alarm, (int proc_nr, int sec) );
|
|
|
|
_PROTOTYPE( int check_sig, (pid_t proc_id, int signo) );
|
|
|
|
_PROTOTYPE( void sig_proc, (struct mproc *rmp, int sig_nr) );
|
|
|
|
_PROTOTYPE( int do_sigaction, (void) );
|
|
|
|
_PROTOTYPE( int do_sigpending, (void) );
|
|
|
|
_PROTOTYPE( int do_sigprocmask, (void) );
|
|
|
|
_PROTOTYPE( int do_sigreturn, (void) );
|
|
|
|
_PROTOTYPE( int do_sigsuspend, (void) );
|
|
|
|
_PROTOTYPE( void check_pending, (struct mproc *rmp) );
|
|
|
|
|
2005-05-31 11:50:51 +02:00
|
|
|
/* time.c */
|
|
|
|
_PROTOTYPE( int do_stime, (void) );
|
|
|
|
_PROTOTYPE( int do_time, (void) );
|
2005-06-01 16:31:00 +02:00
|
|
|
_PROTOTYPE( int do_times, (void) );
|
2005-07-06 09:08:36 +02:00
|
|
|
_PROTOTYPE( int do_gettimeofday, (void) );
|
2005-05-31 11:50:51 +02:00
|
|
|
|
2005-07-14 17:16:12 +02:00
|
|
|
/* timers.c */
|
|
|
|
_PROTOTYPE( void pm_set_timer, (timer_t *tp, int delta,
|
|
|
|
tmr_func_t watchdog, int arg));
|
|
|
|
_PROTOTYPE( void pm_expire_timers, (clock_t now));
|
|
|
|
_PROTOTYPE( void pm_cancel_timer, (timer_t *tp));
|
|
|
|
|
2005-05-03 17:35:52 +02:00
|
|
|
/* trace.c */
|
|
|
|
_PROTOTYPE( int do_trace, (void) );
|
|
|
|
_PROTOTYPE( void stop_proc, (struct mproc *rmp, int sig_nr) );
|
|
|
|
|
|
|
|
/* utility.c */
|
2005-05-13 10:57:08 +02:00
|
|
|
_PROTOTYPE( pid_t get_free_pid, (void) );
|
2005-05-03 17:35:52 +02:00
|
|
|
_PROTOTYPE( int no_sys, (void) );
|
2005-06-01 16:31:00 +02:00
|
|
|
_PROTOTYPE( void panic, (char *who, char *mess, int num) );
|
|
|
|
_PROTOTYPE( int get_stack_ptr, (int proc_nr, vir_bytes *sp) );
|
2005-05-13 10:57:08 +02:00
|
|
|
_PROTOTYPE( int get_mem_map, (int proc_nr, struct mem_map *mem_map) );
|
2005-06-17 11:10:30 +02:00
|
|
|
_PROTOTYPE( char *find_param, (const char *key));
|
2005-07-01 19:58:29 +02:00
|
|
|
_PROTOTYPE( int proc_from_pid, (pid_t p));
|
endpoint-aware conversion of servers.
'who', indicating caller number in pm and fs and some other servers, has
been removed in favour of 'who_e' (endpoint) and 'who_p' (proc nr.).
In both PM and FS, isokendpt() convert endpoints to process slot
numbers, returning OK if it was a valid and consistent endpoint number.
okendpt() does the same but panic()s if it doesn't succeed. (In PM,
this is pm_isok..)
pm and fs keep their own records of process endpoints in their proc tables,
which are needed to make kernel calls about those processes.
message field names have changed.
fs drivers are endpoints.
fs now doesn't try to get out of driver deadlock, as the protocol isn't
supposed to let that happen any more. (A warning is printed if ELOCKED
is detected though.)
fproc[].fp_task (indicating which driver the process is suspended on)
became an int.
PM and FS now get endpoint numbers of initial boot processes from the
kernel. These happen to be the same as the old proc numbers, to let
user processes reach them with the old numbers, but FS and PM don't know
that. All new processes after INIT, even after the generation number
wraps around, get endpoint numbers with generation 1 and higher, so
the first instances of the boot processes are the only processes ever
to have endpoint numbers in the old proc number range.
More return code checks of sys_* functions have been added.
IS has become endpoint-aware. Ditched the 'text' and 'data' fields
in the kernel dump (which show locations, not sizes, so aren't terribly
useful) in favour of the endpoint number. Proc number is still visible.
Some other dumps (e.g. dmap, rs) show endpoint numbers now too which got
the formatting changed.
PM reading segments using rw_seg() has changed - it uses other fields
in the message now instead of encoding the segment and process number and
fd in the fd field. For that it uses _read_pm() and _write_pm() which to
_taskcall()s directly in pm/misc.c.
PM now sys_exit()s itself on panic(), instead of sys_abort().
RS also talks in endpoints instead of process numbers.
2006-03-03 11:20:58 +01:00
|
|
|
_PROTOTYPE( int pm_isokendpt, (int ep, int *proc));
|
2005-05-03 17:35:52 +02:00
|
|
|
|