{ "FORK", VM_FORK },
{ "BRK", VM_BRK },
{ "EXEC_NEWMEM", VM_EXEC_NEWMEM },
- { "PUSH_SIG", VM_PUSH_SIG },
+ { "PUSH_SIG", 0 },
{ "WILLEXIT", VM_WILLEXIT },
{ "ADDDMA", VM_ADDDMA },
{ "DELDMA", VM_DELDMA },
if (vm_table[i].label == NULL)
fatal("do_vm: unknown call '%s' at %s:%d",
cpe->word, cpe->file, cpe->line);
- SET_BIT(rs_start->rss_vm, vm_table[i].call_nr - VM_RQ_BASE);
+
+ if(vm_table[i].call_nr) {
+ SET_BIT(rs_start->rss_vm,
+ vm_table[i].call_nr - VM_RQ_BASE);
+ }
+
first = FALSE;
}
}
FORK # 01
BRK # 02
EXEC_NEWMEM # 03
- PUSH_SIG # 04
WILLEXIT # 05
NOTIFY_SIG # 39
;
# define VMEN_ARGSSIZE m1_i2
# define VMEN_FLAGS m1_i3 /* result */
# define VMEN_STACK_TOP m1_p2 /* result */
-#define VM_PUSH_SIG (VM_RQ_BASE+4)
-# define VMPS_ENDPOINT m1_i1
-# define VMPS_OLD_SP m1_p1 /* result */
#define VM_WILLEXIT (VM_RQ_BASE+5)
# define VMWE_ENDPOINT m1_i1
int vm_exit(endpoint_t ep);
int vm_fork(endpoint_t ep, int slotno, endpoint_t *child_ep);
int vm_brk(endpoint_t ep, char *newaddr);
-int vm_push_sig(endpoint_t ep, vir_bytes *old_sp);
int vm_willexit(endpoint_t ep);
int vm_adddma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
int vm_deldma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
}
}
+reg_t arch_get_sp(struct proc *p) { return p->p_reg.sp; }
+
#if !CONFIG_OXPCIE
static void ser_init(void)
{
int arch_phys_map(int index, phys_bytes *addr, phys_bytes *len, int
*flags);
int arch_phys_map_reply(int index, vir_bytes addr);
+reg_t arch_get_sp(struct proc *p);
int arch_enable_paging(struct proc * caller);
int vm_check_range(struct proc *caller,
struct proc *target, vir_bytes vir_addr, size_t bytes);
return r;
/* Compute the user stack pointer where sigcontext will be stored. */
+ smsg.sm_stkptr = arch_get_sp(rp);
scp = (struct sigcontext *) smsg.sm_stkptr - 1;
/* Copy the registers to the sigcontext structure. */
vm_info.c \
vm_map_phys.c \
vm_notify_sig.c \
- vm_push_sig.c \
vm_umap.c \
vm_yield_get_block.c \
vm_procctl.c \
+++ /dev/null
-
-#include "syslib.h"
-
-#include <minix/vm.h>
-
-/*===========================================================================*
- * vm_push_sig *
- *===========================================================================*/
-int vm_push_sig(endpoint_t ep, vir_bytes *old_sp)
-{
- message m;
- int result;
-
- m.VMPS_ENDPOINT = ep;
- result = _taskcall(VM_PROC_NR, VM_PUSH_SIG, &m);
- *old_sp = (vir_bytes) m.VMPS_OLD_SP;
-
- return result;
-}
-
* Return TRUE if this succeeded, FALSE otherwise.
*/
struct sigmsg sigmsg;
- vir_bytes cur_sp;
int r, sigflags, slot;
if (!(rmp->mp_flags & UNPAUSED))
sigdelset(&rmp->mp_sigpending, signo);
sigdelset(&rmp->mp_ksigpending, signo);
- if(vm_push_sig(rmp->mp_endpoint, &cur_sp) != OK)
- return(FALSE);
-
- sigmsg.sm_stkptr = cur_sp;
-
/* Ask the kernel to deliver the signal */
r = sys_sigsend(rmp->mp_endpoint, &sigmsg);
/* sys_sigsend can fail legitimately with EFAULT if
PROG= vm
SRCS= main.c alloc.c utility.c exit.c fork.c break.c \
- signal.c mmap.c slaballoc.c region.c pagefaults.c addravl.c \
+ mmap.c slaballoc.c region.c pagefaults.c addravl.c \
physravl.c rs.c queryexit.c yieldedavl.c regionavl.c
DPADD+= ${LIBSYS}
*
* The entry points into this file are:
* do_brk: BRK/SBRK system calls to grow or shrink the data segment
- * adjust: see if a proposed segment adjustment is allowed
*/
#define _SYSTEM 1
CALLMAP(VM_EXIT, do_exit);
CALLMAP(VM_FORK, do_fork);
CALLMAP(VM_BRK, do_brk);
- CALLMAP(VM_PUSH_SIG, do_push_sig);
CALLMAP(VM_WILLEXIT, do_willexit);
CALLMAP(VM_ADDDMA, do_adddma);
CALLMAP(VM_DELDMA, do_deldma);
/* break.c */
int do_brk(message *msg);
-int adjust(struct vmproc *rmp, vir_clicks data_clicks, vir_bytes sp);
int real_brk(struct vmproc *vmp, vir_bytes v);
-/* signal.c */
-int do_push_sig(message *msg);
-
/* map_mem.c */
int map_memory(endpoint_t sour, endpoint_t dest, vir_bytes virt_s,
vir_bytes virt_d, vir_bytes length, int flag);
+++ /dev/null
-
-#define _SYSTEM 1
-
-#include <minix/callnr.h>
-#include <minix/com.h>
-#include <minix/config.h>
-#include <minix/const.h>
-#include <minix/ds.h>
-#include <minix/endpoint.h>
-#include <minix/keymap.h>
-#include <minix/minlib.h>
-#include <minix/type.h>
-#include <minix/ipc.h>
-#include <minix/sysutil.h>
-#include <minix/syslib.h>
-#include <minix/bitmap.h>
-#include <sys/signal.h>
-
-#include <errno.h>
-#include <env.h>
-
-#include "glo.h"
-#include "vm.h"
-#include "proto.h"
-#include "util.h"
-
-#define DATA_CHANGED 1 /* flag value when data segment size changed */
-#define STACK_CHANGED 2 /* flag value when stack size changed */
-
-/*===========================================================================*
- * do_push_sig *
- *===========================================================================*/
-int do_push_sig(message *msg)
-{
- int r, n;
- endpoint_t ep;
- vir_bytes sp;
-
- ep = msg->VMPS_ENDPOINT;
-
- if((r=vm_isokendpt(ep, &n)) != OK) {
- printf("VM: bogus endpoint %d from %d\n", ep, msg->m_source);
- return r;
- }
-
- if ((r=get_stack_ptr(ep, &sp)) != OK)
- panic("couldn't get new stack pointer (for sig): %d", r);
-
- /* Save old SP for caller */
- msg->VMPS_OLD_SP = (char *) sp;
-
- /* Make room for the sigcontext and sigframe struct. */
- sp -= sizeof(struct sigcontext)
- + 3 * sizeof(char *) + 2 * sizeof(int);
-
- return OK;
-}
-
}
-struct proc mytmpproc;
-
-/*===========================================================================*
- * get_stack_ptr *
- *===========================================================================*/
-int get_stack_ptr(proc_nr_e, sp)
-int proc_nr_e; /* process to get sp of */
-vir_bytes *sp; /* put stack pointer here */
-{
- int s;
-
- if ((s=sys_getproc(&mytmpproc, proc_nr_e)) != OK)
- return(s);
- *sp = mytmpproc.p_reg.sp;
- return(OK);
-}
-
/*===========================================================================*
* do_info *
*===========================================================================*/