retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -19,19 +19,19 @@
|
||||
|
||||
#define US 1000000 /* shortcut for microseconds per second */
|
||||
|
||||
FORWARD clock_t ticks_from_timeval(struct timeval *tv);
|
||||
FORWARD void timeval_from_ticks(struct timeval *tv, clock_t ticks);
|
||||
FORWARD int is_sane_timeval(struct timeval *tv);
|
||||
FORWARD void getset_vtimer(struct mproc *mp, int nwhich, struct
|
||||
static clock_t ticks_from_timeval(struct timeval *tv);
|
||||
static void timeval_from_ticks(struct timeval *tv, clock_t ticks);
|
||||
static int is_sane_timeval(struct timeval *tv);
|
||||
static void getset_vtimer(struct mproc *mp, int nwhich, struct
|
||||
itimerval *value, struct itimerval *ovalue);
|
||||
FORWARD void get_realtimer(struct mproc *mp, struct itimerval *value);
|
||||
FORWARD void set_realtimer(struct mproc *mp, struct itimerval *value);
|
||||
FORWARD void cause_sigalrm(struct timer *tp);
|
||||
static void get_realtimer(struct mproc *mp, struct itimerval *value);
|
||||
static void set_realtimer(struct mproc *mp, struct itimerval *value);
|
||||
static void cause_sigalrm(struct timer *tp);
|
||||
|
||||
/*===========================================================================*
|
||||
* ticks_from_timeval *
|
||||
*===========================================================================*/
|
||||
PRIVATE clock_t ticks_from_timeval(tv)
|
||||
static clock_t ticks_from_timeval(tv)
|
||||
struct timeval *tv;
|
||||
{
|
||||
clock_t ticks;
|
||||
@@ -69,7 +69,7 @@ struct timeval *tv;
|
||||
/*===========================================================================*
|
||||
* timeval_from_ticks *
|
||||
*===========================================================================*/
|
||||
PRIVATE void timeval_from_ticks(tv, ticks)
|
||||
static void timeval_from_ticks(tv, ticks)
|
||||
struct timeval *tv;
|
||||
clock_t ticks;
|
||||
{
|
||||
@@ -80,7 +80,7 @@ clock_t ticks;
|
||||
/*===========================================================================*
|
||||
* is_sane_timeval *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_sane_timeval(tv)
|
||||
static int is_sane_timeval(tv)
|
||||
struct timeval *tv;
|
||||
{
|
||||
/* This imposes a reasonable time value range for setitimer. */
|
||||
@@ -91,7 +91,7 @@ struct timeval *tv;
|
||||
/*===========================================================================*
|
||||
* do_itimer *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_itimer()
|
||||
int do_itimer()
|
||||
{
|
||||
struct itimerval ovalue, value; /* old and new interval timers */
|
||||
int setval, getval; /* set and/or retrieve the values? */
|
||||
@@ -157,7 +157,7 @@ PUBLIC int do_itimer()
|
||||
/*===========================================================================*
|
||||
* do_alarm *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_alarm()
|
||||
int do_alarm()
|
||||
{
|
||||
struct itimerval value, ovalue;
|
||||
int remaining; /* previous time left in seconds */
|
||||
@@ -181,7 +181,7 @@ PUBLIC int do_alarm()
|
||||
/*===========================================================================*
|
||||
* getset_vtimer *
|
||||
*===========================================================================*/
|
||||
PRIVATE void getset_vtimer(rmp, which, value, ovalue)
|
||||
static void getset_vtimer(rmp, which, value, ovalue)
|
||||
struct mproc *rmp;
|
||||
int which;
|
||||
struct itimerval *value;
|
||||
@@ -246,7 +246,7 @@ struct itimerval *ovalue;
|
||||
/*===========================================================================*
|
||||
* check_vtimer *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_vtimer(proc_nr, sig)
|
||||
void check_vtimer(proc_nr, sig)
|
||||
int proc_nr;
|
||||
int sig;
|
||||
{
|
||||
@@ -272,7 +272,7 @@ int sig;
|
||||
/*===========================================================================*
|
||||
* get_realtimer *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_realtimer(rmp, value)
|
||||
static void get_realtimer(rmp, value)
|
||||
struct mproc *rmp;
|
||||
struct itimerval *value;
|
||||
{
|
||||
@@ -307,7 +307,7 @@ struct itimerval *value;
|
||||
/*===========================================================================*
|
||||
* set_realtimer *
|
||||
*===========================================================================*/
|
||||
PRIVATE void set_realtimer(rmp, value)
|
||||
static void set_realtimer(rmp, value)
|
||||
struct mproc *rmp;
|
||||
struct itimerval *value;
|
||||
{
|
||||
@@ -329,7 +329,7 @@ struct itimerval *value;
|
||||
/*===========================================================================*
|
||||
* set_alarm *
|
||||
*===========================================================================*/
|
||||
PUBLIC void set_alarm(rmp, ticks)
|
||||
void set_alarm(rmp, ticks)
|
||||
struct mproc *rmp; /* process that wants the alarm */
|
||||
clock_t ticks; /* how many ticks delay before the signal */
|
||||
{
|
||||
@@ -345,7 +345,7 @@ clock_t ticks; /* how many ticks delay before the signal */
|
||||
/*===========================================================================*
|
||||
* cause_sigalrm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void cause_sigalrm(tp)
|
||||
static void cause_sigalrm(tp)
|
||||
struct timer *tp;
|
||||
{
|
||||
int proc_nr_n;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/*===========================================================================*
|
||||
* do_brk *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_brk()
|
||||
int do_brk()
|
||||
{
|
||||
int r;
|
||||
/* Entry point to brk(addr) system call. */
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/*===========================================================================*
|
||||
* do_exec *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_exec()
|
||||
int do_exec()
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -58,7 +58,7 @@ PUBLIC int do_exec()
|
||||
/*===========================================================================*
|
||||
* do_exec_newmem *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_exec_newmem()
|
||||
int do_exec_newmem()
|
||||
{
|
||||
int proc_e, proc_n, allow_setuid;
|
||||
char *ptr;
|
||||
@@ -131,7 +131,7 @@ PUBLIC int do_exec_newmem()
|
||||
/*===========================================================================*
|
||||
* do_execrestart *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_execrestart()
|
||||
int do_execrestart()
|
||||
{
|
||||
int proc_e, proc_n, result;
|
||||
struct mproc *rmp;
|
||||
@@ -157,7 +157,7 @@ PUBLIC int do_execrestart()
|
||||
/*===========================================================================*
|
||||
* exec_restart *
|
||||
*===========================================================================*/
|
||||
PUBLIC void exec_restart(rmp, result, pc)
|
||||
void exec_restart(rmp, result, pc)
|
||||
struct mproc *rmp;
|
||||
int result;
|
||||
vir_bytes pc;
|
||||
|
||||
@@ -31,17 +31,17 @@
|
||||
|
||||
#define LAST_FEW 2 /* last few slots reserved for superuser */
|
||||
|
||||
FORWARD void zombify(struct mproc *rmp);
|
||||
FORWARD void check_parent(struct mproc *child, int try_cleanup);
|
||||
FORWARD void tell_parent(struct mproc *child);
|
||||
FORWARD void tell_tracer(struct mproc *child);
|
||||
FORWARD void tracer_died(struct mproc *child);
|
||||
FORWARD void cleanup(register struct mproc *rmp);
|
||||
static void zombify(struct mproc *rmp);
|
||||
static void check_parent(struct mproc *child, int try_cleanup);
|
||||
static void tell_parent(struct mproc *child);
|
||||
static void tell_tracer(struct mproc *child);
|
||||
static void tracer_died(struct mproc *child);
|
||||
static void cleanup(register struct mproc *rmp);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_fork *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fork()
|
||||
int do_fork()
|
||||
{
|
||||
/* The process pointed to by 'mp' has forked. Create a child process. */
|
||||
register struct mproc *rmp; /* pointer to parent */
|
||||
@@ -139,7 +139,7 @@ PUBLIC int do_fork()
|
||||
/*===========================================================================*
|
||||
* do_srv_fork *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_srv_fork()
|
||||
int do_srv_fork()
|
||||
{
|
||||
/* The process pointed to by 'mp' has forked. Create a child process. */
|
||||
register struct mproc *rmp; /* pointer to parent */
|
||||
@@ -234,7 +234,7 @@ PUBLIC int do_srv_fork()
|
||||
/*===========================================================================*
|
||||
* do_exit *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_exit()
|
||||
int do_exit()
|
||||
{
|
||||
/* Perform the exit(status) system call. The real work is done by exit_proc(),
|
||||
* which is also called when a process is killed by a signal. System processes
|
||||
@@ -255,7 +255,7 @@ PUBLIC int do_exit()
|
||||
/*===========================================================================*
|
||||
* exit_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void exit_proc(rmp, exit_status, dump_core)
|
||||
void exit_proc(rmp, exit_status, dump_core)
|
||||
register struct mproc *rmp; /* pointer to the process to be terminated */
|
||||
int exit_status; /* the process' exit status (for parent) */
|
||||
int dump_core; /* flag indicating whether to dump core */
|
||||
@@ -385,7 +385,7 @@ int dump_core; /* flag indicating whether to dump core */
|
||||
/*===========================================================================*
|
||||
* exit_restart *
|
||||
*===========================================================================*/
|
||||
PUBLIC void exit_restart(rmp, dump_core)
|
||||
void exit_restart(rmp, dump_core)
|
||||
struct mproc *rmp; /* pointer to the process being terminated */
|
||||
int dump_core; /* flag indicating whether to dump core */
|
||||
{
|
||||
@@ -445,7 +445,7 @@ int dump_core; /* flag indicating whether to dump core */
|
||||
/*===========================================================================*
|
||||
* do_waitpid *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_waitpid()
|
||||
int do_waitpid()
|
||||
{
|
||||
/* A process wants to wait for a child to terminate. If a child is already
|
||||
* waiting, go clean it up and let this WAIT call terminate. Otherwise,
|
||||
@@ -535,7 +535,7 @@ PUBLIC int do_waitpid()
|
||||
/*===========================================================================*
|
||||
* wait_test *
|
||||
*===========================================================================*/
|
||||
PUBLIC int wait_test(rmp, child)
|
||||
int wait_test(rmp, child)
|
||||
struct mproc *rmp; /* process that may be waiting */
|
||||
struct mproc *child; /* process that may be waited for */
|
||||
{
|
||||
@@ -557,7 +557,7 @@ struct mproc *child; /* process that may be waited for */
|
||||
/*===========================================================================*
|
||||
* zombify *
|
||||
*===========================================================================*/
|
||||
PRIVATE void zombify(rmp)
|
||||
static void zombify(rmp)
|
||||
struct mproc *rmp;
|
||||
{
|
||||
/* Zombify a process. First check if the exiting process is traced by a process
|
||||
@@ -595,7 +595,7 @@ struct mproc *rmp;
|
||||
/*===========================================================================*
|
||||
* check_parent *
|
||||
*===========================================================================*/
|
||||
PRIVATE void check_parent(child, try_cleanup)
|
||||
static void check_parent(child, try_cleanup)
|
||||
struct mproc *child; /* tells which process is exiting */
|
||||
int try_cleanup; /* clean up the child when done? */
|
||||
{
|
||||
@@ -633,7 +633,7 @@ int try_cleanup; /* clean up the child when done? */
|
||||
/*===========================================================================*
|
||||
* tell_parent *
|
||||
*===========================================================================*/
|
||||
PRIVATE void tell_parent(child)
|
||||
static void tell_parent(child)
|
||||
register struct mproc *child; /* tells which process is exiting */
|
||||
{
|
||||
int exitstatus, mp_parent;
|
||||
@@ -661,7 +661,7 @@ register struct mproc *child; /* tells which process is exiting */
|
||||
/*===========================================================================*
|
||||
* tell_tracer *
|
||||
*===========================================================================*/
|
||||
PRIVATE void tell_tracer(child)
|
||||
static void tell_tracer(child)
|
||||
struct mproc *child; /* tells which process is exiting */
|
||||
{
|
||||
int exitstatus, mp_tracer;
|
||||
@@ -685,7 +685,7 @@ struct mproc *child; /* tells which process is exiting */
|
||||
/*===========================================================================*
|
||||
* tracer_died *
|
||||
*===========================================================================*/
|
||||
PRIVATE void tracer_died(child)
|
||||
static void tracer_died(child)
|
||||
struct mproc *child; /* process being traced */
|
||||
{
|
||||
/* The process that was tracing the given child, has died for some reason.
|
||||
@@ -720,7 +720,7 @@ struct mproc *child; /* process being traced */
|
||||
/*===========================================================================*
|
||||
* cleanup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void cleanup(rmp)
|
||||
static void cleanup(rmp)
|
||||
register struct mproc *rmp; /* tells which process is exiting */
|
||||
{
|
||||
/* Release the process table entry and reinitialize some field. */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_get *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_get()
|
||||
int do_get()
|
||||
{
|
||||
/* Handle GETUID, GETGID, GETGROUPS, GETGROUPS_O, GETPID, GETPGRP, GETSID,
|
||||
ISSETUGID.
|
||||
@@ -118,7 +118,7 @@ PUBLIC int do_get()
|
||||
/*===========================================================================*
|
||||
* do_set *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_set()
|
||||
int do_set()
|
||||
{
|
||||
/* Handle SETUID, SETEUID, SETGID, SETEGID, SETSID. These calls have in common
|
||||
* that, if successful, they will be forwarded to VFS as well.
|
||||
|
||||
@@ -39,22 +39,22 @@
|
||||
EXTERN unsigned long calls_stats[NCALLS];
|
||||
#endif
|
||||
|
||||
FORWARD void sendreply(void);
|
||||
FORWARD int get_nice_value(int queue);
|
||||
FORWARD void handle_vfs_reply(void);
|
||||
static void sendreply(void);
|
||||
static int get_nice_value(int queue);
|
||||
static void handle_vfs_reply(void);
|
||||
|
||||
#define click_to_round_k(n) \
|
||||
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
FORWARD int sef_cb_signal_manager(endpoint_t target, int signo);
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static int sef_cb_signal_manager(endpoint_t target, int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main()
|
||||
int main()
|
||||
{
|
||||
/* Main routine of the process manager. */
|
||||
int result;
|
||||
@@ -156,7 +156,7 @@ PUBLIC int main()
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -174,7 +174,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
{
|
||||
/* Initialize the process manager.
|
||||
* Memory use info is collected from the boot monitor, the kernel, and
|
||||
@@ -307,7 +307,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
||||
/*===========================================================================*
|
||||
* sef_cb_signal_manager *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo)
|
||||
static int sef_cb_signal_manager(endpoint_t target, int signo)
|
||||
{
|
||||
/* Process signal on behalf of the kernel. */
|
||||
int r;
|
||||
@@ -321,7 +321,7 @@ PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo)
|
||||
/*===========================================================================*
|
||||
* setreply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void setreply(proc_nr, result)
|
||||
void setreply(proc_nr, result)
|
||||
int proc_nr; /* process to reply to */
|
||||
int result; /* result of call (usually OK or error #) */
|
||||
{
|
||||
@@ -341,7 +341,7 @@ int result; /* result of call (usually OK or error #) */
|
||||
/*===========================================================================*
|
||||
* sendreply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sendreply()
|
||||
static void sendreply()
|
||||
{
|
||||
int proc_nr;
|
||||
int s;
|
||||
@@ -371,7 +371,7 @@ PRIVATE void sendreply()
|
||||
/*===========================================================================*
|
||||
* get_nice_value *
|
||||
*===========================================================================*/
|
||||
PRIVATE int get_nice_value(queue)
|
||||
static int get_nice_value(queue)
|
||||
int queue; /* store mem chunks here */
|
||||
{
|
||||
/* Processes in the boot image have a priority assigned. The PM doesn't know
|
||||
@@ -388,7 +388,7 @@ int queue; /* store mem chunks here */
|
||||
/*===========================================================================*
|
||||
* handle_vfs_reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void handle_vfs_reply()
|
||||
static void handle_vfs_reply()
|
||||
{
|
||||
struct mproc *rmp;
|
||||
endpoint_t proc_e;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/*===========================================================================*
|
||||
* do_setmcontext *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_setmcontext()
|
||||
int do_setmcontext()
|
||||
{
|
||||
return sys_setmcontext(who_e, (mcontext_t *) m_in.m1_p1);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ PUBLIC int do_setmcontext()
|
||||
/*===========================================================================*
|
||||
* do_getmcontext *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getmcontext()
|
||||
int do_getmcontext()
|
||||
{
|
||||
return sys_getmcontext(who_e, (mcontext_t *) m_in.m1_p1);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "param.h"
|
||||
#include "kernel/proc.h"
|
||||
|
||||
PUBLIC struct utsname uts_val = {
|
||||
struct utsname uts_val = {
|
||||
"Minix", /* system name */
|
||||
"noname", /* node/network name */
|
||||
OS_RELEASE, /* O.S. release (e.g. 1.5) */
|
||||
@@ -43,7 +43,7 @@ PUBLIC struct utsname uts_val = {
|
||||
#endif
|
||||
};
|
||||
|
||||
PRIVATE char *uts_tbl[] = {
|
||||
static char *uts_tbl[] = {
|
||||
uts_val.arch,
|
||||
NULL, /* No kernel architecture */
|
||||
uts_val.machine,
|
||||
@@ -56,13 +56,13 @@ PRIVATE char *uts_tbl[] = {
|
||||
};
|
||||
|
||||
#if ENABLE_SYSCALL_STATS
|
||||
PUBLIC unsigned long calls_stats[NCALLS];
|
||||
unsigned long calls_stats[NCALLS];
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* do_sysuname *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sysuname()
|
||||
int do_sysuname()
|
||||
{
|
||||
/* Set or get uname strings. */
|
||||
|
||||
@@ -126,7 +126,7 @@ PUBLIC int do_sysuname()
|
||||
/*===========================================================================*
|
||||
* do_getsysinfo *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getsysinfo()
|
||||
int do_getsysinfo()
|
||||
{
|
||||
vir_bytes src_addr, dst_addr;
|
||||
size_t len;
|
||||
@@ -167,7 +167,7 @@ PUBLIC int do_getsysinfo()
|
||||
/*===========================================================================*
|
||||
* do_getprocnr *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getprocnr()
|
||||
int do_getprocnr()
|
||||
{
|
||||
register struct mproc *rmp;
|
||||
static char search_key[PROC_NAME_LEN+1];
|
||||
@@ -232,7 +232,7 @@ PUBLIC int do_getprocnr()
|
||||
/*===========================================================================*
|
||||
* do_getepinfo *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getepinfo()
|
||||
int do_getepinfo()
|
||||
{
|
||||
register struct mproc *rmp;
|
||||
endpoint_t ep;
|
||||
@@ -254,7 +254,7 @@ PUBLIC int do_getepinfo()
|
||||
/*===========================================================================*
|
||||
* do_getepinfo_o *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getepinfo_o()
|
||||
int do_getepinfo_o()
|
||||
{
|
||||
register struct mproc *rmp;
|
||||
endpoint_t ep;
|
||||
@@ -284,7 +284,7 @@ PUBLIC int do_getepinfo_o()
|
||||
/*===========================================================================*
|
||||
* do_reboot *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_reboot()
|
||||
int do_reboot()
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -325,7 +325,7 @@ PUBLIC int do_reboot()
|
||||
/*===========================================================================*
|
||||
* do_getsetpriority *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getsetpriority()
|
||||
int do_getsetpriority()
|
||||
{
|
||||
int r, arg_which, arg_who, arg_pri;
|
||||
struct mproc *rmp;
|
||||
@@ -377,7 +377,7 @@ PUBLIC int do_getsetpriority()
|
||||
/*===========================================================================*
|
||||
* do_svrctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_svrctl()
|
||||
int do_svrctl()
|
||||
{
|
||||
int s, req;
|
||||
vir_bytes ptr;
|
||||
@@ -485,7 +485,7 @@ PUBLIC int do_svrctl()
|
||||
*===========================================================================*/
|
||||
|
||||
extern char *_brksize;
|
||||
PUBLIC int brk(brk_addr)
|
||||
int brk(brk_addr)
|
||||
#ifdef __NBSD_LIBC
|
||||
void *brk_addr;
|
||||
#else
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
#include "param.h"
|
||||
|
||||
#if SPROFILE || CPROFILE
|
||||
FORWARD int check_addrs(int info_size);
|
||||
static int check_addrs(int info_size);
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* do_sprofile *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sprofile(void)
|
||||
int do_sprofile(void)
|
||||
{
|
||||
#if SPROFILE
|
||||
|
||||
@@ -57,7 +57,7 @@ PUBLIC int do_sprofile(void)
|
||||
/*===========================================================================*
|
||||
* do_cprofile *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_cprofile(void)
|
||||
int do_cprofile(void)
|
||||
{
|
||||
#if CPROFILE
|
||||
|
||||
@@ -90,7 +90,7 @@ PUBLIC int do_cprofile(void)
|
||||
/*===========================================================================*
|
||||
* check_addrs *
|
||||
*===========================================================================*/
|
||||
PRIVATE int check_addrs(info_size)
|
||||
static int check_addrs(info_size)
|
||||
int info_size;
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* init_scheduling *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sched_init(void)
|
||||
void sched_init(void)
|
||||
{
|
||||
struct mproc *trmp;
|
||||
endpoint_t parent_e;
|
||||
@@ -52,7 +52,7 @@ PUBLIC void sched_init(void)
|
||||
/*===========================================================================*
|
||||
* sched_start_user *
|
||||
*===========================================================================*/
|
||||
PUBLIC int sched_start_user(endpoint_t ep, struct mproc *rmp)
|
||||
int sched_start_user(endpoint_t ep, struct mproc *rmp)
|
||||
{
|
||||
unsigned maxprio;
|
||||
endpoint_t inherit_from;
|
||||
@@ -86,7 +86,7 @@ PUBLIC int sched_start_user(endpoint_t ep, struct mproc *rmp)
|
||||
/*===========================================================================*
|
||||
* sched_nice *
|
||||
*===========================================================================*/
|
||||
PUBLIC int sched_nice(struct mproc *rmp, int nice)
|
||||
int sched_nice(struct mproc *rmp, int nice)
|
||||
{
|
||||
int rv;
|
||||
message m;
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
#include "mproc.h"
|
||||
#include "param.h"
|
||||
|
||||
FORWARD void unpause(struct mproc *rmp);
|
||||
FORWARD int sig_send(struct mproc *rmp, int signo);
|
||||
FORWARD void sig_proc_exit(struct mproc *rmp, int signo);
|
||||
static void unpause(struct mproc *rmp);
|
||||
static int sig_send(struct mproc *rmp, int signo);
|
||||
static void sig_proc_exit(struct mproc *rmp, int signo);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_sigaction *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigaction()
|
||||
int do_sigaction()
|
||||
{
|
||||
int r;
|
||||
struct sigaction svec;
|
||||
@@ -87,7 +87,7 @@ PUBLIC int do_sigaction()
|
||||
/*===========================================================================*
|
||||
* do_sigpending *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigpending()
|
||||
int do_sigpending()
|
||||
{
|
||||
mp->mp_reply.reply_mask = (long) mp->mp_sigpending;
|
||||
return OK;
|
||||
@@ -96,7 +96,7 @@ PUBLIC int do_sigpending()
|
||||
/*===========================================================================*
|
||||
* do_sigprocmask *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigprocmask()
|
||||
int do_sigprocmask()
|
||||
{
|
||||
/* Note that the library interface passes the actual mask in sigmask_set,
|
||||
* not a pointer to the mask, in order to save a copy. Similarly,
|
||||
@@ -151,7 +151,7 @@ PUBLIC int do_sigprocmask()
|
||||
/*===========================================================================*
|
||||
* do_sigsuspend *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigsuspend()
|
||||
int do_sigsuspend()
|
||||
{
|
||||
mp->mp_sigmask2 = mp->mp_sigmask; /* save the old mask */
|
||||
mp->mp_sigmask = (sigset_t) m_in.sig_set;
|
||||
@@ -165,7 +165,7 @@ PUBLIC int do_sigsuspend()
|
||||
/*===========================================================================*
|
||||
* do_sigreturn *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigreturn()
|
||||
int do_sigreturn()
|
||||
{
|
||||
/* A user signal handler is done. Restore context and check for
|
||||
* pending unblocked signals.
|
||||
@@ -185,7 +185,7 @@ PUBLIC int do_sigreturn()
|
||||
/*===========================================================================*
|
||||
* do_kill *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_kill()
|
||||
int do_kill()
|
||||
{
|
||||
/* Perform the kill(pid, signo) system call. */
|
||||
|
||||
@@ -195,7 +195,7 @@ PUBLIC int do_kill()
|
||||
/*===========================================================================*
|
||||
* do_srv_kill *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_srv_kill()
|
||||
int do_srv_kill()
|
||||
{
|
||||
/* Perform the srv_kill(pid, signo) system call. */
|
||||
|
||||
@@ -213,7 +213,7 @@ PUBLIC int do_srv_kill()
|
||||
/*===========================================================================*
|
||||
* process_ksig *
|
||||
*===========================================================================*/
|
||||
PUBLIC int process_ksig(endpoint_t proc_nr_e, int signo)
|
||||
int process_ksig(endpoint_t proc_nr_e, int signo)
|
||||
{
|
||||
register struct mproc *rmp;
|
||||
int proc_nr;
|
||||
@@ -293,7 +293,7 @@ PUBLIC int process_ksig(endpoint_t proc_nr_e, int signo)
|
||||
/*===========================================================================*
|
||||
* do_pause *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_pause()
|
||||
int do_pause()
|
||||
{
|
||||
/* Perform the pause() system call. */
|
||||
|
||||
@@ -304,7 +304,7 @@ PUBLIC int do_pause()
|
||||
/*===========================================================================*
|
||||
* sig_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sig_proc(rmp, signo, trace, ksig)
|
||||
void sig_proc(rmp, signo, trace, ksig)
|
||||
register struct mproc *rmp; /* pointer to the process to be signaled */
|
||||
int signo; /* signal to send to process (1 to _NSIG-1) */
|
||||
int trace; /* pass signal to tracer first? */
|
||||
@@ -467,7 +467,7 @@ int ksig; /* non-zero means signal comes from kernel */
|
||||
/*===========================================================================*
|
||||
* sig_proc_exit *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sig_proc_exit(rmp, signo)
|
||||
static void sig_proc_exit(rmp, signo)
|
||||
struct mproc *rmp; /* process that must exit */
|
||||
int signo; /* signal that caused termination */
|
||||
{
|
||||
@@ -488,7 +488,7 @@ int signo; /* signal that caused termination */
|
||||
/*===========================================================================*
|
||||
* check_sig *
|
||||
*===========================================================================*/
|
||||
PUBLIC int check_sig(proc_id, signo, ksig)
|
||||
int check_sig(proc_id, signo, ksig)
|
||||
pid_t proc_id; /* pid of proc to sig, or 0 or -1, or -pgrp */
|
||||
int signo; /* signal to send to process (0 to _NSIG-1) */
|
||||
int ksig; /* non-zero means signal comes from kernel */
|
||||
@@ -566,7 +566,7 @@ int ksig; /* non-zero means signal comes from kernel */
|
||||
/*===========================================================================*
|
||||
* check_pending *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_pending(rmp)
|
||||
void check_pending(rmp)
|
||||
register struct mproc *rmp;
|
||||
{
|
||||
/* Check to see if any pending signals have been unblocked. Deliver as many
|
||||
@@ -597,7 +597,7 @@ register struct mproc *rmp;
|
||||
/*===========================================================================*
|
||||
* restart_sigs *
|
||||
*===========================================================================*/
|
||||
PUBLIC void restart_sigs(rmp)
|
||||
void restart_sigs(rmp)
|
||||
struct mproc *rmp;
|
||||
{
|
||||
/* VFS has replied to a request from us; do signal-related work.
|
||||
@@ -634,7 +634,7 @@ struct mproc *rmp;
|
||||
/*===========================================================================*
|
||||
* unpause *
|
||||
*===========================================================================*/
|
||||
PRIVATE void unpause(rmp)
|
||||
static void unpause(rmp)
|
||||
struct mproc *rmp; /* which process */
|
||||
{
|
||||
/* A signal is to be sent to a process. If that process is hanging on a
|
||||
@@ -693,7 +693,7 @@ struct mproc *rmp; /* which process */
|
||||
/*===========================================================================*
|
||||
* sig_send *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sig_send(rmp, signo)
|
||||
static int sig_send(rmp, signo)
|
||||
struct mproc *rmp; /* what process to spawn a signal handler in */
|
||||
int signo; /* signal to send to process (1 to _NSIG-1) */
|
||||
{
|
||||
@@ -771,7 +771,7 @@ int signo; /* signal to send to process (1 to _NSIG-1) */
|
||||
/*===========================================================================*
|
||||
* vm_notify_sig_wrapper *
|
||||
*===========================================================================*/
|
||||
PUBLIC void vm_notify_sig_wrapper(endpoint_t ep)
|
||||
void vm_notify_sig_wrapper(endpoint_t ep)
|
||||
{
|
||||
/* get IPC's endpoint,
|
||||
* the reason that we directly get the endpoint
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_time *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_time()
|
||||
int do_time()
|
||||
{
|
||||
/* Perform the time(tp) system call. This returns the time in seconds since
|
||||
* 1.1.1970. MINIX is an astrophysically naive system that assumes the earth
|
||||
@@ -37,7 +37,7 @@ PUBLIC int do_time()
|
||||
/*===========================================================================*
|
||||
* do_stime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_stime()
|
||||
int do_stime()
|
||||
{
|
||||
/* Perform the stime(tp) system call. Retrieve the system's uptime (ticks
|
||||
* since boot) and pass the new time in seconds at system boot to the kernel.
|
||||
@@ -62,7 +62,7 @@ PUBLIC int do_stime()
|
||||
/*===========================================================================*
|
||||
* do_times *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_times()
|
||||
int do_times()
|
||||
{
|
||||
/* Perform the times(buffer) system call. */
|
||||
register struct mproc *rmp = mp;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
/*===========================================================================*
|
||||
* do_trace *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_trace()
|
||||
int do_trace()
|
||||
{
|
||||
register struct mproc *child;
|
||||
struct ptrace_range pr;
|
||||
@@ -267,7 +267,7 @@ PUBLIC int do_trace()
|
||||
/*===========================================================================*
|
||||
* stop_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void stop_proc(rmp, signo)
|
||||
void stop_proc(rmp, signo)
|
||||
register struct mproc *rmp;
|
||||
int signo;
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
/*===========================================================================*
|
||||
* get_free_pid *
|
||||
*===========================================================================*/
|
||||
PUBLIC pid_t get_free_pid()
|
||||
pid_t get_free_pid()
|
||||
{
|
||||
static pid_t next_pid = INIT_PID + 1; /* next pid to be assigned */
|
||||
register struct mproc *rmp; /* check process table */
|
||||
@@ -56,7 +56,7 @@ PUBLIC pid_t get_free_pid()
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys()
|
||||
int no_sys()
|
||||
{
|
||||
/* A system call number not implemented by PM has been requested. */
|
||||
return(ENOSYS);
|
||||
@@ -65,7 +65,7 @@ PUBLIC int no_sys()
|
||||
/*===========================================================================*
|
||||
* find_param *
|
||||
*===========================================================================*/
|
||||
PUBLIC char *find_param(name)
|
||||
char *find_param(name)
|
||||
const char *name;
|
||||
{
|
||||
register const char *namep;
|
||||
@@ -85,7 +85,7 @@ const char *name;
|
||||
/*===========================================================================*
|
||||
* find_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct mproc *find_proc(lpid)
|
||||
struct mproc *find_proc(lpid)
|
||||
pid_t lpid;
|
||||
{
|
||||
register struct mproc *rmp;
|
||||
@@ -100,7 +100,7 @@ pid_t lpid;
|
||||
/*===========================================================================*
|
||||
* nice_to_priority *
|
||||
*===========================================================================*/
|
||||
PUBLIC int nice_to_priority(int nice, unsigned* new_q)
|
||||
int nice_to_priority(int nice, unsigned* new_q)
|
||||
{
|
||||
if (nice < PRIO_MIN || nice > PRIO_MAX) return(EINVAL);
|
||||
|
||||
@@ -117,7 +117,7 @@ PUBLIC int nice_to_priority(int nice, unsigned* new_q)
|
||||
/*===========================================================================*
|
||||
* pm_isokendpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC int pm_isokendpt(int endpoint, int *proc)
|
||||
int pm_isokendpt(int endpoint, int *proc)
|
||||
{
|
||||
*proc = _ENDPOINT_P(endpoint);
|
||||
if(*proc < -NR_TASKS || *proc >= NR_PROCS)
|
||||
@@ -132,7 +132,7 @@ PUBLIC int pm_isokendpt(int endpoint, int *proc)
|
||||
/*===========================================================================*
|
||||
* tell_vfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC void tell_vfs(rmp, m_ptr)
|
||||
void tell_vfs(rmp, m_ptr)
|
||||
struct mproc *rmp;
|
||||
message *m_ptr;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user