Miscellaneous legacy cleanup
This commit is contained in:
parent
3fbb50397c
commit
b02c260ecb
12 changed files with 47 additions and 137 deletions
|
@ -72,7 +72,6 @@
|
|||
#define REBOOT 76
|
||||
#define SVRCTL 77
|
||||
#define SYSUNAME 78
|
||||
#define GETSYSINFO 79 /* to PM or VFS (obsolete) */
|
||||
#define GETDENTS 80 /* to VFS */
|
||||
#define LLSEEK 81 /* to VFS */
|
||||
#define FSTATFS 82 /* to VFS */
|
||||
|
@ -90,7 +89,6 @@
|
|||
#define FTRUNCATE 94 /* to VFS */
|
||||
#define FCHMOD 95 /* to VFS */
|
||||
#define FCHOWN 96 /* to VFS */
|
||||
#define GETSYSINFO_UP 97 /* to PM (obsolete) */
|
||||
#define SPROF 98 /* to PM */
|
||||
#define CPROF 99 /* to PM */
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@
|
|||
#define is_notify(a) ((unsigned) ((a) - NOTIFY_MESSAGE) < 0x100)
|
||||
#define is_ipc_asynch(ipc_status) \
|
||||
(is_ipc_notify(ipc_status) || IPC_STATUS_CALL(ipc_status) == SENDA)
|
||||
#define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS))
|
||||
|
||||
/* Shorthands for message parameters passed with notifications. */
|
||||
#define NOTIFY_ARG m2_l1
|
||||
|
@ -182,7 +181,6 @@
|
|||
*/
|
||||
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* Messages for BLOCK and CHARACTER device drivers *
|
||||
*===========================================================================*/
|
||||
|
@ -194,8 +192,6 @@
|
|||
#define CANCEL (DEV_RQ_BASE + 0) /* force a task to cancel */
|
||||
#define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */
|
||||
#define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */
|
||||
#define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */
|
||||
#define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */
|
||||
#define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */
|
||||
#define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */
|
||||
#define DEV_REOPEN (DEV_RQ_BASE + 14) /* reopen a minor device */
|
||||
|
@ -205,12 +201,9 @@
|
|||
#define DEV_SCATTER_S (DEV_RQ_BASE + 22) /* (safecopy) write from a vector */
|
||||
#define DEV_GATHER_S (DEV_RQ_BASE + 23) /* (safecopy) read into a vector */
|
||||
#define DEV_IOCTL_S (DEV_RQ_BASE + 24) /* (safecopy) I/O control code */
|
||||
#define DEV_MMAP_S (DEV_RQ_BASE + 25) /* (safecopy) mmap interface */
|
||||
|
||||
#define IS_DEV_RQ(type) (((type) & ~0xff) == DEV_RQ_BASE)
|
||||
|
||||
#define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */
|
||||
#define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */
|
||||
#define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */
|
||||
#define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */
|
||||
#define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply */
|
||||
|
@ -248,21 +241,6 @@
|
|||
#define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */
|
||||
#define TTY_PGRP m2_i3 /* message parameter: process group */
|
||||
|
||||
/* Field names for the QIC 02 status reply from tape driver */
|
||||
#define TAPE_STAT0 m2_l1
|
||||
#define TAPE_STAT1 m2_l2
|
||||
|
||||
/* Field names for the fstatvfs call */
|
||||
#define FSTATVFS_FD m1_i1
|
||||
#define FSTATVFS_BUF m1_p1
|
||||
|
||||
/* Field names for the statvfs call */
|
||||
#define STATVFS_LEN m1_i1
|
||||
#define STATVFS_NAME m1_p1
|
||||
#define STATVFS_BUF m1_p2
|
||||
|
||||
#define PM_GETSID_PID m1_i1
|
||||
|
||||
/*===========================================================================*
|
||||
* Messages for networking layer *
|
||||
*===========================================================================*/
|
||||
|
@ -291,7 +269,6 @@
|
|||
#define DL_TASK_REPLY (DL_RS_BASE + 2)
|
||||
|
||||
/* Field names for data link layer messages. */
|
||||
#define DL_ENDPT_LEGACY m2_i2 /* obsolete; will be removed */
|
||||
#define DL_COUNT m2_i3
|
||||
#define DL_MODE m2_l1
|
||||
#define DL_FLAGS m2_l1
|
||||
|
@ -854,36 +831,9 @@
|
|||
*/
|
||||
|
||||
/*===========================================================================*
|
||||
* Miscellaneous field names *
|
||||
* Common requests and miscellaneous field names *
|
||||
*===========================================================================*/
|
||||
|
||||
/* PM field names */
|
||||
/* BRK */
|
||||
#define PMBRK_ADDR m1_p1
|
||||
|
||||
/* TRACE */
|
||||
#define PMTRACE_ADDR m2_l1
|
||||
|
||||
#define PM_ENDPT m1_i1
|
||||
#define PM_PENDPT m1_i2
|
||||
|
||||
#define PM_NUID m2_i1
|
||||
#define PM_NGID m2_i2
|
||||
|
||||
/* Field names for GETSYSINFO_UP (PM) (obsolete). */
|
||||
#define SIU_WHAT m2_i1
|
||||
# define SIU_LOADINFO 1 /* retrieve load info data */
|
||||
# define SIU_SYSTEMHZ 2 /* retrieve system clock frequency */
|
||||
#define SIU_LEN m2_i2
|
||||
#define SIU_WHERE m2_p1
|
||||
|
||||
/* Field names for SELECT (FS). */
|
||||
#define SEL_NFDS m8_i1
|
||||
#define SEL_READFDS m8_p1
|
||||
#define SEL_WRITEFDS m8_p2
|
||||
#define SEL_ERRORFDS m8_p3
|
||||
#define SEL_TIMEOUT m8_p4
|
||||
|
||||
#define COMMON_RQ_BASE 0xE00
|
||||
|
||||
/* Field names for system signals (sent by a signal manager). */
|
||||
|
@ -897,14 +847,42 @@
|
|||
# define GCOV_BUFF_P m1_p1
|
||||
# define GCOV_BUFF_SZ m1_i1
|
||||
|
||||
/* Common request to several system servers: retrieve system information.
|
||||
* The GETSYSINFO userland call is an (old and deprecated) alias of this, so do
|
||||
* not change the fields or old userland applications may break.
|
||||
*/
|
||||
/* Common request to several system servers: retrieve system information. */
|
||||
#define COMMON_GETSYSINFO (COMMON_RQ_BASE+2)
|
||||
# define SI_WHAT m1_i1
|
||||
# define SI_WHERE m1_p1
|
||||
|
||||
/* PM field names */
|
||||
/* BRK */
|
||||
#define PMBRK_ADDR m1_p1
|
||||
|
||||
/* TRACE */
|
||||
#define PMTRACE_ADDR m2_l1
|
||||
|
||||
#define PM_ENDPT m1_i1
|
||||
#define PM_PENDPT m1_i2
|
||||
|
||||
#define PM_NUID m2_i1
|
||||
#define PM_NGID m2_i2
|
||||
|
||||
#define PM_GETSID_PID m1_i1
|
||||
|
||||
/* Field names for SELECT (FS). */
|
||||
#define SEL_NFDS m8_i1
|
||||
#define SEL_READFDS m8_p1
|
||||
#define SEL_WRITEFDS m8_p2
|
||||
#define SEL_ERRORFDS m8_p3
|
||||
#define SEL_TIMEOUT m8_p4
|
||||
|
||||
/* Field names for the fstatvfs call */
|
||||
#define FSTATVFS_FD m1_i1
|
||||
#define FSTATVFS_BUF m1_p1
|
||||
|
||||
/* Field names for the statvfs call */
|
||||
#define STATVFS_LEN m1_i1
|
||||
#define STATVFS_NAME m1_p1
|
||||
#define STATVFS_BUF m1_p2
|
||||
|
||||
/*===========================================================================*
|
||||
* Messages for VM server *
|
||||
*===========================================================================*/
|
||||
|
|
|
@ -105,7 +105,7 @@ PRIVATE void set_idle_name(char * name, int n)
|
|||
#define PICK_HIGHERONLY 2
|
||||
|
||||
#define BuildNotifyMessage(m_ptr, src, dst_ptr) \
|
||||
(m_ptr)->m_type = NOTIFY_FROM(src); \
|
||||
(m_ptr)->m_type = NOTIFY_MESSAGE; \
|
||||
(m_ptr)->NOTIFY_TIMESTAMP = get_uptime(); \
|
||||
switch (src) { \
|
||||
case HARDWARE: \
|
||||
|
|
|
@ -64,19 +64,12 @@ PUBLIC int do_getsysinfo()
|
|||
size_t len;
|
||||
|
||||
/* Only su may call do_getsysinfo. This call may leak information (and is not
|
||||
* stable enough to be part of the API/ABI).
|
||||
* stable enough to be part of the API/ABI). In the future, requests from
|
||||
* non-system processes should be denied.
|
||||
*/
|
||||
|
||||
if (!super_user) return(EPERM);
|
||||
|
||||
/* This call should no longer be used by user applications. In the future,
|
||||
* requests from non-system processes should be denied. For now, just warn.
|
||||
*/
|
||||
if (call_nr == GETSYSINFO) {
|
||||
printf("VFS: obsolete call of do_getsysinfo() by proc %d\n",
|
||||
fp->fp_endpoint);
|
||||
}
|
||||
|
||||
switch(m_in.info_what) {
|
||||
case SI_PROC_TAB:
|
||||
src_addr = (vir_bytes) fproc;
|
||||
|
|
|
@ -93,7 +93,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
no_sys, /* 76 = (reboot) */
|
||||
do_svrctl, /* 77 = svrctl */
|
||||
no_sys, /* 78 = (sysuname) */
|
||||
do_getsysinfo, /* 79 = getsysinfo */
|
||||
no_sys, /* 79 = unused */
|
||||
do_getdents, /* 80 = getdents */
|
||||
do_llseek, /* 81 = llseek */
|
||||
do_fstatfs, /* 82 = fstatfs */
|
||||
|
@ -111,7 +111,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
do_ftruncate, /* 94 = truncate */
|
||||
do_chmod, /* 95 = fchmod */
|
||||
do_chown, /* 96 = fchown */
|
||||
no_sys, /* 97 = (getsysinfo_up) */
|
||||
no_sys, /* 97 = unused */
|
||||
no_sys, /* 98 = (sprofile) */
|
||||
no_sys, /* 99 = (cprofile) */
|
||||
/* THE MINIX3 ABI ENDS HERE */
|
||||
|
|
|
@ -543,7 +543,6 @@ eth_port_t *eth_port;
|
|||
errno));
|
||||
}
|
||||
m.m_type= DL_WRITEV_S;
|
||||
m.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
|
||||
m.DL_COUNT= i;
|
||||
m.DL_GRANT= eth_port->etp_osdep.etp_wr_vec_grant;
|
||||
|
||||
|
@ -710,7 +709,6 @@ eth_port_t *eth_port;
|
|||
}
|
||||
|
||||
mess.m_type= DL_READV_S;
|
||||
mess.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
|
||||
mess.DL_COUNT= i;
|
||||
mess.DL_GRANT= eth_port->etp_osdep.etp_rd_vec_grant;
|
||||
|
||||
|
@ -822,7 +820,6 @@ eth_port_t *eth_port;
|
|||
message mess;
|
||||
|
||||
mess.m_type= DL_GETSTAT_S;
|
||||
mess.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
|
||||
mess.DL_GRANT= eth_port->etp_osdep.etp_stat_gid;
|
||||
|
||||
assert(eth_port->etp_osdep.etp_state == OEPS_IDLE);
|
||||
|
|
|
@ -147,7 +147,6 @@ static void driver_setup_read(struct nic * nic)
|
|||
nic->rx_iovec[0].iov_size = nic->rx_pbuf->len;
|
||||
|
||||
m.m_type = DL_READV_S;
|
||||
m.DL_ENDPT_LEGACY = lwip_ep; /* FIXME: legacy support */
|
||||
m.DL_COUNT = 1;
|
||||
m.DL_GRANT = nic->rx_iogrant;
|
||||
|
||||
|
@ -209,7 +208,6 @@ int driver_tx(struct nic * nic)
|
|||
panic("Failed to set grant");
|
||||
|
||||
m.m_type = DL_WRITEV_S;
|
||||
m.DL_ENDPT_LEGACY = lwip_ep; /* FIXME: legacy support */
|
||||
m.DL_COUNT = 1;
|
||||
m.DL_GRANT = nic->tx_iogrant;
|
||||
|
||||
|
|
|
@ -159,7 +159,9 @@ PUBLIC int do_getsysinfo()
|
|||
size_t len;
|
||||
int s;
|
||||
|
||||
/* This call leaks important information (the contents of registers). */
|
||||
/* This call leaks important information. In the future, requests from
|
||||
* non-system processes should be denied.
|
||||
*/
|
||||
if (mp->mp_effuid != 0)
|
||||
{
|
||||
printf("PM: unauthorized call of do_getsysinfo by proc %d '%s'\n",
|
||||
|
@ -168,15 +170,6 @@ PUBLIC int do_getsysinfo()
|
|||
return EPERM;
|
||||
}
|
||||
|
||||
/* This call should no longer be used by user applications. In the future,
|
||||
* requests from non-system processes should be denied. For now, just warn.
|
||||
*/
|
||||
if (call_nr == GETSYSINFO)
|
||||
{
|
||||
printf("PM: obsolete call of do_getsysinfo() by proc %d '%s'\n",
|
||||
mp->mp_endpoint, mp->mp_name);
|
||||
}
|
||||
|
||||
switch(m_in.info_what) {
|
||||
case SI_PROC_TAB: /* copy entire process table */
|
||||
src_addr = (vir_bytes) mproc;
|
||||
|
@ -203,45 +196,6 @@ PUBLIC int do_getsysinfo()
|
|||
return(OK);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* do_getsysinfo_up *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getsysinfo_up()
|
||||
{
|
||||
vir_bytes src_addr, dst_addr;
|
||||
struct loadinfo loadinfo;
|
||||
size_t len, real_len;
|
||||
int s;
|
||||
|
||||
printf("PM: obsolete call of do_getsysinfo_up() by proc %d '%s'\n",
|
||||
mp->mp_endpoint, mp->mp_name);
|
||||
|
||||
switch(m_in.SIU_WHAT) {
|
||||
case SIU_LOADINFO: /* loadinfo is obtained via PM */
|
||||
if ((s = sys_getloadinfo(&loadinfo)) != OK)
|
||||
return s;
|
||||
src_addr = (vir_bytes) &loadinfo;
|
||||
real_len = sizeof(struct loadinfo);
|
||||
break;
|
||||
case SIU_SYSTEMHZ:
|
||||
src_addr = (vir_bytes) &system_hz;
|
||||
real_len = sizeof(system_hz);
|
||||
break;
|
||||
default:
|
||||
return(EINVAL);
|
||||
}
|
||||
|
||||
/* Let application know what the length was. */
|
||||
len = real_len;
|
||||
if(len > m_in.SIU_LEN)
|
||||
len = m_in.SIU_LEN;
|
||||
|
||||
dst_addr = (vir_bytes) m_in.SIU_WHERE;
|
||||
if (OK != (s=sys_datacopy(SELF, src_addr, who_e, dst_addr, len)))
|
||||
return(s);
|
||||
return(real_len);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* do_getprocnr *
|
||||
*===========================================================================*/
|
||||
|
|
|
@ -59,7 +59,6 @@ _PROTOTYPE( int do_reboot, (void) );
|
|||
_PROTOTYPE( int do_procstat, (void) );
|
||||
_PROTOTYPE( int do_sysuname, (void) );
|
||||
_PROTOTYPE( int do_getsysinfo, (void) );
|
||||
_PROTOTYPE( int do_getsysinfo_up, (void) );
|
||||
_PROTOTYPE( int do_getprocnr, (void) );
|
||||
_PROTOTYPE( int do_getepinfo, (void) );
|
||||
_PROTOTYPE( int do_getepinfo_o, (void) );
|
||||
|
|
|
@ -90,7 +90,7 @@ _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
do_reboot, /* 76 = reboot */
|
||||
do_svrctl, /* 77 = svrctl */
|
||||
do_sysuname, /* 78 = sysuname */
|
||||
do_getsysinfo, /* 79 = getsysinfo */
|
||||
no_sys, /* 79 = unused */
|
||||
no_sys, /* 80 = (getdents) */
|
||||
no_sys, /* 81 = unused */
|
||||
no_sys, /* 82 = (fstatfs) */
|
||||
|
@ -108,7 +108,7 @@ _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
no_sys, /* 94 = (ftruncate) */
|
||||
no_sys, /* 95 = (fchmod) */
|
||||
no_sys, /* 96 = (fchown) */
|
||||
do_getsysinfo_up,/* 97 = getsysinfo_up */
|
||||
no_sys, /* 97 = unused */
|
||||
do_sprofile, /* 98 = sprofile */
|
||||
do_cprofile, /* 99 = cprofile */
|
||||
/* THE MINIX3 ABI ENDS HERE */
|
||||
|
|
|
@ -68,19 +68,12 @@ PUBLIC int do_getsysinfo()
|
|||
int s;
|
||||
|
||||
/* Only su may call do_getsysinfo. This call may leak information (and is not
|
||||
* stable enough to be part of the API/ABI).
|
||||
* stable enough to be part of the API/ABI). In the future, requests from
|
||||
* non-system processes should be denied.
|
||||
*/
|
||||
|
||||
if (!super_user) return(EPERM);
|
||||
|
||||
/* This call should no longer be used by user applications. In the future,
|
||||
* requests from non-system processes should be denied. For now, just warn.
|
||||
*/
|
||||
if (call_nr == GETSYSINFO) {
|
||||
printf("VFS: obsolete call of do_getsysinfo() by proc %d\n",
|
||||
fp->fp_endpoint);
|
||||
}
|
||||
|
||||
switch(m_in.info_what) {
|
||||
case SI_PROC_TAB:
|
||||
src_addr = (vir_bytes) fproc;
|
||||
|
|
|
@ -94,7 +94,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
no_sys, /* 76 = (reboot) */
|
||||
do_svrctl, /* 77 = svrctl */
|
||||
no_sys, /* 78 = (sysuname) */
|
||||
do_getsysinfo, /* 79 = getsysinfo */
|
||||
no_sys, /* 79 = unused */
|
||||
do_getdents, /* 80 = getdents */
|
||||
do_llseek, /* 81 = llseek */
|
||||
do_fstatfs, /* 82 = fstatfs */
|
||||
|
@ -112,7 +112,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
|
|||
do_ftruncate, /* 94 = truncate */
|
||||
do_chmod, /* 95 = fchmod */
|
||||
do_chown, /* 96 = fchown */
|
||||
no_sys, /* 97 = (getsysinfo_up) */
|
||||
no_sys, /* 97 = unused */
|
||||
no_sys, /* 98 = (sprofile) */
|
||||
no_sys, /* 99 = (cprofile) */
|
||||
/* THE MINIX3 ABI ENDS HERE */
|
||||
|
|
Loading…
Reference in a new issue