int main (int argc, char *argv[])
{
- int param;
+ unsigned long param;
endpoint_t proc_e = NONE;
struct sysgetenv sysgetenv;
char *to_whom, *operation, *what, *value;
#include <stdio.h>
#include <time.h>
#include <unistd.h>
-#include <sys/svrctl.h>
#ifndef __minix_vmd
#include <sys/times.h>
#endif
#include <stdio.h>
#include <time.h>
#include <unistd.h>
-#include <sys/svrctl.h>
#ifndef __minix_vmd
#include <sys/times.h>
#endif
#include <minix/com.h>
#include <minix/log.h>
#include <machine/cmos.h>
-#include <sys/svrctl.h>
#include "readclock.h"
#include <minix/com.h>
#include <minix/type.h>
#include <minix/safecopies.h>
-#include <sys/svrctl.h>
#include "readclock.h"
#include <sys/ioc_disk.h>
#include <machine/pci.h>
#include <sys/mman.h>
-#include <sys/svrctl.h>
/* Variables. */
} mess_lc_readclock_rtcdev;
_ASSERT_MSG_SIZE(mess_lc_readclock_rtcdev);
+typedef struct {
+ unsigned long request;
+ vir_bytes arg;
+
+ uint8_t padding[48];
+} mess_lc_svrctl;
+_ASSERT_MSG_SIZE(mess_lc_svrctl);
+
typedef struct {
vir_bytes name;
size_t len;
} mess_lsys_sched_scheduling_stop;
_ASSERT_MSG_SIZE(mess_lsys_sched_scheduling_stop);
-typedef struct {
- int request;
- vir_bytes arg;
-
- uint8_t padding[48];
-} mess_lsys_svrctl;
-_ASSERT_MSG_SIZE(mess_lsys_svrctl);
-
typedef struct {
int request;
int fkeys;
mess_lc_pm_time m_lc_pm_time;
mess_lc_pm_waitpid m_lc_pm_waitpid;
mess_lc_readclock_rtcdev m_lc_readclock_rtcdev;
+ mess_lc_svrctl m_lc_svrctl;
mess_lc_vfs_chown m_lc_vfs_chown;
mess_lc_vfs_close m_lc_vfs_close;
mess_lc_vfs_creat m_lc_vfs_creat;
mess_lsys_pm_srv_fork m_lsys_pm_srv_fork;
mess_lsys_sched_scheduling_start m_lsys_sched_scheduling_start;
mess_lsys_sched_scheduling_stop m_lsys_sched_scheduling_stop;
- mess_lsys_svrctl m_lsys_svrctl;
mess_lsys_tty_fkey_ctl m_lsys_tty_fkey_ctl;
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
#include <minix/ioctl.h>
/* PM controls. */
-#define PMGETPARAM _IOW('M', 5, struct sysgetenv)
-#define PMSETPARAM _IOR('M', 7, struct sysgetenv)
+#define PMGETPARAM _IOWR('P', 0, struct sysgetenv)
+#define PMSETPARAM _IOW('P', 1, struct sysgetenv)
+
+#define OPMGETPARAM _IOW('M', 5, struct sysgetenv) /* old, phasing out */
+#define OPMSETPARAM _IOR('M', 7, struct sysgetenv) /* old, phasing out */
/* VFS controls */
-#define VFSSETPARAM _IOR('M', 130, struct sysgetenv)
-#define VFSGETPARAM _IOR('M', 131, struct sysgetenv)
+#define VFSGETPARAM _IOWR('F', 0, struct sysgetenv)
+#define VFSSETPARAM _IOW('F', 1, struct sysgetenv)
struct sysgetenv {
char *key; /* Name requested. */
size_t vallen; /* Size of return data buffer. */
};
-int svrctl(int _request, void *_data);
+int svrctl(unsigned long _request, void *_data);
#endif /* _SYS__SVRCTL_H */
#include <string.h>
#include <sys/svrctl.h>
-int svrctl(int request, void *argp)
+int svrctl(unsigned long request, void *argp)
{
message m;
memset(&m, 0, sizeof(m));
- m.m_lsys_svrctl.request = request;
- m.m_lsys_svrctl.arg = argp;
+ m.m_lc_svrctl.request = request;
+ m.m_lc_svrctl.arg = (vir_bytes)argp;
- switch ((request >> 8) & 0xFF) {
- case 'M':
- case 'S':
- /* PM handles calls for itself and the kernel. */
+ switch (IOCGROUP(request)) {
+ case 'M': /* old, phasing out */
+ case 'P': /* to PM */
return _syscall(PM_PROC_NR, PM_SVRCTL, &m);
- case 'F':
- case 'I':
- /* VFS handles calls for itself and inet. */
+ case 'F': /* to VFS */
return _syscall(VFS_PROC_NR, VFS_SVRCTL, &m);
default:
errno = EINVAL;
#include <fcntl.h>
#include <unistd.h>
-#include <sys/svrctl.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
#include <minix/chardriver.h>
#include "inet.h"
#include "generic/assert.h"
-#include <sys/svrctl.h>
#include "queryparam.h"
#include "generic/buf.h"
#include <unistd.h>
#include <minix/timers.h>
-#include <sys/svrctl.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
#include <errno.h>
/*===========================================================================*
* do_svrctl *
*===========================================================================*/
-int do_svrctl()
+int do_svrctl(void)
{
- int s, req;
+ unsigned long req;
+ int s;
vir_bytes ptr;
#define MAX_LOCAL_PARAMS 2
static struct {
} local_param_overrides[MAX_LOCAL_PARAMS];
static int local_params = 0;
- req = m_in.m_lsys_svrctl.request;
- ptr = m_in.m_lsys_svrctl.arg;
+ req = m_in.m_lc_svrctl.request;
+ ptr = m_in.m_lc_svrctl.arg;
- /* Is the request indeed for the PM? */
- if (((req >> 8) & 0xFF) != 'M') return(EINVAL);
+ /* Is the request indeed for the PM? ('M' is old and being phased out) */
+ if (IOCGROUP(req) != 'P' && IOCGROUP(req) != 'M') return(EINVAL);
/* Control operations local to the PM. */
switch(req) {
+ case OPMSETPARAM:
+ case OPMGETPARAM:
case PMSETPARAM:
case PMGETPARAM: {
struct sysgetenv sysgetenv;
sizeof(sysgetenv)) != OK) return(EFAULT);
/* Set a param override? */
- if (req == PMSETPARAM) {
+ if (req == PMSETPARAM || req == OPMSETPARAM) {
if (local_params >= MAX_LOCAL_PARAMS) return ENOSPC;
if (sysgetenv.keylen <= 0
|| sysgetenv.keylen >=
*===========================================================================*/
int do_svrctl(void)
{
- unsigned int svrctl;
+ unsigned long svrctl;
vir_bytes ptr;
- svrctl = job_m_in.m_lsys_svrctl.request;
- ptr = job_m_in.m_lsys_svrctl.arg;
- if (((svrctl >> 8) & 0xFF) != 'M') return(EINVAL);
+ svrctl = job_m_in.m_lc_svrctl.request;
+ ptr = job_m_in.m_lc_svrctl.arg;
+
+ if (IOCGROUP(svrctl) != 'F') return(EINVAL);
switch (svrctl) {
case VFSSETPARAM: