#define GETPROCNR 104 /* to PM */
#define ISSETUGID 106 /* to PM: ask if process is tainted */
#define GETEPINFO_O 107 /* to PM: get pid/uid/gid of an endpoint */
-#define ADDDMA 108 /* to PM: inform PM about a region of memory
- * that is used for bus-master DMA
- */
-#define DELDMA 109 /* to PM: inform PM that a region of memory
- * that is no longer used for bus-master DMA
- */
-#define GETDMA 110 /* to PM: ask PM for a region of memory
- * that should not be used for bus-master DMA
- * any longer
- */
#define SRV_KILL 111 /* to PM: special kill call for RS */
#define GCOV_FLUSH 112 /* flush gcov data from server to gcov files */
* bus-master DMA
*/
#define VM_ADDDMA (VM_RQ_BASE+12)
-# define VMAD_REQ m2_i2
# define VMAD_EP m2_i1
# define VMAD_START m2_l1
# define VMAD_SIZE m2_l2
* used for bus-master DMA
*/
#define VM_DELDMA (VM_RQ_BASE+13)
-# define VMDD_REQ m2_i2
# define VMDD_EP m2_i1
# define VMDD_START m2_l1
# define VMDD_SIZE m2_l2
* be used for bus-master DMA any longer
*/
#define VM_GETDMA (VM_RQ_BASE+14)
-# define VMGD_REQ m2_i2
# define VMGD_PROCP m2_i1
# define VMGD_BASEP m2_l1
# define VMGD_SIZEP m2_l2
int args_bytes, char **ret_stack_top, int *ret_flags));
_PROTOTYPE( int vm_push_sig, (endpoint_t ep, vir_bytes *old_sp));
_PROTOTYPE( int vm_willexit, (endpoint_t ep));
-_PROTOTYPE( int vm_adddma, (endpoint_t req_e, endpoint_t proc_e,
- phys_bytes start, phys_bytes size) );
-_PROTOTYPE( int vm_deldma, (endpoint_t req_e, endpoint_t proc_e,
- phys_bytes start, phys_bytes size) );
-_PROTOTYPE( int vm_getdma, (endpoint_t req_e, endpoint_t *procp,
- phys_bytes *basep, phys_bytes *sizep) );
+_PROTOTYPE( int vm_adddma, (endpoint_t proc_e, phys_bytes start,
+ phys_bytes size));
+_PROTOTYPE( int vm_deldma, (endpoint_t proc_e, phys_bytes start,
+ phys_bytes size));
+_PROTOTYPE( int vm_getdma, (endpoint_t *procp, phys_bytes *basep,
+ phys_bytes *sizep));
_PROTOTYPE( void *vm_map_phys, (endpoint_t who, void *physaddr, size_t len));
_PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len));
for (;;)
{
- r= getdma(&proc_e, &base, &size);
+ r= vm_getdma(&proc_e, &base, &size);
if (r == -1)
{
if (errno != -EAGAIN)
{
printf(
- "amddev: getdma failed: %d\n",
+ "amddev: vm_getdma failed: %d\n",
errno);
}
break;
"amddev: deleting 0x%lx@0x%lx for proc %d\n",
size, base, proc_e);
del_range(base, size);
- r= deldma(proc_e, base, size);
+ r= vm_deldma(proc_e, base, size);
if (r == -1)
{
- printf("amddev: deldma failed: %d\n",
+ printf("amddev: vm_deldma failed: %d\n",
errno);
break;
}
return r;
}
- r= adddma(proc, start, size);
+ r= vm_adddma(proc, start, size);
if (r != 0)
{
r= -errno;
- printf(
- "amddev`do_add4pci: adddma failed for 0x%x@0x%lx, proc %d: %d\n",
- size, start, proc, r);
+ printf("amddev`do_add4pci: vm_adddma failed for 0x%x@0x%lx, "
+ "proc %d: %d\n", size, start, proc, r);
return r;
}
EXEC_NEWMEM # 03
PUSH_SIG # 04
WILLEXIT # 05
- ADDDMA # 12
- DELDMA # 13
- GETDMA # 14
NOTIFY_SIG # 39
;
io NONE; # No I/O range allowed
system
UMAP_REMOTE # 17
;
+ vm
+ ADDDMA # 12
+ DELDMA # 13
+ GETDMA # 14
+ ;
uid 0;
};
_PROTOTYPE( int _pm_findproc, (char *proc_name, int *proc_nr) );
_PROTOTYPE( int mapdriver, (char *label, int major, int style,
int flags) );
-_PROTOTYPE(int adddma, (endpoint_t proc_e,
- phys_bytes start, phys_bytes size) );
-_PROTOTYPE(int deldma, (endpoint_t proc_e,
- phys_bytes start, phys_bytes size) );
-_PROTOTYPE(int getdma, (endpoint_t *procp, phys_bytes *basep,
- phys_bytes *sizep) );
-
_PROTOTYPE( pid_t getnpid, (endpoint_t proc_ep) );
_PROTOTYPE( uid_t getnuid, (endpoint_t proc_ep) );
_PROTOTYPE( gid_t getngid, (endpoint_t proc_ep) );
SRCS+= \
__pm_findproc.c \
- _adddma.c \
_brk.c \
_cprofile.c \
- _deldma.c \
_getdents.c \
- _getdma.c \
_getnpid.c \
_getnucred.c \
_getnuid.c \
_sprofile.c \
_svrctl.c \
_sysuname.c \
- _vm_dmacalls.c \
_vm_memctl.c \
_vm_set_priv.c \
_vm_update.c \
+++ /dev/null
-/* adddma.c
- */
-
-#include <lib.h>
-#define adddma _adddma
-#include <unistd.h>
-#include <stdarg.h>
-
-int adddma(proc_e, start, size)
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.m2_i1= proc_e;
- m.m2_l1= start;
- m.m2_l2= size;
-
- return _syscall(PM_PROC_NR, ADDDMA, &m);
-}
+++ /dev/null
-/* deldma.c
- */
-
-#include <lib.h>
-#define deldma _deldma
-#include <unistd.h>
-#include <stdarg.h>
-
-int deldma(proc_e, start, size)
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.m2_i1= proc_e;
- m.m2_l1= start;
- m.m2_l2= size;
-
- return _syscall(PM_PROC_NR, DELDMA, &m);
-}
+++ /dev/null
-/* getdma.c
- */
-
-#include <lib.h>
-#define getdma _getdma
-#include <unistd.h>
-#include <stdarg.h>
-
-int getdma(procp, basep, sizep)
-endpoint_t *procp;
-phys_bytes *basep;
-phys_bytes *sizep;
-{
- int r;
- message m;
-
- r= _syscall(PM_PROC_NR, GETDMA, &m);
- if (r == 0)
- {
- *procp= m.m2_i1;
- *basep= m.m2_l1;
- *sizep= m.m2_l2;
- }
- return r;
-}
+++ /dev/null
-
-#include <lib.h>
-#define vm_adddma _vm_adddma
-#define vm_deldma _vm_deldma
-#define vm_getdma _vm_getdma
-#include <minix/vm.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-int vm_adddma(req_proc_e, proc_e, start, size)
-endpoint_t req_proc_e;
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.VMAD_REQ= req_proc_e;
- m.VMAD_EP= proc_e;
- m.VMAD_START= start;
- m.VMAD_SIZE= size;
-
- return _syscall(VM_PROC_NR, VM_ADDDMA, &m);
-}
-
-int vm_deldma(req_proc_e, proc_e, start, size)
-endpoint_t req_proc_e;
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.VMDD_REQ= proc_e;
- m.VMDD_EP= proc_e;
- m.VMDD_START= start;
- m.VMDD_SIZE= size;
-
- return _syscall(VM_PROC_NR, VM_DELDMA, &m);
-}
-
-int vm_getdma(req_proc_e, procp, basep, sizep)
-endpoint_t req_proc_e;
-endpoint_t *procp;
-phys_bytes *basep;
-phys_bytes *sizep;
-{
- int r;
- message m;
-
- m.VMGD_REQ = req_proc_e;
-
- r= _syscall(VM_PROC_NR, VM_GETDMA, &m);
- if (r == 0)
- {
- *procp= m.VMGD_PROCP;
- *basep= m.VMGD_BASEP;
- *sizep= m.VMGD_SIZEP;
- }
- return r;
-}
-
_exit.S \
_pm_findproc.S \
access.S \
- adddma.S \
alarm.S \
brk.S \
cfgetispeed.S \
closedir.S \
cprofile.S \
creat.S \
- deldma.S \
dup.S \
dup2.S \
execl.S \
fstatvfs.S \
getcwd.S \
getdents.S \
- getdma.S \
getegid.S \
geteuid.S \
getgid.S \
uname.S \
unlink.S \
utime.S \
- vm_dmacalls.S \
wait.S \
waitpid.S \
write.S
+++ /dev/null
-#include <machine/asm.h>
-
-IMPORT(_adddma)
-ENTRY(adddma)
- jmp _C_LABEL(_adddma)
-
+++ /dev/null
-#include <machine/asm.h>
-
-IMPORT(_deldma)
-ENTRY(deldma)
- jmp _C_LABEL(_deldma)
-
+++ /dev/null
-#include <machine/asm.h>
-
-IMPORT(_getdma)
-ENTRY(getdma)
- jmp _C_LABEL(_getdma)
-
+++ /dev/null
-#include <machine/asm.h>
-
-IMPORT(_vm_adddma)
-ENTRY(vm_adddma)
- jmp _C_LABEL(_vm_adddma)
-
-IMPORT(_vm_deldma)
-ENTRY(vm_deldma)
- jmp _C_LABEL(_vm_deldma)
-
-IMPORT(_vm_getdma)
-ENTRY(vm_getdma)
- jmp _C_LABEL(_vm_getdma)
-
timing.c \
tsc_util.c \
vm_brk.c \
+ vm_dmacalls.c \
vm_exec_newmem.c \
vm_exit.c \
vm_fork.c \
#include <unistd.h>
#include <stdarg.h>
-int vm_adddma(req_proc_e, proc_e, start, size)
-endpoint_t req_proc_e;
+int vm_adddma(proc_e, start, size)
endpoint_t proc_e;
phys_bytes start;
phys_bytes size;
{
message m;
- m.VMAD_REQ= req_proc_e;
m.VMAD_EP= proc_e;
m.VMAD_START= start;
m.VMAD_SIZE= size;
return _syscall(VM_PROC_NR, VM_ADDDMA, &m);
}
-int vm_deldma(req_proc_e, proc_e, start, size)
-endpoint_t req_proc_e;
+int vm_deldma(proc_e, start, size)
endpoint_t proc_e;
phys_bytes start;
phys_bytes size;
{
message m;
- m.VMDD_REQ= proc_e;
m.VMDD_EP= proc_e;
m.VMDD_START= start;
m.VMDD_SIZE= size;
return _syscall(VM_PROC_NR, VM_DELDMA, &m);
}
-int vm_getdma(req_proc_e, procp, basep, sizep)
-endpoint_t req_proc_e;
+int vm_getdma(procp, basep, sizep)
endpoint_t *procp;
phys_bytes *basep;
phys_bytes *sizep;
int r;
message m;
- m.VMGD_REQ = req_proc_e;
-
r= _syscall(VM_PROC_NR, VM_GETDMA, &m);
if (r == 0)
{
SRCS+= paramvalue.c
# Minix servers/drivers syscall.
-SRCS+= adddma.c getdma.c deldma.c getngid.c getnpid.c \
- getnprocnr.c getnucred.c getnuid.c getprocnr.c \
- mapdriver.c vm_dmacalls.c vm_memctl.c \
- vm_set_priv.c vm_query_exit.c vm_update.c
+SRCS+= getngid.c getnpid.c getnprocnr.c getnucred.c getnuid.c getprocnr.c \
+ mapdriver.c vm_memctl.c vm_set_priv.c vm_query_exit.c vm_update.c
INCS+= tools.h
+++ /dev/null
-/* adddma.c
- */
-
-#include <lib.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-int adddma(proc_e, start, size)
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.m2_i1= proc_e;
- m.m2_l1= start;
- m.m2_l2= size;
-
- return _syscall(PM_PROC_NR, ADDDMA, &m);
-}
+++ /dev/null
-/* deldma.c
- */
-
-#include <lib.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-int deldma(proc_e, start, size)
-endpoint_t proc_e;
-phys_bytes start;
-phys_bytes size;
-{
- message m;
-
- m.m2_i1= proc_e;
- m.m2_l1= start;
- m.m2_l2= size;
-
- return _syscall(PM_PROC_NR, DELDMA, &m);
-}
+++ /dev/null
-/* getdma.c
- */
-
-#include <lib.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-int getdma(procp, basep, sizep)
-endpoint_t *procp;
-phys_bytes *basep;
-phys_bytes *sizep;
-{
- int r;
- message m;
-
- r= _syscall(PM_PROC_NR, GETDMA, &m);
- if (r == 0)
- {
- *procp= m.m2_i1;
- *basep= m.m2_l1;
- *sizep= m.m2_l2;
- }
- return r;
-}
int getpprocnr(void);
int _pm_findproc(char *proc_name, int *proc_nr);
int mapdriver(char *label, int major, int style, int flags);
-int adddma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
-int deldma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
-int getdma(endpoint_t *procp, phys_bytes *basep, phys_bytes *sizep);
pid_t getnpid(endpoint_t proc_ep);
uid_t getnuid(endpoint_t proc_ep);
gid_t getngid(endpoint_t proc_ep);
no_sys, /* 105 = unused */
no_sys, /* 106 = unused */
no_sys, /* 107 = (getepinfo) */
- no_sys, /* 108 = (adddma) */
- no_sys, /* 109 = (deldma) */
- no_sys, /* 110 = (getdma) */
+ no_sys, /* 108 = unused */
+ no_sys, /* 109 = unused */
+ no_sys, /* 110 = unused */
no_sys, /* 111 = (srv_kill) */
do_gcov_flush, /* 112 = gcov_flush */
no_sys, /* 113 = (getsid) */
PROG= pm
SRCS= main.c forkexit.c break.c exec.c time.c alarm.c \
signal.c utility.c table.c getset.c misc.c \
- profile.c dma.c schedule.c
+ profile.c schedule.c
.if ${USE_MCONTEXT} != "no"
SRCS+= mcontext.c
+++ /dev/null
-
-#include "pm.h"
-
-#include <minix/com.h>
-#include <minix/callnr.h>
-#include <minix/type.h>
-#include <minix/config.h>
-#include <minix/vm.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "mproc.h"
-
-/*===========================================================================*
- * do_adddma *
- *===========================================================================*/
-PUBLIC int do_adddma()
-{
- endpoint_t req_proc_e, target_proc_e;
- int proc_n, r;
- phys_bytes base, size;
-
- if (mp->mp_effuid != SUPER_USER)
- return EPERM;
-
- req_proc_e= m_in.m_source;
- target_proc_e= m_in.m2_i1;
- base= m_in.m2_l1;
- size= m_in.m2_l2;
-
- if((r = vm_adddma(req_proc_e, target_proc_e, base, size)) != OK) {
- printf("pm:do_adddma: vm_adddma failed (%d)\n", r);
- return r;
- }
-
- /* Find target process */
- if (pm_isokendpt(target_proc_e, &proc_n) != OK)
- {
- printf("pm:do_adddma: endpoint %d not found\n", target_proc_e);
- return EINVAL;
- }
-
- return OK;
-}
-
-/*===========================================================================*
- * do_deldma *
- *===========================================================================*/
-PUBLIC int do_deldma()
-{
- endpoint_t req_proc_e, target_proc_e;
- phys_bytes base, size;
-
- if (mp->mp_effuid != SUPER_USER)
- return EPERM;
-
- req_proc_e= m_in.m_source;
- target_proc_e= m_in.m2_i1;
- base= m_in.m2_l1;
- size= m_in.m2_l2;
-
- return vm_deldma(req_proc_e, target_proc_e, base, size);
-}
-
-/*===========================================================================*
- * do_getdma *
- *===========================================================================*/
-PUBLIC int do_getdma()
-{
- endpoint_t req_proc_e, proc;
- int r;
- phys_bytes base, size;
-
- if (mp->mp_effuid != SUPER_USER)
- return EPERM;
-
- req_proc_e= m_in.m_source;
-
- if((r=vm_getdma(req_proc_e, &proc, &base, &size)) != OK)
- return r;
-
- printf("pm:do_getdma: setting reply to 0x%lx@0x%lx proc %d\n",
- size, base, proc);
-
- mp->mp_reply.m2_i1= proc;
- mp->mp_reply.m2_l1= base;
- mp->mp_reply.m2_l2= size;
-
- return OK;
-}
-
/* break.c */
_PROTOTYPE( int do_brk, (void) );
-/* dma.c */
-_PROTOTYPE( int do_adddma, (void) );
-_PROTOTYPE( int do_deldma, (void) );
-_PROTOTYPE( int do_getdma, (void) );
-
/* exec.c */
_PROTOTYPE( int do_exec, (void) );
_PROTOTYPE( int do_exec_newmem, (void) );
no_sys, /* 105 = unused */
do_get, /* 106 = issetugid */
do_getepinfo_o, /* 107 = getepinfo XXX: old implementation*/
- do_adddma, /* 108 = adddma */
- do_deldma, /* 109 = deldma */
- do_getdma, /* 110 = getdma */
+ no_sys, /* 108 = unused */
+ no_sys, /* 109 = unused */
+ no_sys, /* 110 = unused */
do_srv_kill, /* 111 = srv_kill */
no_sys, /* 112 = gcov_flush */
do_get, /* 113 = getsid */
no_sys, /* 105 = unused */
no_sys, /* 106 = unused */
no_sys, /* 107 = (getepinfo) */
- no_sys, /* 108 = (adddma) */
- no_sys, /* 109 = (deldma) */
- no_sys, /* 110 = (getdma) */
+ no_sys, /* 108 = unused */
+ no_sys, /* 109 = unused */
+ no_sys, /* 110 = unused */
no_sys, /* 111 = (srv_kill) */
do_gcov_flush, /* 112 = gcov_flush */
no_sys, /* 113 = (getsid) */
*===========================================================================*/
PUBLIC int do_adddma(message *msg)
{
- endpoint_t req_proc_e, target_proc_e;
+ endpoint_t target_proc_e;
int i, proc_n;
phys_bytes base, size;
struct vmproc *vmp;
- req_proc_e= msg->VMAD_REQ;
target_proc_e= msg->VMAD_EP;
base= msg->VMAD_START;
size= msg->VMAD_SIZE;
*===========================================================================*/
PUBLIC int do_deldma(message *msg)
{
- endpoint_t req_proc_e, target_proc_e;
+ endpoint_t target_proc_e;
int i, j;
phys_bytes base, size;
- req_proc_e= msg->VMDD_REQ;
target_proc_e= msg->VMDD_EP;
base= msg->VMDD_START;
size= msg->VMDD_SIZE;