Fixed extern declaration from pointer to array
[minix.git] / servers / vm / signal.c
blobbc7555bb5b94f830a4a30ee614b40401627134ad
2 #define _SYSTEM 1
4 #include <minix/callnr.h>
5 #include <minix/com.h>
6 #include <minix/config.h>
7 #include <minix/const.h>
8 #include <minix/ds.h>
9 #include <minix/endpoint.h>
10 #include <minix/keymap.h>
11 #include <minix/minlib.h>
12 #include <minix/type.h>
13 #include <minix/ipc.h>
14 #include <minix/sysutil.h>
15 #include <minix/syslib.h>
16 #include <minix/bitmap.h>
17 #include <sys/sigcontext.h>
19 #include <errno.h>
20 #include <env.h>
22 #include "glo.h"
23 #include "vm.h"
24 #include "proto.h"
25 #include "util.h"
27 #define DATA_CHANGED 1 /* flag value when data segment size changed */
28 #define STACK_CHANGED 2 /* flag value when stack size changed */
30 /*===========================================================================*
31 * do_push_sig *
32 *===========================================================================*/
33 PUBLIC int do_push_sig(message *msg)
35 int r, n;
36 endpoint_t ep;
37 vir_bytes sp;
38 struct vmproc *vmp;
40 ep = msg->VMPS_ENDPOINT;
42 if((r=vm_isokendpt(ep, &n)) != OK) {
43 printf("VM: bogus endpoint %d from %d\n", ep, msg->m_source);
44 return r;
46 vmp = &vmproc[n];
48 if ((r=get_stack_ptr(ep, &sp)) != OK)
49 vm_panic("couldn't get new stack pointer (for sig)",r);
51 /* Save old SP for caller */
52 msg->VMPS_OLD_SP = (char *) sp;
54 /* Make room for the sigcontext and sigframe struct. */
55 sp -= sizeof(struct sigcontext)
56 + 3 * sizeof(char *) + 2 * sizeof(int);
58 if ((r=adjust(vmp, vmp->vm_arch.vm_seg[D].mem_len, sp)) != OK) {
59 printf("VM: do_push_sig: adjust() failed: %d\n", r);
60 return r;
63 return OK;