vm: remove stack handling for signals

. moved to the kernel as the handling was only
	  reading it; the kernel may as well write it too
This commit is contained in:
Ben Gras
2012-08-29 17:31:38 +02:00
parent 860224a4d4
commit 053fa581b5
16 changed files with 12 additions and 116 deletions

View File

@@ -3,7 +3,7 @@
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}

View File

@@ -11,7 +11,6 @@
*
* 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

View File

@@ -392,7 +392,6 @@ void init_vm(void)
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);

View File

@@ -59,12 +59,8 @@ int do_fork(message *msg);
/* 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);

View File

@@ -1,58 +0,0 @@
#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;
}

View File

@@ -137,23 +137,6 @@ int vm_isokendpt(endpoint_t endpoint, int *proc)
}
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 *
*===========================================================================*/