blkstr = "wait";
else if (bufp->ps_mflags & SIGSUSPENDED)
blkstr = "sigsusp";
- } else if (bufp->ps_recv == FS_PROC_NR) {
+ } else if (bufp->ps_recv == VFS_PROC_NR) {
switch(bufp->ps_blocked_on) {
case FP_BLOCKED_ON_PIPE:
blkstr = "pipe";
}
/* We need to know where INIT hangs out. */
- for (i = FS_PROC_NR; i < nr_procs; i++) {
+ for (i = VFS_PROC_NR; i < nr_procs; i++) {
if (strcmp(ps_proc[nr_tasks + i].p_name, "init") == 0) break;
}
init_proc_nr = i;
switch (caller) {
case HARDWARE: /* Leftover interrupt. */
continue;
- case FS_PROC_NR: /* The only legitimate caller. */
+ case VFS_PROC_NR: /* The only legitimate caller. */
break;
default:
dprint("sb16: got message from %d\n", caller);
#include <minix/ipc.h>
-#define MM PM_PROC_NR
-#define FS FS_PROC_NR
_PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
char *const _envp[], int _nargs, int _nenvps) );
/* User-space processes, that is, device drivers, servers, and INIT. */
#define PM_PROC_NR ((endpoint_t) 0) /* process manager */
-#define FS_PROC_NR ((endpoint_t) 1) /* file system */
-#define VFS_PROC_NR FS_PROC_NR /* FS has been renamed to VFS. */
+#define VFS_PROC_NR ((endpoint_t) 1) /* file system */
#define RS_PROC_NR ((endpoint_t) 2) /* reincarnation server */
#define MEM_PROC_NR ((endpoint_t) 3) /* memory driver (RAM disk, null, etc.) */
#define LOG_PROC_NR ((endpoint_t) 4) /* log device driver */
/* Currently, it is hardcoded that only FS may do
* magic grants.
*/
- if(granter != FS_PROC_NR) {
+ if(granter != VFS_PROC_NR) {
printf(
"verify_grant: magic grant verify failed: granter (%d) "
- "is not FS (%d)\n", granter, FS_PROC_NR);
+ "is not FS (%d)\n", granter, VFS_PROC_NR);
return EPERM;
}
{PM_PROC_NR, 0,500, 4, 0, "pm" },
{SCHED_PROC_NR, 0,500, 4, 0, "sched" },
-{FS_PROC_NR, 0,500, 5, 0, "vfs" },
+{VFS_PROC_NR, 0,500, 5, 0, "vfs" },
{MEM_PROC_NR, BVM_F, 50, 3, 0, "memory"},
{LOG_PROC_NR, BVM_F, 50, 2, 0, "log" },
{TTY_PROC_NR, BVM_F, 50, 1, 0, "tty" },
m.m1_p1 = proc_name;
m.m1_i1 = -1; /* search by name */
m.m1_i2 = strlen(proc_name) + 1;
- if (_syscall(MM, GETPROCNR, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
*proc_nr = m.m1_i1;
return(0);
}
m.m2_l1= start;
m.m2_l2= size;
- return _syscall(MM, ADDDMA, &m);
+ return _syscall(PM_PROC_NR, ADDDMA, &m);
}
if (addr != _brksize) {
m.PMBRK_ADDR = addr;
- if (_syscall(MM, BRK, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, BRK, &m) < 0) return(-1);
_brksize = m.m2_p1;
}
return(0);
m.PROF_CTL_PTR = (void *) ctl_ptr;
m.PROF_MEM_PTR = (void *) mem_ptr;
- return _syscall(MM, CPROF, &m);
+ return _syscall(PM_PROC_NR, CPROF, &m);
}
m.m2_l1= start;
m.m2_l2= size;
- return _syscall(MM, DELDMA, &m);
+ return _syscall(PM_PROC_NR, DELDMA, &m);
}
m.m1_i1 = fd;
m.m1_i2 = nbytes;
m.m1_p1 = (char *) buffer;
- return _syscall(FS, GETDENTS, &m);
+ return _syscall(VFS_PROC_NR, GETDENTS, &m);
}
int r;
message m;
- r= _syscall(MM, GETDMA, &m);
+ r= _syscall(PM_PROC_NR, GETDMA, &m);
if (r == 0)
{
*procp= m.m2_i1;
{
message m;
m.m1_i1 = proc_ep; /* search gid for this process */
- if (_syscall(MM, GETEPINFO, &m) < 0) return ( (gid_t) -1);
+ if (_syscall(PM_PROC_NR, GETEPINFO, &m) < 0) return ( (gid_t) -1);
return( (gid_t) m.m2_i2); /* return search result */
}
{
message m;
m.m1_i1 = proc_ep; /* search pid for this process */
- return _syscall(MM, GETEPINFO, &m);
+ return _syscall(PM_PROC_NR, GETEPINFO, &m);
}
{
message m;
m.m1_i1 = proc_ep; /* search uid for this process */
- if (_syscall(MM, GETEPINFO, &m) < 0) return ( (uid_t) -1);
+ if (_syscall(PM_PROC_NR, GETEPINFO, &m) < 0) return ( (uid_t) -1);
return( (uid_t) m.m2_i1); /* return search result */
}
m.m2_l1 = ex64lo(offset);
m.m2_l2 = ex64hi(offset);
m.m2_i2 = whence;
- if (_syscall(FS, LLSEEK, &m) < 0) return -1;
+ if (_syscall(VFS_PROC_NR, LLSEEK, &m) < 0) return -1;
if (newpos)
*newpos= make64(m.m2_l1, m.m2_l2);
return 0;
m.m2_i1 = major;
m.m2_i2 = dev_style;
m.m2_i3 = flags;
- if (_syscall(FS, MAPDRIVER, &m) < 0) return(-1);
+ if (_syscall(VFS_PROC_NR, MAPDRIVER, &m) < 0) return(-1);
return(0);
}
m.m1_p1 = (char *) mcp;
- return(_syscall(MM, SETMCONTEXT, &m));
+ return(_syscall(PM_PROC_NR, SETMCONTEXT, &m));
}
m.m1_p1 = (char *) mcp;
- return(_syscall(MM, GETMCONTEXT, &m));
+ return(_syscall(PM_PROC_NR, GETMCONTEXT, &m));
}
m.m1_p1 = special;
m.m1_p2 = name;
m.m1_p3 = label;
- r = _syscall(FS, MOUNT, &m);
+ r = _syscall(VFS_PROC_NR, MOUNT, &m);
if(r != OK) {
/* If mount() failed, tell RS to shutdown MFS process.
int r;
_loadname(name, &m);
- r = _syscall(FS, UMOUNT, &m);
+ r = _syscall(VFS_PROC_NR, UMOUNT, &m);
if(r == OK) {
/* VFS returns the label of the unmounted file system in the reply.
}
va_end(ap);
- return _syscall(MM, REBOOT, &m);
+ return _syscall(PM_PROC_NR, REBOOT, &m);
}
m.m1_p1 = (char *) gidset;
m.m1_i1 = ngroups;
- return(_syscall(MM, SETGROUPS, &m));
+ return(_syscall(PM_PROC_NR, SETGROUPS, &m));
}
m.PROF_CTL_PTR = (void *) ctl_ptr;
m.PROF_MEM_PTR = (void *) mem_ptr;
- return _syscall(MM, SPROF, &m);
+ return _syscall(PM_PROC_NR, SPROF, &m);
}
case 'M':
case 'S':
/* MM handles calls for itself and the kernel. */
- return _syscall(MM, SVRCTL, &m);
+ return _syscall(PM_PROC_NR, SVRCTL, &m);
case 'F':
case 'I':
/* FS handles calls for itself and inet. */
- return _syscall(FS, SVRCTL, &m);
+ return _syscall(VFS_PROC_NR, SVRCTL, &m);
default:
errno = EINVAL;
return -1;
m.m1_p2 = NULL;
m.m1_p3 = NULL;
- return _syscall(MM, SYSUNAME, &m);
+ return _syscall(PM_PROC_NR, SYSUNAME, &m);
}
/*
m.m1_i2 = reset;
m.m1_p1 = (void *) ms;
- if(_syscall(MM, MSTATS, &m) < 0) {
+ if(_syscall(PM_PROC_NR, MSTATS, &m) < 0) {
return -1;
}
message m;
m.m1_i1 = status;
- _syscall(MM, EXIT, &m);
+ _syscall(PM_PROC_NR, EXIT, &m);
/* If exiting nicely through PM fails for some reason, try to
* commit suicide. E.g., message to PM might fail due to deadlock.
m.m3_i2 = mode;
_loadname(name, &m);
- return(_syscall(FS, ACCESS, &m));
+ return(_syscall(VFS_PROC_NR, ACCESS, &m));
}
message m;
m.m1_i1 = (int) sec;
- return( (unsigned) _syscall(MM, ALARM, &m));
+ return( (unsigned) _syscall(PM_PROC_NR, ALARM, &m));
}
message m;
_loadname(name, &m);
- return(_syscall(FS, CHDIR, &m));
+ return(_syscall(VFS_PROC_NR, CHDIR, &m));
}
PUBLIC int fchdir(fd)
message m;
m.m1_i1 = fd;
- return(_syscall(FS, FCHDIR, &m));
+ return(_syscall(VFS_PROC_NR, FCHDIR, &m));
}
m.m3_i2 = mode;
_loadname(name, &m);
- return(_syscall(FS, CHMOD, &m));
+ return(_syscall(VFS_PROC_NR, CHMOD, &m));
}
m.m1_i2 = owner;
m.m1_i3 = grp;
m.m1_p1 = (char *) name;
- return(_syscall(FS, CHOWN, &m));
+ return(_syscall(VFS_PROC_NR, CHOWN, &m));
}
message m;
_loadname(name, &m);
- return(_syscall(FS, CHROOT, &m));
+ return(_syscall(VFS_PROC_NR, CHROOT, &m));
}
message m;
m.m1_i1 = fd;
- return(_syscall(FS, CLOSE, &m));
+ return(_syscall(VFS_PROC_NR, CLOSE, &m));
}
m.m3_i2 = mode;
_loadname(name, &m);
- return(_syscall(FS, CREAT, &m));
+ return(_syscall(VFS_PROC_NR, CREAT, &m));
}
m.m1_i3 = 0;
m.m1_p3 = NULL;
- (void) _syscall(MM, EXEC, &m);
+ (void) _syscall(PM_PROC_NR, EXEC, &m);
/* Failure, return the memory used for the frame and exit. */
(void) sbrk(-frame_size);
m.m1_i1 = fd;
m.m1_i2 = mode;
- return(_syscall(FS, FCHMOD, &m));
+ return(_syscall(VFS_PROC_NR, FCHMOD, &m));
}
m.m1_i1 = fd;
m.m1_i2 = owner;
m.m1_i3 = grp;
- return(_syscall(FS, FCHOWN, &m));
+ return(_syscall(VFS_PROC_NR, FCHOWN, &m));
}
va_end(argp);
m.m1_i1 = fd;
m.m1_i2 = cmd;
- return(_syscall(FS, FCNTL, &m));
+ return(_syscall(VFS_PROC_NR, FCNTL, &m));
}
{
message m;
- return(_syscall(MM, FORK, &m));
+ return(_syscall(PM_PROC_NR, FORK, &m));
}
m.m1_i1 = fd;
m.m1_p1 = (char *) buffer;
- return(_syscall(FS, FSTAT, &m));
+ return(_syscall(VFS_PROC_NR, FSTAT, &m));
}
m.m1_i1 = fd;
m.m1_p1 = (char *) buffer;
- return(_syscall(FS, FSTATFS, &m));
+ return(_syscall(VFS_PROC_NR, FSTATFS, &m));
}
m.m1_i1 = fd;
- return(_syscall(FS, FSYNC, &m));
+ return(_syscall(VFS_PROC_NR, FSYNC, &m));
}
* are not always successful and Minix returns the unreserved value
* (gid_t) -1 when there is an error.
*/
- if (_syscall(MM, GETGID, &m) < 0) return ( (gid_t) -1);
+ if (_syscall(PM_PROC_NR, GETGID, &m) < 0) return ( (gid_t) -1);
return( (gid_t) m.m2_i1);
}
* are not always successful and Minix returns the unreserved value
* (uid_t) -1 when there is an error.
*/
- if (_syscall(MM, GETUID, &m) < 0) return ( (uid_t) -1);
+ if (_syscall(PM_PROC_NR, GETUID, &m) < 0) return ( (uid_t) -1);
return( (uid_t) m.m2_i1);
}
{
message m;
- return( (gid_t) _syscall(MM, GETGID, &m));
+ return( (gid_t) _syscall(PM_PROC_NR, GETGID, &m));
}
m.m1_i1 = ngroups;
m.m1_p1 = arr;
- return(_syscall(MM, GETGROUPS, &m));
+ return(_syscall(PM_PROC_NR, GETGROUPS, &m));
}
{
message m;
- return(_syscall(MM, GETPGRP, &m));
+ return(_syscall(PM_PROC_NR, GETPGRP, &m));
}
{
message m;
- return(_syscall(MM, MINIX_GETPID, &m));
+ return(_syscall(PM_PROC_NR, MINIX_GETPID, &m));
}
* are not always successful and Minix returns the reserved value
* (pid_t) -1 when there is an error.
*/
- if (_syscall(MM, MINIX_GETPID, &m) < 0) return ( (pid_t) -1);
+ if (_syscall(PM_PROC_NR, MINIX_GETPID, &m) < 0) return ( (pid_t) -1);
return( (pid_t) m.m2_i1);
}
{
message m;
- return( (uid_t) _syscall(MM, GETUID, &m));
+ return( (uid_t) _syscall(PM_PROC_NR, GETUID, &m));
}
m.TTY_LINE = fd;
m.TTY_REQUEST = request;
m.ADDRESS = (char *) data;
- return(_syscall(FS, IOCTL, &m));
+ return(_syscall(VFS_PROC_NR, IOCTL, &m));
}
m.m1_i1 = proc;
m.m1_i2 = sig;
- return(_syscall(MM, KILL, &m));
+ return(_syscall(PM_PROC_NR, KILL, &m));
}
m.m1_i2 = strlen(name2) + 1;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) name2;
- return(_syscall(FS, LINK, &m));
+ return(_syscall(VFS_PROC_NR, LINK, &m));
}
m.m2_i1 = fd;
m.m2_l1 = offset;
m.m2_i2 = whence;
- if (_syscall(FS, LSEEK, &m) < 0) return( (off_t) -1);
+ if (_syscall(VFS_PROC_NR, LSEEK, &m) < 0) return( (off_t) -1);
return( (off_t) m.m2_l1);
}
m.m1_i1 = strlen(name) + 1;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) buffer;
- if((r = _syscall(FS, LSTAT, &m)) >= 0 || errno != ENOSYS)
+ if((r = _syscall(VFS_PROC_NR, LSTAT, &m)) >= 0 || errno != ENOSYS)
return r;
return _stat(name, buffer);
}
m.m1_i1 = strlen(name) + 1;
m.m1_i2 = mode;
m.m1_p1 = (char *) name;
- return(_syscall(FS, MKDIR, &m));
+ return(_syscall(VFS_PROC_NR, MKDIR, &m));
}
m.m1_i3 = dev;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) ((int) 0); /* obsolete size field */
- return(_syscall(FS, MKNOD, &m));
+ return(_syscall(VFS_PROC_NR, MKNOD, &m));
}
m.m3_i2 = flags;
}
va_end(argp);
- return (_syscall(FS, OPEN, &m));
+ return (_syscall(VFS_PROC_NR, OPEN, &m));
}
{
message m;
- return(_syscall(MM, PAUSE, &m));
+ return(_syscall(PM_PROC_NR, PAUSE, &m));
}
{
message m;
- if (_syscall(FS, PIPE, &m) < 0) return(-1);
+ if (_syscall(VFS_PROC_NR, PIPE, &m) < 0) return(-1);
fild[0] = m.m1_i1;
fild[1] = m.m1_i2;
return(0);
m.m2_i2 = req;
m.PMTRACE_ADDR = addr;
m.m2_l2 = data;
- if (_syscall(MM, PTRACE, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, PTRACE, &m) < 0) return(-1);
/* There was no error, but -1 is a legal return value. Clear errno if
* necessary to distinguish this case. _syscall has set errno to nonzero
m.m1_i1 = fd;
m.m1_i2 = nbytes;
m.m1_p1 = (char *) buffer;
- return(_syscall(FS, READ, &m));
+ return(_syscall(VFS_PROC_NR, READ, &m));
}
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) buffer;
- return(_syscall(FS, RDLNK, &m));
+ return(_syscall(VFS_PROC_NR, RDLNK, &m));
}
m.m1_i2 = strlen(name2) + 1;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) name2;
- return(_syscall(FS, RENAME, &m));
+ return(_syscall(VFS_PROC_NR, RENAME, &m));
}
message m;
_loadname(name, &m);
- return(_syscall(FS, RMDIR, &m));
+ return(_syscall(VFS_PROC_NR, RMDIR, &m));
}
m.SEL_ERRORFDS = (char *) errorfds;
m.SEL_TIMEOUT = (char *) timeout;
- return (_syscall(FS, SELECT, &m));
+ return (_syscall(VFS_PROC_NR, SELECT, &m));
}
message m;
m.m1_i1 = (int) grp;
- return(_syscall(MM, SETGID, &m));
+ return(_syscall(PM_PROC_NR, SETGID, &m));
}
PUBLIC int setegid(gid_t grp)
message m;
m.m1_i1 = (int) grp;
- return(_syscall(MM, SETEGID, &m));
+ return(_syscall(PM_PROC_NR, SETEGID, &m));
}
{
message m;
- return(_syscall(MM, SETSID, &m));
+ return(_syscall(PM_PROC_NR, SETSID, &m));
}
message m;
m.m1_i1 = usr;
- return(_syscall(MM, SETUID, &m));
+ return(_syscall(PM_PROC_NR, SETUID, &m));
}
PUBLIC int seteuid(uid_t usr)
message m;
m.m1_i1 = usr;
- return(_syscall(MM, SETEUID, &m));
+ return(_syscall(PM_PROC_NR, SETEUID, &m));
}
m.m1_p2 = (char *) oact;
m.m1_p3 = (char *) __sigreturn;
- return(_syscall(MM, SIGACTION, &m));
+ return(_syscall(PM_PROC_NR, SIGACTION, &m));
}
{
message m;
- if (_syscall(MM, SIGPENDING, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, SIGPENDING, &m) < 0) return(-1);
*set = (sigset_t) m.m2_l1;
return(m.m_type);
}
m.m2_i1 = how;
m.m2_l1 = (long) *set;
}
- if (_syscall(MM, SIGPROCMASK, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, SIGPROCMASK, &m) < 0) return(-1);
if (oset != (sigset_t *) NULL) *oset = (sigset_t) (m.m2_l1);
return(m.m_type);
}
m.m2_l1 = scp->sc_mask;
m.m2_i2 = scp->sc_flags;
m.m2_p1 = (char *) scp;
- return(_syscall(MM, SIGRETURN, &m)); /* normally this doesn't return */
+ return(_syscall(PM_PROC_NR, SIGRETURN, &m)); /* normally this doesn't return */
}
message m;
m.m2_l1 = (long) *set;
- return(_syscall(MM, SIGSUSPEND, &m));
+ return(_syscall(PM_PROC_NR, SIGSUSPEND, &m));
}
m.m1_i1 = strlen(name) + 1;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) buffer;
- return(_syscall(FS, STAT, &m));
+ return(_syscall(VFS_PROC_NR, STAT, &m));
}
message m;
m.m2_l1 = *top;
- return(_syscall(MM, STIME, &m));
+ return(_syscall(PM_PROC_NR, STIME, &m));
}
m.m1_i2 = strlen(name2) + 1;
m.m1_p1 = (char *) name;
m.m1_p2 = (char *) name2;
- return(_syscall(FS, SYMLINK, &m));
+ return(_syscall(VFS_PROC_NR, SYMLINK, &m));
}
{
message m;
- return(_syscall(FS, SYNC, &m));
+ return(_syscall(VFS_PROC_NR, SYNC, &m));
}
{
message m;
- if (_syscall(MM, TIME, &m) < 0) return( (time_t) -1);
+ if (_syscall(PM_PROC_NR, TIME, &m) < 0) return( (time_t) -1);
if (tp != (time_t *) 0) *tp = m.m2_l1;
return(m.m2_l1);
}
message m;
m.m4_l5 = 0; /* return this if system is pre-1.6 */
- if (_syscall(MM, TIMES, &m) < 0) return( (clock_t) -1);
+ if (_syscall(PM_PROC_NR, TIMES, &m) < 0) return( (clock_t) -1);
buf->tms_utime = m.m4_l1;
buf->tms_stime = m.m4_l2;
buf->tms_cutime = m.m4_l3;
m.m2_i1 = strlen(_path)+1;
m.m2_l1 = _length;
- return(_syscall(FS, TRUNCATE, &m));
+ return(_syscall(VFS_PROC_NR, TRUNCATE, &m));
}
PUBLIC int ftruncate(int _fd, off_t _length)
m.m2_l1 = _length;
m.m2_i1 = _fd;
- return(_syscall(FS, FTRUNCATE, &m));
+ return(_syscall(VFS_PROC_NR, FTRUNCATE, &m));
}
message m;
m.m1_i1 = complmode;
- return( (mode_t) _syscall(FS, UMASK, &m));
+ return( (mode_t) _syscall(VFS_PROC_NR, UMASK, &m));
}
message m;
_loadname(name, &m);
- return(_syscall(FS, UNLINK, &m));
+ return(_syscall(VFS_PROC_NR, UNLINK, &m));
}
m.m2_i1 = strlen(name) + 1;
}
m.m2_p1 = (char *) name;
- return(_syscall(FS, UTIME, &m));
+ return(_syscall(VFS_PROC_NR, UTIME, &m));
}
{
message m;
- if (_syscall(MM, WAIT, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, WAIT, &m) < 0) return(-1);
if (status != 0) *status = m.m2_i1;
return(m.m_type);
}
m.m1_i1 = pid;
m.m1_i2 = options;
- if (_syscall(MM, WAITPID, &m) < 0) return(-1);
+ if (_syscall(PM_PROC_NR, WAITPID, &m) < 0) return(-1);
if (status != 0) *status = m.m2_i1;
return m.m_type;
}
m.m1_i1 = fd;
m.m1_i2 = nbytes;
m.m1_p1 = (char *) buffer;
- return(_syscall(FS, WRITE, &m));
+ return(_syscall(VFS_PROC_NR, WRITE, &m));
}
{
message m;
- if (_syscall(MM, GETTIMEOFDAY, &m) < 0)
+ if (_syscall(PM_PROC_NR, GETTIMEOFDAY, &m) < 0)
return -1;
tp->tv_sec = m.m2_l1;
* to see if something really went wrong.)
*/
- if((v = _syscall(MM, GETPRIORITY, &m)) < 0) {
+ if((v = _syscall(PM_PROC_NR, GETPRIORITY, &m)) < 0) {
return v;
}
m.m1_i2 = who;
m.m1_i3 = prio;
- return _syscall(MM, SETPRIORITY, &m);
+ return _syscall(PM_PROC_NR, SETPRIORITY, &m);
}
/* Announce our presence to VFS. */
m.m_type = FS_READY;
- if ((r = send(FS_PROC_NR, &m)) != OK) {
+ if ((r = send(VFS_PROC_NR, &m)) != OK) {
printf("HGFS: unable to login to VFS (%d)\n", r);
return r;
for (;;) {
call_nr = get_work(&who_e);
- if (who_e != FS_PROC_NR) {
+ if (who_e != VFS_PROC_NR) {
continue;
}
reset_time();
source= mq->mq_mess.m_source;
m_type= mq->mq_mess.m_type;
- if (source == FS_PROC_NR)
+ if (source == VFS_PROC_NR)
{
sr_rec(mq);
}
int i, n=0;
static int prev_i;
- getsysinfo(FS_PROC_NR, SI_PROC_TAB, fproc);
+ getsysinfo(VFS_PROC_NR, SI_PROC_TAB, fproc);
printf("File System (FS) process table dump\n");
printf("-nr- -pid- -tty- -umask- --uid-- --gid-- -ldr- -sus-rev-proc-\n");
{
int i;
- getsysinfo(FS_PROC_NR, SI_DMAP_TAB, dmap);
+ getsysinfo(VFS_PROC_NR, SI_DMAP_TAB, dmap);
printf("File System (FS) device <-> driver mappings\n");
printf(" Label Major Driver ept Flags Style \n");
who_e = fs_m_in.m_source; /* source of the request */
- if (who_e != FS_PROC_NR) { /* If the message is not for us just
+ if (who_e != VFS_PROC_NR) { /* If the message is not for us just
* continue */
continue;
}
fs_m_in.m_type = FS_READY;
- if ((r = send(FS_PROC_NR, &fs_m_in)) != OK) {
+ if ((r = send(VFS_PROC_NR, &fs_m_in)) != OK) {
panic("Error sending login to VFS: %d", r);
}
if(len < 1) return(EINVAL); /* too small */
/* Copy the pathname and set up caller's user and group id */
- r = sys_safecopyfrom(FS_PROC_NR, grant, 0, (vir_bytes) user_path,
+ r = sys_safecopyfrom(VFS_PROC_NR, grant, 0, (vir_bytes) user_path,
(phys_bytes) len, D);
if (r != OK) {
printf("ISOFS %s:%d sys_safecopyfrom failed: %d\n",
/* If the new record does not fit, then copy the buffer
* and start from the beginning. */
if (tmpbuf_offset + reclen > GETDENTS_BUFSIZ) {
- r = sys_safecopyto(FS_PROC_NR, gid, userbuf_off,
+ r = sys_safecopyto(VFS_PROC_NR, gid, userbuf_off,
(vir_bytes)getdents_buf, tmpbuf_offset, D);
if (r != OK)
}
if (tmpbuf_offset != 0) {
- r = sys_safecopyto(FS_PROC_NR, gid, userbuf_off,
+ r = sys_safecopyto(VFS_PROC_NR, gid, userbuf_off,
(vir_bytes) getdents_buf, tmpbuf_offset, D);
if (r != OK)
panic("fs_getdents: sys_safecopyto failed: %d", r);
panic("bp not valid in rw_chunk; this can't happen");
}
- r = sys_safecopyto(FS_PROC_NR, gid, buf_off,
+ r = sys_safecopyto(VFS_PROC_NR, gid, buf_off,
(vir_bytes) (bp->b_data+off), (phys_bytes) chunk, D);
put_block(bp);
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
/* Copy the link name's last component */
- r = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Copy the last component */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
- r = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
if (r != OK) return r;
NUL(string, len, sizeof(string));
below max file size */
copylen = min( copylen, (unsigned) rip->i_size);
bp = get_block(rip->i_dev, b, NORMAL);
- r = sys_safecopyto(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) bp->b_data,
(size_t) copylen, D);
put_block(bp, DIRECTORY_BLOCK);
/* Copy the last component of the old name */
len = min( (unsigned) fs_m_in.REQ_REN_LEN_OLD, sizeof(old_name));
- r = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_OLD,
+ r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_OLD,
(vir_bytes) 0, (vir_bytes) old_name, (size_t) len, D);
if (r != OK) return r;
NUL(old_name, len, sizeof(old_name));
/* Copy the last component of the new name */
len = min( (unsigned) fs_m_in.REQ_REN_LEN_NEW, sizeof(new_name));
- r = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_NEW,
+ r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_NEW,
(vir_bytes) 0, (vir_bytes) new_name, (size_t) len, D);
if (r != OK) return r;
NUL(new_name, len, sizeof(new_name));
fs_m_in.m_type = FS_READY;
- if ((r = send(FS_PROC_NR, &fs_m_in)) != OK) {
+ if ((r = send(VFS_PROC_NR, &fs_m_in)) != OK) {
panic("Error sending login to VFS: %d", r);
}
/* Copy the last component (i.e., file name) */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
- err_code = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
/* Copy the last component and set up caller's user and group id */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
- err_code = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
/* Copy the last component and set up caller's user and group id */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
- err_code = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
if(err_code != OK) return(err_code);
NUL(lastc, len, sizeof(lastc));
/* Copy the link name's last component */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
- r = sys_safecopyfrom(FS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
if (r != OK) return(r);
NUL(string, len, sizeof(string));
if (bp == NULL)
r = err_code;
else
- r = sys_safecopyfrom(FS_PROC_NR,
+ r = sys_safecopyfrom(VFS_PROC_NR,
(cp_grant_id_t) fs_m_in.REQ_GRANT3,
(vir_bytes) 0, (vir_bytes) bp->b_data,
(size_t) fs_m_in.REQ_MEM_SIZE, D);
if(len == 0) return(EINVAL); /* too small */
/* Copy the pathname and set up caller's user and group id */
- r = sys_safecopyfrom(FS_PROC_NR, grant, /*offset*/ (vir_bytes) 0,
+ r = sys_safecopyfrom(VFS_PROC_NR, grant, /*offset*/ (vir_bytes) 0,
(vir_bytes) user_path, (size_t) len, D);
if(r != OK) return(r);
cred_size = (size_t) fs_m_in.REQ_UCRED_SIZE;
if (cred_size > sizeof(credentials)) return(EINVAL); /* Too big. */
- r = sys_safecopyfrom(FS_PROC_NR, grant2, (vir_bytes) 0,
+ r = sys_safecopyfrom(VFS_PROC_NR, grant2, (vir_bytes) 0,
(vir_bytes) &credentials, cred_size, D);
if (r != OK) return(r);
len = strlen(user_path)+1;
if(len > path_size) return(ENAMETOOLONG);
- r1 = sys_safecopyto(FS_PROC_NR, grant, (vir_bytes) 0,
+ r1 = sys_safecopyto(VFS_PROC_NR, grant, (vir_bytes) 0,
(vir_bytes) user_path, (size_t) len, D);
if(r1 != OK) return(r1);
}
if (rw_flag == READING) {
/* Copy a chunk from the block buffer to user space. */
- r = sys_safecopyto(FS_PROC_NR, gid, (vir_bytes) buf_off,
+ r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) buf_off,
(vir_bytes) (bp->b_data+off), (size_t) chunk, D);
} else {
/* Copy a chunk from user space to the block buffer. */
- r = sys_safecopyfrom(FS_PROC_NR, gid, (vir_bytes) buf_off,
+ r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) buf_off,
(vir_bytes) (bp->b_data+off), (size_t) chunk, D);
bp->b_dirt = DIRTY;
}
ent_pos = block_pos + ((char *) dp - (bp->b_data));
if(tmpbuf_off + reclen > GETDENTS_BUFSIZ) {
- r = sys_safecopyto(FS_PROC_NR, gid,
+ r = sys_safecopyto(VFS_PROC_NR, gid,
(vir_bytes) userbuf_off,
(vir_bytes) getdents_buf,
(size_t) tmpbuf_off, D);
}
if(tmpbuf_off != 0) {
- r = sys_safecopyto(FS_PROC_NR, gid, (vir_bytes) userbuf_off,
+ r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) userbuf_off,
(vir_bytes) getdents_buf, (size_t) tmpbuf_off, D);
if (r != OK) {
put_inode(rip);
if (rw_flag == READING) {
/* Copy a chunk from the block buffer to user space. */
- r = sys_safecopyto(FS_PROC_NR, gid, (vir_bytes) 0,
+ r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) 0,
(vir_bytes) (bp->b_data+position), (size_t) nrbytes, D);
} else {
/* Copy a chunk from user space to the block buffer. */
- r = sys_safecopyfrom(FS_PROC_NR, gid, (vir_bytes) 0,
+ r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) 0,
(vir_bytes) (bp->b_data+position), (size_t) nrbytes, D);
}
int r, flags;
char *stack_top;
- if (who_e != FS_PROC_NR && who_e != RS_PROC_NR)
+ if (who_e != VFS_PROC_NR && who_e != RS_PROC_NR)
return EPERM;
proc_e= m_in.EXC_NM_PROC;
printf("PM: INIT died\n");
return;
}
- if (proc_nr_e == FS_PROC_NR)
+ if (proc_nr_e == VFS_PROC_NR)
{
panic("exit_proc: FS died: %d", r);
}
case PM_UNPAUSE_REPLY:
case PM_REBOOT_REPLY:
case PM_SETGROUPS_REPLY:
- if (who_e == FS_PROC_NR)
+ if (who_e == VFS_PROC_NR)
{
handle_fs_reply();
result= SUSPEND; /* don't reply */
mess.PM_SLOT = ip->proc_nr;
mess.PM_PID = rmp->mp_pid;
mess.PM_PROC = rmp->mp_endpoint;
- if (OK != (s=send(FS_PROC_NR, &mess)))
+ if (OK != (s=send(VFS_PROC_NR, &mess)))
panic("can't sync up with FS: %d", s);
}
}
/* Tell FS that no more system processes follow and synchronize. */
mess.PR_ENDPT = NONE;
- if (sendrec(FS_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");
#if (CHIP == INTEL)
/* Tell FS to reboot */
m.m_type = PM_REBOOT;
- tell_fs(&mproc[FS_PROC_NR], &m);
+ tell_fs(&mproc[VFS_PROC_NR], &m);
return(SUSPEND); /* don't reply to caller */
}
if (rmp->mp_flags & FS_CALL)
panic("tell_fs: not idle: %d", m_ptr->m_type);
- r = asynsend3(FS_PROC_NR, m_ptr, AMF_NOREPLY);
+ r = asynsend3(VFS_PROC_NR, m_ptr, AMF_NOREPLY);
if (r != OK)
panic("unable to send to FS: %d", r);
/* Send masks determine to whom processes can send messages or notifications. */
#define SRV_M (~0) /* system services */
#define RUSR_M \
- ( spi_to(PM_PROC_NR) | spi_to(FS_PROC_NR) | spi_to(RS_PROC_NR) \
+ ( spi_to(PM_PROC_NR) | spi_to(VFS_PROC_NR) | spi_to(RS_PROC_NR) \
| spi_to(VM_PROC_NR) ) /* root user proc */
/* Define the signal manager for the various process types. */
else if (strcmp(label, "PM") == 0)
endpoint= PM_PROC_NR;
else if (strcmp(label, "VFS") == 0)
- endpoint= FS_PROC_NR;
+ endpoint= VFS_PROC_NR;
else if (strcmp(label, "RS") == 0)
endpoint= RS_PROC_NR;
else if (strcmp(label, "LOG") == 0)
switch(st.m_type) {
case DEV_REVIVE:
endpt = st.REP_ENDPT;
- if(endpt == FS_PROC_NR) {
+ if(endpt == VFS_PROC_NR) {
endpt = suspended_ep(m->m_source,
st.REP_IO_GRANT);
if(endpt == NONE) {
* endpoint becomes FS if it wasn't already.
*/
if(GRANT_VALID(*gid)) {
- *io_ept = FS_PROC_NR;
+ *io_ept = VFS_PROC_NR;
return 1;
}
if ( ((vmp->m_dev >> MAJOR) & BYTE) != maj) continue;
minor = ((vmp->m_dev >> MINOR) & BYTE);
- if ((r = dev_open(vmp->m_dev, FS_PROC_NR,
+ if ((r = dev_open(vmp->m_dev, VFS_PROC_NR,
vmp->m_flags ? R_BIT : (R_BIT|W_BIT))) != OK) {
printf("VFS: mounted dev %d/%d re-open failed: %d.\n",
maj, minor, r);
else if ((r1 = forbidden(vp, X_BIT)) != OK)
r = r1;
else
- r = req_stat(vp->v_fs_e, vp->v_inode_nr, FS_PROC_NR,
+ r = req_stat(vp->v_fs_e, vp->v_inode_nr, VFS_PROC_NR,
(char *) &sb, 0);
if (r != OK) {
put_vnode(vp);
/* Issue request */
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, cvul64(pos), READING,
- FS_PROC_NR, (char*)&hdr, sizeof(hdr), &new_pos, &cum_io);
+ VFS_PROC_NR, (char*)&hdr, sizeof(hdr), &new_pos, &cum_io);
if (r != OK) return r;
/* Interpreted script? */
/* Issue request */
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, cvul64(pos), READING,
- FS_PROC_NR, buf, _MAX_BLOCK_SIZE, &new_pos, &cum_io);
+ VFS_PROC_NR, buf, _MAX_BLOCK_SIZE, &new_pos, &cum_io);
if (r != OK) return(r);
n = vp->v_size;
if (n > sizeof(buf))
n = sizeof(buf);
- if ((r = req_readwrite(vp->v_fs_e,vp->v_inode_nr,cvul64(off+o), READING, FS_PROC_NR, buf,
+ if ((r = req_readwrite(vp->v_fs_e,vp->v_inode_nr,cvul64(off+o), READING, VFS_PROC_NR, buf,
n, &new_pos, &cum_io)) != OK) {
printf("VFS: read_seg: req_readwrite failed (text)\n");
return(r);
return(EIO);
}
- if ((r = sys_vircopy(FS_PROC_NR, D, (vir_bytes)buf, proc_e,
+ if ((r = sys_vircopy(VFS_PROC_NR, D, (vir_bytes)buf, proc_e,
seg, o, n)) != OK) {
printf("VFS: read_seg: copy failed (text)\n");
return(r);
/* Fetch the flock structure from user space. */
user_flock = (vir_bytes) m_in.name1;
- r = sys_datacopy(who_e, (vir_bytes) user_flock, FS_PROC_NR,
+ r = sys_datacopy(who_e, (vir_bytes) user_flock, VFS_PROC_NR,
(vir_bytes) &flock, (phys_bytes) sizeof(flock));
if (r != OK) return(EINVAL);
}
/* Copy the flock structure back to the caller. */
- r = sys_datacopy(FS_PROC_NR, (vir_bytes) &flock,
+ r = sys_datacopy(VFS_PROC_NR, (vir_bytes) &flock,
who_e, (vir_bytes) user_flock, (phys_bytes) sizeof(flock));
return(r);
}
endpoint_t endpt;
endpt = m_in.REP_ENDPT;
- if(endpt == FS_PROC_NR) {
+ if(endpt == VFS_PROC_NR) {
endpt = suspended_ep(m_in.m_source, m_in.REP_IO_GRANT);
if(endpt == NONE) {
printf("FS: proc with "
/* The following initializations are needed to let dev_opcl succeed .*/
fp = (struct fproc *) NULL;
- who_e = who_p = FS_PROC_NR;
+ who_e = who_p = VFS_PROC_NR;
/* Initialize device table. */
build_dmap();
} else {
/* String is not contained in the message. Get it from user space. */
r = sys_datacopy(who_e, (vir_bytes) path,
- FS_PROC_NR, (vir_bytes) user_fullpath, (phys_bytes) len);
+ VFS_PROC_NR, (vir_bytes) user_fullpath, (phys_bytes) len);
}
if (user_fullpath[len - 1] != '\0') {