More cleanup to remove MM and FS references

This commit is contained in:
Arun Thomas 2010-06-10 14:04:46 +00:00
parent 2758519ed2
commit f0a158d8c1
25 changed files with 100 additions and 100 deletions

View file

@ -57,9 +57,9 @@ long addr;
reg_ax = get_reg(curpid,reg_addr("AX")); reg_ax = get_reg(curpid,reg_addr("AX"));
switch (reg_ax) { switch (reg_ax) {
case 0: Printf(" MM "); case 0: Printf(" PM ");
break; break;
case 1: Printf(" FS "); case 1: Printf(" VFS ");
break; break;
case 2: Printf(" INET "); case 2: Printf(" INET ");
break; break;

View file

@ -244,7 +244,7 @@ struct proc *pt;
printf("Memory map: 0x%04.4x\n", pt->p_map[NR_LOCAL_SEGS]); /* struct mem_map */ printf("Memory map: 0x%04.4x\n", pt->p_map[NR_LOCAL_SEGS]); /* struct mem_map */
#endif #endif
#if DEAD_CODE #if DEAD_CODE
printf("Process id passed in from MM: 0x%04.4x\n", pt->p_pid); /* int */ printf("Process id passed in from PM: 0x%04.4x\n", pt->p_pid); /* int */
#endif #endif
#if 0 #if 0
printf("User time in ticks: %ld\n", pt->user_time); /* time_t */ printf("User time in ticks: %ld\n", pt->user_time); /* time_t */

View file

@ -115,7 +115,7 @@ size_t n_ttyinfo; /* Number of tty info slots */
int nr_tasks, nr_procs; int nr_tasks, nr_procs;
extern int errno; extern int errno;
/* Process tables of the kernel, MM, and FS. */ /* Process tables of the kernel, PM, and VFS. */
struct proc *ps_proc; struct proc *ps_proc;
struct mproc *ps_mproc; struct mproc *ps_mproc;
struct fproc *ps_fproc; struct fproc *ps_fproc;
@ -168,7 +168,7 @@ struct pstat { /* structure filled by pstat() */
time_t ps_utime; /* accumulated user time */ time_t ps_utime; /* accumulated user time */
time_t ps_stime; /* accumulated system time */ time_t ps_stime; /* accumulated system time */
char *ps_args; /* concatenated argument string */ char *ps_args; /* concatenated argument string */
vir_bytes ps_procargs; /* initial stack frame from MM */ vir_bytes ps_procargs; /* initial stack frame from PM */
}; };
/* Ps_state field values in pstat struct above */ /* Ps_state field values in pstat struct above */

View file

@ -56,7 +56,7 @@ int main(int argc, char **argv)
sysgetenv.val= val; sysgetenv.val= val;
sysgetenv.vallen= sizeof(val); sysgetenv.vallen= sizeof(val);
if (svrctl(MMGETPARAM, &sysgetenv) == -1) { if (svrctl(PMGETPARAM, &sysgetenv) == -1) {
if (errno == ESRCH) { if (errno == ESRCH) {
ex |= 2; ex |= 2;
} else { } else {

View file

@ -1569,7 +1569,7 @@ int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */
int mayflush; int mayflush;
{ {
/* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from /* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from
* a tty close, "stty 0", or a real RS-232 hangup. MM will send the signal to * a tty close, "stty 0", or a real RS-232 hangup. PM will send the signal to
* the process group (INT, QUIT), all processes (KILL), or the session leader * the process group (INT, QUIT), all processes (KILL), or the session leader
* (HUP). * (HUP).
*/ */

View file

@ -69,28 +69,28 @@
#define REBOOT 76 #define REBOOT 76
#define SVRCTL 77 #define SVRCTL 77
#define SYSUNAME 78 #define SYSUNAME 78
#define GETSYSINFO 79 /* to PM or FS */ #define GETSYSINFO 79 /* to PM, VFS, RS, or DS */
#define GETDENTS 80 /* to FS */ #define GETDENTS 80 /* to FS */
#define LLSEEK 81 /* to FS */ #define LLSEEK 81 /* to VFS */
#define FSTATFS 82 /* to FS */ #define FSTATFS 82 /* to VFS */
#define SELECT 85 /* to FS */ #define SELECT 85 /* to VFS */
#define FCHDIR 86 /* to FS */ #define FCHDIR 86 /* to VFS */
#define FSYNC 87 /* to FS */ #define FSYNC 87 /* to VFS */
#define GETPRIORITY 88 /* to PM */ #define GETPRIORITY 88 /* to PM */
#define SETPRIORITY 89 /* to PM */ #define SETPRIORITY 89 /* to PM */
#define GETTIMEOFDAY 90 /* to PM */ #define GETTIMEOFDAY 90 /* to PM */
#define SETEUID 91 /* to PM */ #define SETEUID 91 /* to PM */
#define SETEGID 92 /* to PM */ #define SETEGID 92 /* to PM */
#define TRUNCATE 93 /* to FS */ #define TRUNCATE 93 /* to VFS */
#define FTRUNCATE 94 /* to FS */ #define FTRUNCATE 94 /* to VFS */
#define FCHMOD 95 /* to FS */ #define FCHMOD 95 /* to VFS */
#define FCHOWN 96 /* to FS */ #define FCHOWN 96 /* to VFS */
#define GETSYSINFO_UP 97 /* to PM or FS */ #define GETSYSINFO_UP 97 /* to PM or VFS */
#define SPROF 98 /* to PM */ #define SPROF 98 /* to PM */
#define CPROF 99 /* to PM */ #define CPROF 99 /* to PM */
/* Calls provided by PM and FS that are not part of the API */ /* Calls provided by PM and FS that are not part of the API */
#define EXEC_NEWMEM 100 /* from FS or RS to PM: new memory map for #define EXEC_NEWMEM 100 /* from VFS or RS to PM: new memory map for
* exec * exec
*/ */
#define SRV_FORK 101 /* to PM: special fork call for RS */ #define SRV_FORK 101 /* to PM: special fork call for RS */
@ -111,7 +111,7 @@
*/ */
#define SRV_KILL 111 /* to PM: special kill call for RS */ #define SRV_KILL 111 /* to PM: special kill call for RS */
#define TASK_REPLY 121 /* to FS: reply code from drivers, not #define TASK_REPLY 121 /* to VFS: reply code from drivers, not
* really a standalone call. * really a standalone call.
*/ */
#define MAPDRIVER 122 /* to FS, map a device */ #define MAPDRIVER 122 /* to VFS, map a device */

View file

@ -15,8 +15,8 @@ Created: Feb 15, 1994 by Philip Homburg <philip@cs.vu.nl>
#include <minix/ioctl.h> #include <minix/ioctl.h>
/* PM controls. */ /* PM controls. */
#define MMGETPARAM _IOW('M', 5, struct sysgetenv) #define PMGETPARAM _IOW('M', 5, struct sysgetenv)
#define MMSETPARAM _IOR('M', 7, struct sysgetenv) #define PMSETPARAM _IOR('M', 7, struct sysgetenv)
struct sysgetenv { struct sysgetenv {
char *key; /* Name requested. */ char *key; /* Name requested. */

View file

@ -16,11 +16,11 @@ int svrctl(int request, void *argp)
switch ((request >> 8) & 0xFF) { switch ((request >> 8) & 0xFF) {
case 'M': case 'M':
case 'S': case 'S':
/* MM handles calls for itself and the kernel. */ /* PM handles calls for itself and the kernel. */
return _syscall(PM_PROC_NR, SVRCTL, &m); return _syscall(PM_PROC_NR, SVRCTL, &m);
case 'F': case 'F':
case 'I': case 'I':
/* FS handles calls for itself and inet. */ /* VFS handles calls for itself and inet. */
return _syscall(VFS_PROC_NR, SVRCTL, &m); return _syscall(VFS_PROC_NR, SVRCTL, &m);
default: default:
errno = EINVAL; errno = EINVAL;

View file

@ -4,7 +4,7 @@ PUBLIC int sys_kill(proc_ep, signr)
endpoint_t proc_ep; /* which proc_ep has exited */ endpoint_t proc_ep; /* which proc_ep has exited */
int signr; /* signal number: 1 - 16 */ int signr; /* signal number: 1 - 16 */
{ {
/* A proc_ep has to be signaled via MM. Tell the kernel. */ /* A proc_ep has to be signaled via PM. Tell the kernel. */
message m; message m;
m.SIG_ENDPT = proc_ep; m.SIG_ENDPT = proc_ep;

View file

@ -1,6 +1,6 @@
/* _taskcall() is the same as _syscall() except it returns negative error /* _taskcall() is the same as _syscall() except it returns negative error
* codes directly and not in errno. This is a better interface for MM and * codes directly and not in errno. This is a better interface for PM and
* FS. * VFS.
*/ */
#include <lib.h> #include <lib.h>

View file

@ -43,7 +43,7 @@ explained below). The long listing contains:
State: State:
R: runnable R: runnable
W: waiting (on a message) W: waiting (on a message)
S: sleeping (i.e.,suspended on MM or FS) S: sleeping (i.e.,suspended on PM or VFS)
Z: zombie Z: zombie
T: stopped T: stopped
.PP .PP

View file

@ -178,8 +178,8 @@ The
.B lp .B lp
device sends any bytes written to it to the printer. device sends any bytes written to it to the printer.
.SS "TCP/IP (major 7)" .SS "TCP/IP (major 7)"
The TCP/IP task is not a kernel task, but a server like MM and FS. It sits The TCP/IP task is not a kernel task, but a server like PM and VFS. It sits
between FS and the DP8390 task that manages the ethernet boards. Together between VFS and the DP8390 task that manages the ethernet boards. Together
they implement the TCP/IP protocol. See also they implement the TCP/IP protocol. See also
.BR ip (4). .BR ip (4).
.SS "Controller 1 (major 8)" .SS "Controller 1 (major 8)"

View file

@ -565,7 +565,7 @@ Use the stack size set by
.BR chmem (1). .BR chmem (1).
.TP .TP
0x0008 0x0008
Load MM, FS, etc. into extended memory. Load PM, VFS, etc. into extended memory.
.TP .TP
0x0010 0x0010
No need to patch process sizes into the kernel. No need to patch process sizes into the kernel.

View file

@ -123,7 +123,7 @@ int main(void)
sysgetenv.keylen = 8+1; sysgetenv.keylen = 8+1;
sysgetenv.val = bootopts; sysgetenv.val = bootopts;
sysgetenv.vallen = sizeof(bootopts); sysgetenv.vallen = sizeof(bootopts);
if (svrctl(MMGETPARAM, &sysgetenv) == 0) *rcp++ = bootopts; if (svrctl(PMGETPARAM, &sysgetenv) == 0) *rcp++ = bootopts;
*rcp = "start"; *rcp = "start";
execute(rc_command); execute(rc_command);

View file

@ -29,7 +29,7 @@ PRIVATE char *flags_str(int flags)
str[5] = (flags & STOPPED) ? 'S' : '-'; str[5] = (flags & STOPPED) ? 'S' : '-';
str[6] = (flags & SIGSUSPENDED) ? 'U' : '-'; str[6] = (flags & SIGSUSPENDED) ? 'U' : '-';
str[7] = (flags & REPLY) ? 'R' : '-'; str[7] = (flags & REPLY) ? 'R' : '-';
str[8] = (flags & FS_CALL) ? 'F' : '-'; str[8] = (flags & VFS_CALL) ? 'F' : '-';
str[9] = (flags & PM_SIG_PENDING) ? 's' : '-'; str[9] = (flags & PM_SIG_PENDING) ? 's' : '-';
str[10] = (flags & PRIV_PROC) ? 'p' : '-'; str[10] = (flags & PRIV_PROC) ? 'p' : '-';
str[11] = (flags & PARTIAL_EXEC) ? 'x' : '-'; str[11] = (flags & PARTIAL_EXEC) ? 'x' : '-';

View file

@ -65,5 +65,5 @@
#define offsetof(type, field) ((size_t)(&((type *)0)->field)) #define offsetof(type, field) ((size_t)(&((type *)0)->field))
/* Miscellaneous constants */ /* Miscellaneous constants */
#define SYS_UID ((uid_t) 0) /* uid_t for processes MM and INIT */ #define SYS_UID ((uid_t) 0) /* uid_t for processes PM and INIT */
#define SYS_GID ((gid_t) 0) /* gid_t for processes MM and INIT */ #define SYS_GID ((gid_t) 0) /* gid_t for processes PM and INIT */

View file

@ -40,7 +40,7 @@ PUBLIC int do_exec()
{ {
message m; message m;
/* Forward call to FS */ /* Forward call to VFS */
m.m_type = PM_EXEC; m.m_type = PM_EXEC;
m.PM_PROC = mp->mp_endpoint; m.PM_PROC = mp->mp_endpoint;
m.PM_PATH = m_in.exec_name; m.PM_PATH = m_in.exec_name;

View file

@ -10,8 +10,8 @@
* do_fork: perform the FORK system call * do_fork: perform the FORK system call
* do_srv_fork: special FORK, used by RS to create sys services * do_srv_fork: special FORK, used by RS to create sys services
* do_exit: perform the EXIT system call (by calling exit_proc()) * do_exit: perform the EXIT system call (by calling exit_proc())
* exit_proc: actually do the exiting, and tell FS about it * exit_proc: actually do the exiting, and tell VFS about it
* exit_restart: continue exiting a process after FS has replied * exit_restart: continue exiting a process after VFS has replied
* do_waitpid: perform the WAITPID or WAIT system call * do_waitpid: perform the WAITPID or WAIT system call
* wait_test: check whether a parent is waiting for a child * wait_test: check whether a parent is waiting for a child
*/ */
@ -116,7 +116,7 @@ PUBLIC int do_fork()
if (rmc->mp_tracer != NO_TRACER) if (rmc->mp_tracer != NO_TRACER)
sig_proc(rmc, SIGSTOP, TRUE /*trace*/, FALSE /* ksig */); sig_proc(rmc, SIGSTOP, TRUE /*trace*/, FALSE /* ksig */);
/* Do not reply until FS is ready to process the fork /* Do not reply until VFS is ready to process the fork
* request * request
*/ */
return SUSPEND; return SUSPEND;
@ -253,7 +253,7 @@ int dump_core; /* flag indicating whether to dump core */
if (dump_core && rmp->mp_realuid != rmp->mp_effuid) if (dump_core && rmp->mp_realuid != rmp->mp_effuid)
dump_core = FALSE; dump_core = FALSE;
/* System processes are destroyed before informing FS, meaning that FS can /* System processes are destroyed before informing VFS, meaning that VFS can
* not get their CPU state, so we can't generate a coredump for them either. * not get their CPU state, so we can't generate a coredump for them either.
*/ */
if (dump_core && (rmp->mp_flags & PRIV_PROC)) if (dump_core && (rmp->mp_flags & PRIV_PROC))
@ -277,9 +277,9 @@ int dump_core; /* flag indicating whether to dump core */
p_mp->mp_child_stime += sys_time + rmp->mp_child_stime; /* add system time */ p_mp->mp_child_stime += sys_time + rmp->mp_child_stime; /* add system time */
/* Tell the kernel the process is no longer runnable to prevent it from /* Tell the kernel the process is no longer runnable to prevent it from
* being scheduled in between the following steps. Then tell FS that it * being scheduled in between the following steps. Then tell VFS that it
* the process has exited and finally, clean up the process at the kernel. * the process has exited and finally, clean up the process at the kernel.
* This order is important so that FS can tell drivers to cancel requests * This order is important so that VFS can tell drivers to cancel requests
* such as copying to/ from the exiting process, before it is gone. * such as copying to/ from the exiting process, before it is gone.
*/ */
if ((r = sys_stop(proc_nr_e)) != OK) /* stop the process */ if ((r = sys_stop(proc_nr_e)) != OK) /* stop the process */
@ -296,10 +296,10 @@ int dump_core; /* flag indicating whether to dump core */
} }
if (proc_nr_e == VFS_PROC_NR) if (proc_nr_e == VFS_PROC_NR)
{ {
panic("exit_proc: FS died: %d", r); panic("exit_proc: VFS died: %d", r);
} }
/* Tell FS about the exiting process. */ /* Tell VFS about the exiting process. */
m.m_type = dump_core ? PM_DUMPCORE : PM_EXIT; m.m_type = dump_core ? PM_DUMPCORE : PM_EXIT;
m.PM_PROC = rmp->mp_endpoint; m.PM_PROC = rmp->mp_endpoint;
@ -307,9 +307,9 @@ int dump_core; /* flag indicating whether to dump core */
if (rmp->mp_flags & PRIV_PROC) if (rmp->mp_flags & PRIV_PROC)
{ {
/* Destroy system processes without waiting for FS. This is /* Destroy system processes without waiting for VFS. This is
* needed because the system process might be a block device * needed because the system process might be a block device
* driver that FS is blocked waiting on. * driver that VFS is blocked waiting on.
*/ */
if((r= sys_clear(rmp->mp_endpoint)) != OK) if((r= sys_clear(rmp->mp_endpoint)) != OK)
panic("exit_proc: sys_clear failed: %d", r); panic("exit_proc: sys_clear failed: %d", r);
@ -318,10 +318,10 @@ int dump_core; /* flag indicating whether to dump core */
/* Clean up most of the flags describing the process's state before the exit, /* Clean up most of the flags describing the process's state before the exit,
* and mark it as exiting. * and mark it as exiting.
*/ */
rmp->mp_flags &= (IN_USE|FS_CALL|PRIV_PROC|TRACE_EXIT); rmp->mp_flags &= (IN_USE|VFS_CALL|PRIV_PROC|TRACE_EXIT);
rmp->mp_flags |= EXITING; rmp->mp_flags |= EXITING;
/* Keep the process around until FS is finished with it. */ /* Keep the process around until VFS is finished with it. */
rmp->mp_exitstatus = (char) exit_status; rmp->mp_exitstatus = (char) exit_status;
@ -359,7 +359,7 @@ PUBLIC void exit_restart(rmp, dump_core)
struct mproc *rmp; /* pointer to the process being terminated */ struct mproc *rmp; /* pointer to the process being terminated */
int dump_core; /* flag indicating whether to dump core */ int dump_core; /* flag indicating whether to dump core */
{ {
/* FS replied to our exit or coredump request. Perform the second half of the /* VFS replied to our exit or coredump request. Perform the second half of the
* exit code. * exit code.
*/ */
int r; int r;
@ -469,7 +469,7 @@ PUBLIC int do_waitpid()
if (rp->mp_flags & ZOMBIE) { if (rp->mp_flags & ZOMBIE) {
/* This child meets the pid test and has exited. */ /* This child meets the pid test and has exited. */
tell_parent(rp); /* this child has already exited */ tell_parent(rp); /* this child has already exited */
if (!(rp->mp_flags & FS_CALL)) if (!(rp->mp_flags & VFS_CALL))
cleanup(rp); cleanup(rp);
return(SUSPEND); return(SUSPEND);
} }
@ -578,7 +578,7 @@ int try_cleanup; /* clean up the child when done? */
/* The 'try_cleanup' flag merely saves us from having to be really /* The 'try_cleanup' flag merely saves us from having to be really
* careful with statement ordering in exit_proc() and exit_restart(). * careful with statement ordering in exit_proc() and exit_restart().
*/ */
if (try_cleanup && !(child->mp_flags & FS_CALL)) if (try_cleanup && !(child->mp_flags & VFS_CALL))
cleanup(child); cleanup(child);
} }
else { else {

View file

@ -1,7 +1,7 @@
/* This file contains the main program of the process manager and some related /* This file contains the main program of the process manager and some related
* procedures. When MINIX starts up, the kernel runs for a little while, * procedures. When MINIX starts up, the kernel runs for a little while,
* initializing itself and its tasks, and then it runs PM and FS. Both PM * initializing itself and its tasks, and then it runs PM and VFS. Both PM
* and FS initialize themselves as far as they can. PM asks the kernel for * and VFS initialize themselves as far as they can. PM asks the kernel for
* all free memory and starts serving requests. * all free memory and starts serving requests.
* *
* The entry points into this file are: * The entry points into this file are:
@ -41,7 +41,7 @@ EXTERN unsigned long calls_stats[NCALLS];
FORWARD _PROTOTYPE( void sendreply, (void) ); FORWARD _PROTOTYPE( void sendreply, (void) );
FORWARD _PROTOTYPE( int get_nice_value, (int queue) ); FORWARD _PROTOTYPE( int get_nice_value, (int queue) );
FORWARD _PROTOTYPE( void handle_fs_reply, (void) ); FORWARD _PROTOTYPE( void handle_vfs_reply, (void) );
#define click_to_round_k(n) \ #define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024)) ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
@ -122,7 +122,7 @@ PUBLIC int main()
case PM_SETGROUPS_REPLY: case PM_SETGROUPS_REPLY:
if (who_e == VFS_PROC_NR) if (who_e == VFS_PROC_NR)
{ {
handle_fs_reply(); handle_vfs_reply();
result= SUSPEND; /* don't reply */ result= SUSPEND; /* don't reply */
} }
else else
@ -270,20 +270,20 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
/* Set scheduling info */ /* Set scheduling info */
rmp->mp_scheduler = KERNEL; rmp->mp_scheduler = KERNEL;
/* Tell FS about this system process. */ /* Tell VFS about this system process. */
mess.m_type = PM_INIT; mess.m_type = PM_INIT;
mess.PM_SLOT = ip->proc_nr; mess.PM_SLOT = ip->proc_nr;
mess.PM_PID = rmp->mp_pid; mess.PM_PID = rmp->mp_pid;
mess.PM_PROC = rmp->mp_endpoint; mess.PM_PROC = rmp->mp_endpoint;
if (OK != (s=send(VFS_PROC_NR, &mess))) if (OK != (s=send(VFS_PROC_NR, &mess)))
panic("can't sync up with FS: %d", s); panic("can't sync up with VFS: %d", s);
} }
} }
/* Tell FS that no more system processes follow and synchronize. */ /* Tell VFS that no more system processes follow and synchronize. */
mess.PR_ENDPT = NONE; mess.PR_ENDPT = NONE;
if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK) if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK)
panic("can't sync up with FS"); panic("can't sync up with VFS");
#if (CHIP == INTEL) #if (CHIP == INTEL)
uts_val.machine[0] = 'i'; uts_val.machine[0] = 'i';
@ -411,9 +411,9 @@ void checkme(char *str, int line)
} }
/*===========================================================================* /*===========================================================================*
* handle_fs_reply * * handle_vfs_reply *
*===========================================================================*/ *===========================================================================*/
PRIVATE void handle_fs_reply() PRIVATE void handle_vfs_reply()
{ {
struct mproc *rmp; struct mproc *rmp;
endpoint_t proc_e; endpoint_t proc_e;
@ -441,19 +441,19 @@ PRIVATE void handle_fs_reply()
proc_e = m_in.PM_PROC; proc_e = m_in.PM_PROC;
if (pm_isokendpt(proc_e, &proc_n) != OK) { if (pm_isokendpt(proc_e, &proc_n) != OK) {
panic("handle_fs_reply: got bad endpoint from FS: %d", proc_e); panic("handle_vfs_reply: got bad endpoint from VFS: %d", proc_e);
} }
rmp = &mproc[proc_n]; rmp = &mproc[proc_n];
/* Now that FS replied, mark the process as FS-idle again */ /* Now that VFS replied, mark the process as VFS-idle again */
if (!(rmp->mp_flags & FS_CALL)) if (!(rmp->mp_flags & VFS_CALL))
panic("handle_fs_reply: reply without request: %d", call_nr); panic("handle_vfs_reply: reply without request: %d", call_nr);
rmp->mp_flags &= ~FS_CALL; rmp->mp_flags &= ~VFS_CALL;
if (rmp->mp_flags & UNPAUSED) if (rmp->mp_flags & UNPAUSED)
panic("handle_fs_reply: UNPAUSED set on entry: %d", call_nr); panic("handle_vfs_reply: UNPAUSED set on entry: %d", call_nr);
/* Call-specific handler code */ /* Call-specific handler code */
switch (call_nr) { switch (call_nr) {
@ -529,7 +529,7 @@ PRIVATE void handle_fs_reply()
break; break;
default: default:
panic("handle_fs_reply: unknown reply code: %d", call_nr); panic("handle_vfs_reply: unknown reply code: %d", call_nr);
} }
/* Now that the process is idle again, look at pending signals */ /* Now that the process is idle again, look at pending signals */

View file

@ -70,7 +70,7 @@ PUBLIC int do_procstat()
/* For the moment, this is only used to return pending signals to /* For the moment, this is only used to return pending signals to
* system processes that request the PM for their own status. * system processes that request the PM for their own status.
* *
* Future use might include the FS requesting for process status of * Future use might include the VFS requesting for process status of
* any user process. * any user process.
*/ */
@ -385,7 +385,7 @@ PUBLIC int do_reboot()
else else
monitor_code[0] = '\0'; monitor_code[0] = '\0';
/* Order matters here. When FS is told to reboot, it exits all its /* Order matters here. When VFS is told to reboot, it exits all its
* processes, and then would be confused if they're exited again by * processes, and then would be confused if they're exited again by
* SIGKILL. So first kill, then reboot. * SIGKILL. So first kill, then reboot.
*/ */
@ -470,13 +470,13 @@ PUBLIC int do_svrctl()
req = m_in.svrctl_req; req = m_in.svrctl_req;
ptr = (vir_bytes) m_in.svrctl_argp; ptr = (vir_bytes) m_in.svrctl_argp;
/* Is the request indeed for the MM? */ /* Is the request indeed for the PM? */
if (((req >> 8) & 0xFF) != 'M') return(EINVAL); if (((req >> 8) & 0xFF) != 'M') return(EINVAL);
/* Control operations local to the PM. */ /* Control operations local to the PM. */
switch(req) { switch(req) {
case MMSETPARAM: case PMSETPARAM:
case MMGETPARAM: { case PMGETPARAM: {
struct sysgetenv sysgetenv; struct sysgetenv sysgetenv;
char search_key[64]; char search_key[64];
char *val_start; char *val_start;
@ -488,7 +488,7 @@ PUBLIC int do_svrctl()
sizeof(sysgetenv)) != OK) return(EFAULT); sizeof(sysgetenv)) != OK) return(EFAULT);
/* Set a param override? */ /* Set a param override? */
if (req == MMSETPARAM) { if (req == PMSETPARAM) {
if (local_params >= MAX_LOCAL_PARAMS) return ENOSPC; if (local_params >= MAX_LOCAL_PARAMS) return ENOSPC;
if (sysgetenv.keylen <= 0 if (sysgetenv.keylen <= 0
|| sysgetenv.keylen >= || sysgetenv.keylen >=

View file

@ -72,8 +72,8 @@ EXTERN struct mproc {
#define STOPPED 0x00080 /* set if process stopped for tracing */ #define STOPPED 0x00080 /* set if process stopped for tracing */
#define SIGSUSPENDED 0x00100 /* set by SIGSUSPEND system call */ #define SIGSUSPENDED 0x00100 /* set by SIGSUSPEND system call */
#define REPLY 0x00200 /* set if a reply message is pending */ #define REPLY 0x00200 /* set if a reply message is pending */
#define FS_CALL 0x00400 /* set if waiting for FS (normal calls) */ #define VFS_CALL 0x00400 /* set if waiting for VFS (normal calls) */
#define PM_SIG_PENDING 0x00800 /* process got a signal while waiting for FS */ #define PM_SIG_PENDING 0x00800 /* process got a signal while waiting for VFS */
#define UNPAUSED 0x01000 /* process is not in a blocking call */ #define UNPAUSED 0x01000 /* process is not in a blocking call */
#define PRIV_PROC 0x02000 /* system process, special privileges */ #define PRIV_PROC 0x02000 /* system process, special privileges */
#define PARTIAL_EXEC 0x04000 /* process got a new map but no content */ #define PARTIAL_EXEC 0x04000 /* process got a new map but no content */

View file

@ -16,7 +16,7 @@
* sig_proc: interrupt or terminate a signaled process * sig_proc: interrupt or terminate a signaled process
* check_sig: check which processes to signal with sig_proc() * check_sig: check which processes to signal with sig_proc()
* check_pending: check if a pending signal can now be delivered * check_pending: check if a pending signal can now be delivered
* restart_sigs: restart signal work after finishing a FS call * restart_sigs: restart signal work after finishing a VFS call
*/ */
#include "pm.h" #include "pm.h"
@ -265,11 +265,11 @@ PUBLIC int process_ksig(endpoint_t proc_nr_e, int signo)
rmp->mp_flags &= ~DELAY_CALL; rmp->mp_flags &= ~DELAY_CALL;
/* /*
* If the FS_CALL flag is still set we have a process which is stopped * If the VFS_CALL flag is still set we have a process which is stopped
* and we only need to wait for a reply from VFS. We are going to check * and we only need to wait for a reply from VFS. We are going to check
* the pending signal then * the pending signal then
*/ */
if (rmp->mp_flags & FS_CALL) if (rmp->mp_flags & VFS_CALL)
return OK; return OK;
if (rmp->mp_flags & PM_SIG_PENDING) if (rmp->mp_flags & PM_SIG_PENDING)
panic("process_ksig: bad process state"); panic("process_ksig: bad process state");
@ -345,11 +345,11 @@ int ksig; /* non-zero means signal comes from kernel */
return; return;
} }
if (rmp->mp_flags & FS_CALL) { if (rmp->mp_flags & VFS_CALL) {
sigaddset(&rmp->mp_sigpending, signo); sigaddset(&rmp->mp_sigpending, signo);
if (!(rmp->mp_flags & PM_SIG_PENDING)) { if (!(rmp->mp_flags & PM_SIG_PENDING)) {
/* No delay calls: FS_CALL implies the process called us. */ /* No delay calls: VFS_CALL implies the process called us. */
if ((r = sys_stop(rmp->mp_endpoint)) != OK) if ((r = sys_stop(rmp->mp_endpoint)) != OK)
panic("sys_stop failed: %d", r); panic("sys_stop failed: %d", r);
@ -419,7 +419,7 @@ int ksig; /* non-zero means signal comes from kernel */
} }
if (!badignore && sigismember(&rmp->mp_catch, signo)) { if (!badignore && sigismember(&rmp->mp_catch, signo)) {
/* Signal is caught. First interrupt the process's current call, if /* Signal is caught. First interrupt the process's current call, if
* applicable. This may involve a roundtrip to FS, in which case we'll * applicable. This may involve a roundtrip to VFS, in which case we'll
* have to check back later. * have to check back later.
*/ */
if (!(rmp->mp_flags & UNPAUSED)) { if (!(rmp->mp_flags & UNPAUSED)) {
@ -571,7 +571,7 @@ register struct mproc *rmp;
sigdelset(&rmp->mp_sigpending, i); sigdelset(&rmp->mp_sigpending, i);
sig_proc(rmp, i, FALSE /*trace*/, FALSE /* ksig */); sig_proc(rmp, i, FALSE /*trace*/, FALSE /* ksig */);
if (rmp->mp_flags & FS_CALL) if (rmp->mp_flags & VFS_CALL)
break; break;
} }
} }
@ -583,27 +583,27 @@ register struct mproc *rmp;
PUBLIC void restart_sigs(rmp) PUBLIC void restart_sigs(rmp)
struct mproc *rmp; struct mproc *rmp;
{ {
/* FS has replied to a request from us; do signal-related work. /* VFS has replied to a request from us; do signal-related work.
*/ */
int r; int r;
if (rmp->mp_flags & (FS_CALL | EXITING)) return; if (rmp->mp_flags & (VFS_CALL | EXITING)) return;
if (rmp->mp_flags & TRACE_EXIT) { if (rmp->mp_flags & TRACE_EXIT) {
/* Tracer requested exit with specific exit value */ /* Tracer requested exit with specific exit value */
exit_proc(rmp, rmp->mp_exitstatus, FALSE /*dump_core*/); exit_proc(rmp, rmp->mp_exitstatus, FALSE /*dump_core*/);
} }
else if (rmp->mp_flags & PM_SIG_PENDING) { else if (rmp->mp_flags & PM_SIG_PENDING) {
/* We saved signal(s) for after finishing a FS call. Deal with this. /* We saved signal(s) for after finishing a VFS call. Deal with this.
* PM_SIG_PENDING remains set to indicate the process is still stopped. * PM_SIG_PENDING remains set to indicate the process is still stopped.
*/ */
check_pending(rmp); check_pending(rmp);
/* The process may now be FS-blocked again, because a signal exited the /* The process may now be VFS-blocked again, because a signal exited the
* process or was caught. Restart the process only when this is NOT the * process or was caught. Restart the process only when this is NOT the
* case. * case.
*/ */
if (!(rmp->mp_flags & FS_CALL)) { if (!(rmp->mp_flags & VFS_CALL)) {
rmp->mp_flags &= ~(PM_SIG_PENDING | UNPAUSED); rmp->mp_flags &= ~(PM_SIG_PENDING | UNPAUSED);
if ((r = sys_resume(rmp->mp_endpoint)) != OK) if ((r = sys_resume(rmp->mp_endpoint)) != OK)
@ -621,7 +621,7 @@ struct mproc *rmp; /* which process */
/* A signal is to be sent to a process. If that process is hanging on a /* A signal is to be sent to a process. If that process is hanging on a
* system call, the system call must be terminated with EINTR. Possible * system call, the system call must be terminated with EINTR. Possible
* calls are PAUSE, WAIT, READ and WRITE, the latter two for pipes and ttys. * calls are PAUSE, WAIT, READ and WRITE, the latter two for pipes and ttys.
* First check if the process is hanging on an PM call. If not, tell FS, * First check if the process is hanging on an PM call. If not, tell VFS,
* so it can check for READs and WRITEs from pipes, ttys and the like. * so it can check for READs and WRITEs from pipes, ttys and the like.
*/ */
message m; message m;
@ -643,7 +643,7 @@ struct mproc *rmp; /* which process */
return; return;
} }
/* Not paused in PM. Let FS try to unpause the process. */ /* Not paused in PM. Let VFS try to unpause the process. */
if (!(rmp->mp_flags & PM_SIG_PENDING)) { if (!(rmp->mp_flags & PM_SIG_PENDING)) {
/* Stop process from running. */ /* Stop process from running. */
r = sys_delay_stop(rmp->mp_endpoint); r = sys_delay_stop(rmp->mp_endpoint);

View file

@ -142,13 +142,13 @@ PUBLIC int do_trace()
case T_EXIT: /* exit */ case T_EXIT: /* exit */
child->mp_flags |= TRACE_EXIT; child->mp_flags |= TRACE_EXIT;
/* Defer the exit if the traced process has an FS call pending. */ /* Defer the exit if the traced process has an VFS call pending. */
if (child->mp_flags & FS_CALL) if (child->mp_flags & VFS_CALL)
child->mp_exitstatus = (int) m_in.data; /* save for later */ child->mp_exitstatus = (int) m_in.data; /* save for later */
else else
exit_proc(child, (int) m_in.data, FALSE /*dump_core*/); exit_proc(child, (int) m_in.data, FALSE /*dump_core*/);
/* Do not reply to the caller until FS has processed the exit /* Do not reply to the caller until VFS has processed the exit
* request. * request.
*/ */
return(SUSPEND); return(SUSPEND);

View file

@ -128,14 +128,14 @@ message *m_ptr;
*/ */
int r; int r;
if (rmp->mp_flags & FS_CALL) if (rmp->mp_flags & VFS_CALL)
panic("tell_vfs: not idle: %d", m_ptr->m_type); panic("tell_vfs: not idle: %d", m_ptr->m_type);
r = asynsend3(VFS_PROC_NR, m_ptr, AMF_NOREPLY); r = asynsend3(VFS_PROC_NR, m_ptr, AMF_NOREPLY);
if (r != OK) if (r != OK)
panic("unable to send to FS: %d", r); panic("unable to send to VFS: %d", r);
rmp->mp_flags |= FS_CALL; rmp->mp_flags |= VFS_CALL;
} }
int unmap_ok = 0; int unmap_ok = 0;

View file

@ -65,7 +65,7 @@ vir_bytes frame_len;
{ {
/* Perform the execve(name, argv, envp) call. The user library builds a /* Perform the execve(name, argv, envp) call. The user library builds a
* complete stack image, including pointers, args, environ, etc. The stack * complete stack image, including pointers, args, environ, etc. The stack
* is copied to a buffer inside FS, and then to the new core image. * is copied to a buffer inside VFS, and then to the new core image.
*/ */
int r, r1, sep_id, round, proc_s, hdrlen, load_text, allow_setuid; int r, r1, sep_id, round, proc_s, hdrlen, load_text, allow_setuid;
vir_bytes text_bytes, data_bytes, bss_bytes, pc; vir_bytes text_bytes, data_bytes, bss_bytes, pc;
@ -165,7 +165,7 @@ vir_bytes frame_len;
return(r); return(r);
} }
/* Patch up stack and copy it from FS to new core image. */ /* Patch up stack and copy it from VFS to new core image. */
vsp = stack_top; vsp = stack_top;
vsp -= frame_len; vsp -= frame_len;
patch_ptr(mbuf, vsp); patch_ptr(mbuf, vsp);
@ -347,7 +347,7 @@ PRIVATE int read_header(
*===========================================================================*/ *===========================================================================*/
PRIVATE int patch_stack(vp, stack, stk_bytes) PRIVATE int patch_stack(vp, stack, stk_bytes)
struct vnode *vp; /* pointer for open script file */ struct vnode *vp; /* pointer for open script file */
char stack[ARG_MAX]; /* pointer to stack image within FS */ char stack[ARG_MAX]; /* pointer to stack image within VFS */
vir_bytes *stk_bytes; /* size of initial stack */ vir_bytes *stk_bytes; /* size of initial stack */
{ {
/* Patch the argument vector to include the path name of the script to be /* Patch the argument vector to include the path name of the script to be