Moved stime, time, times POSIX calls from FS to PM. Removed child time
accounting from kernel (now in PM). Large amount of files in this commit is due to system time problems during development.
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
* process. Thus NR_PROCS must be the same as in the kernel. It is not
|
||||
* possible or even necessary to tell when a slot is free here.
|
||||
*/
|
||||
|
||||
|
||||
EXTERN struct fproc {
|
||||
mode_t fp_umask; /* mask set by umask system call */
|
||||
struct inode *fp_workdir; /* pointer to working directory's inode */
|
||||
|
||||
@@ -71,10 +71,12 @@ PUBLIC void main()
|
||||
}
|
||||
|
||||
/* Call the internal function that does the work. */
|
||||
if (call_nr < 0 || call_nr >= NCALLS)
|
||||
if (call_nr < 0 || call_nr >= NCALLS) {
|
||||
error = ENOSYS;
|
||||
else
|
||||
printf("FS, warning illegal %d system call by %d\n", call_nr, who);
|
||||
} else {
|
||||
error = (*call_vec[call_nr])();
|
||||
}
|
||||
|
||||
/* Copy the results back to the user and send reply. */
|
||||
if (error != SUSPEND) { reply(who, error); }
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define whence m2_i2
|
||||
#define svrctl_req m2_i1
|
||||
#define svrctl_argp m2_p1
|
||||
#define pm_stime m1_i1
|
||||
|
||||
/* The following names are synonyms for the variables in the output message. */
|
||||
#define reply_type m_type
|
||||
|
||||
@@ -153,9 +153,8 @@ _PROTOTYPE( int get_block_size, (dev_t dev) );
|
||||
|
||||
/* time.c */
|
||||
_PROTOTYPE( int do_stime, (void) );
|
||||
_PROTOTYPE( int do_time, (void) );
|
||||
_PROTOTYPE( int do_tims, (void) );
|
||||
_PROTOTYPE( int do_utime, (void) );
|
||||
|
||||
/* cmostime.c */
|
||||
_PROTOTYPE( int do_cmostime, (void) );
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
||||
do_unlink, /* 10 = unlink */
|
||||
no_sys, /* 11 = waitpid */
|
||||
do_chdir, /* 12 = chdir */
|
||||
do_time, /* 13 = time */
|
||||
no_sys, /* 13 = time */
|
||||
do_mknod, /* 14 = mknod */
|
||||
do_chmod, /* 15 = chmod */
|
||||
do_chown, /* 16 = chown */
|
||||
@@ -58,7 +58,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
||||
do_unlink, /* 40 = rmdir */
|
||||
do_dup, /* 41 = dup */
|
||||
do_pipe, /* 42 = pipe */
|
||||
do_tims, /* 43 = times */
|
||||
no_sys, /* 43 = times */
|
||||
no_sys, /* 44 = (prof) */
|
||||
no_sys, /* 45 = unused */
|
||||
do_set, /* 46 = setgid */
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
*
|
||||
* The entry points into this file are
|
||||
* do_utime: perform the UTIME system call
|
||||
* do_time: perform the TIME system call
|
||||
* do_stime: perform the STIME system call
|
||||
* do_tims: perform the TIMES system call
|
||||
* do_stime: PM informs FS about STIME system call
|
||||
*/
|
||||
|
||||
#include "fs.h"
|
||||
@@ -58,54 +56,14 @@ PUBLIC int do_utime()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* do_time *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_time()
|
||||
|
||||
{
|
||||
/* Perform the time(tp) system call. */
|
||||
|
||||
m_out.reply_l1 = clock_time(); /* return time in seconds */
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* do_stime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_stime()
|
||||
{
|
||||
/* Perform the stime(tp) system call. Retrieve the system's uptime (ticks
|
||||
* since boot) and store the time in seconds at system boot in the global
|
||||
* variable 'boottime'.
|
||||
*/
|
||||
|
||||
register int k;
|
||||
clock_t uptime;
|
||||
|
||||
if (!super_user) return(EPERM);
|
||||
if ( (k=sys_getuptime(&uptime)) != OK) panic("do_stime error", k);
|
||||
boottime = (long) m_in.tp - (uptime/HZ);
|
||||
/* Perform the stime(tp) system call. */
|
||||
boottime = (long) m_in.pm_stime;
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* do_tims *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_tims()
|
||||
{
|
||||
/* Perform the times(buffer) system call. */
|
||||
|
||||
clock_t t[5];
|
||||
|
||||
sys_times(who, t);
|
||||
m_out.reply_t1 = t[0];
|
||||
m_out.reply_t2 = t[1];
|
||||
m_out.reply_t3 = t[2];
|
||||
m_out.reply_t4 = t[3];
|
||||
m_out.reply_t5 = t[4];
|
||||
return(OK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user