- VM_KERN_NOPAGEZERO feature is gone

- sys_getbiosbuffer feature is gone (from kernel; available from vm)
- bump version number because munmap() calls that newly compiled binaries
  will do trigger an ugly (but harmless) error message in older VM's
- some new VM calls and flags, the new IPC calls
- some new CR0 register bits
- added files for shared memory
This commit is contained in:
Ben Gras
2009-09-21 14:23:10 +00:00
parent 0a27cf279e
commit 8a54d267f0
25 changed files with 399 additions and 27 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
#define BRK 17
#define STAT 18
#define LSEEK 19
#define GETPID 20
#define MINIX_GETPID 20
#define MOUNT 21
#define UMOUNT 22
#define SETUID 23
+108 -3
View File
@@ -310,7 +310,6 @@
# define SYS_GETINFO (KERNEL_CALL + 26) /* sys_getinfo() */
# define SYS_ABORT (KERNEL_CALL + 27) /* sys_abort() */
# define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
# define SYS_VM_SETBUF (KERNEL_CALL + 29) /* sys_vm_setbuf() */
# define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
# define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
# define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */
@@ -525,6 +524,7 @@
* and sys_fork
*/
#define PR_FORK_FLAGS m1_i3
#define PR_FORK_MSGADDR m1_p1
/* Field names for SYS_INT86 */
#define INT86_REG86 m1_p1 /* pointer to registers */
@@ -584,6 +584,7 @@
#define SVMCTL_MRG_LEN m1_i1 /* MEMREQ_GET reply: length */
#define SVMCTL_MRG_WRITE m1_i2 /* MEMREQ_GET reply: writeflag */
#define SVMCTL_MRG_EP m1_i3 /* MEMREQ_GET reply: process */
#define SVMCTL_MRG_REQUESTOR m1_p2 /* MEMREQ_GET reply: requestor */
/* Codes and field names for SYS_SYSCTL. */
#define SYSCTL_CODE m1_i1 /* SYSCTL_CODE_* below */
@@ -602,6 +603,12 @@
#define VMCTL_MEMREQ_REPLY 15
#define VMCTL_INCSP 16
#define VMCTL_NOPAGEZERO 18
#define VMCTL_I386_KERNELLIMIT 19
#define VMCTL_I386_PAGEDIRS 20
#define VMCTL_I386_FREEPDE 23
#define VMCTL_ENABLE_PAGING 24
#define VMCTL_I386_INVLPG 25
#define VMCTL_FLUSHTLB 26
/* Field names for SYS_VTIMER. */
#define VT_WHICH m2_i1 /* which timer to set/retrieve */
@@ -629,6 +636,7 @@
* arguments are passed in
* a struct rs_start
*/
#define RS_LOOKUP (DS_RQ_BASE + 8) /* lookup server name */
# define RS_CMD_ADDR m1_p1 /* command string */
# define RS_CMD_LEN m1_i1 /* length of command */
@@ -637,6 +645,9 @@
# define RS_ENDPOINT m1_i1 /* endpoint number in reply */
# define RS_NAME m1_p1 /* name */
# define RS_NAME_LEN m1_i1 /* namelen */
/*===========================================================================*
* Messages for the Data Store Server *
*===========================================================================*/
@@ -767,6 +778,16 @@
# define VMVC_FD m1_i1
# define VMVC_ENDPOINT m1_i2
/* 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
/*===========================================================================*
* Messages for VM server *
*===========================================================================*/
@@ -847,7 +868,7 @@
# define VMUP_EP m1_i1
# define VMUP_VADDR m1_p1
#define VM_UNMAP (VM_RQ_BASE+17)
#define VM_MUNMAP (VM_RQ_BASE+17)
# define VMUM_ADDR m1_p1
# define VMUM_LEN m1_i1
@@ -855,6 +876,8 @@
# define VMAM_BYTES m1_p1
# define VMAM_MEMBASE m1_i1
#define VM_MUNMAP_TEXT (VM_RQ_BASE+19)
/* Calls from VFS. */
# define VMV_ENDPOINT m1_i1 /* for all VM_VFS_REPLY_* */
#define VM_VFS_REPLY_OPEN (VM_RQ_BASE+30)
@@ -862,7 +885,89 @@
#define VM_VFS_REPLY_MMAP (VM_RQ_BASE+31)
#define VM_VFS_REPLY_CLOSE (VM_RQ_BASE+32)
#define VM_REMAP (VM_RQ_BASE+33)
# define VMRE_D m1_i1
# define VMRE_S m1_i2
# define VMRE_DA m1_p1
# define VMRE_SA m1_p2
# define VMRE_RETA m1_p3
# define VMRE_SIZE m1_i3
#define VM_SHM_UNMAP (VM_RQ_BASE+34)
# define VMUN_ENDPT m2_i1
# define VMUN_ADDR m2_l1
#define VM_GETPHYS (VM_RQ_BASE+35)
# define VMPHYS_ENDPT m2_i1
# define VMPHYS_ADDR m2_l1
# define VMPHYS_RETA m2_l2
#define VM_GETREF (VM_RQ_BASE+36)
# define VMREFCNT_ENDPT m2_i1
# define VMREFCNT_ADDR m2_l1
# define VMREFCNT_RETC m2_i2
#define VM_RS_SET_PRIV (VM_RQ_BASE+37)
# define VM_RS_NR m2_i1
# define VM_RS_BUF m2_l1
#define VM_QUERY_EXIT (VM_RQ_BASE+38)
# define VM_QUERY_RET_PT m2_i1
# define VM_QUERY_IS_MORE m2_i2
#define VM_NOTIFY_SIG (VM_RQ_BASE+39)
# define VM_NOTIFY_SIG_ENDPOINT m1_i1
# define VM_NOTIFY_SIG_IPC m1_i2
#define VM_CTL (VM_RQ_BASE+40)
#define VCTL_WHAT m1_i1
#define VCTL_PARAM m1_i2
/* VCTL_PARAMs */
#define VCTLP_STATS_MEM 1
#define VCTLP_STATS_EP 2
/* Total. */
#define VM_NCALLS 33
#define VM_NCALLS 41
/*===========================================================================*
* Messages for IPC server *
*===========================================================================*/
#define IPC_BASE 0xD00
/* Shared Memory */
#define IPC_SHMGET (IPC_BASE+1)
# define SHMGET_KEY m2_l1
# define SHMGET_SIZE m2_l2
# define SHMGET_FLAG m2_i1
# define SHMGET_RETID m2_i2
#define IPC_SHMAT (IPC_BASE+2)
# define SHMAT_ID m2_i1
# define SHMAT_ADDR m2_l1
# define SHMAT_FLAG m2_i2
# define SHMAT_RETADDR m2_l2
#define IPC_SHMDT (IPC_BASE+3)
# define SHMDT_ADDR m2_l1
#define IPC_SHMCTL (IPC_BASE+4)
# define SHMCTL_ID m2_i1
# define SHMCTL_CMD m2_i2
# define SHMCTL_BUF m2_l1
# define SHMCTL_RET m2_i3
/* Semaphore */
#define IPC_SEMGET (IPC_BASE+5)
# define SEMGET_KEY m2_l1
# define SEMGET_NR m2_i1
# define SEMGET_FLAG m2_i2
# define SEMGET_RETID m2_i3
#define IPC_SEMCTL (IPC_BASE+6)
# define SEMCTL_ID m2_i1
# define SEMCTL_NUM m2_i2
# define SEMCTL_CMD m2_i3
# define SEMCTL_OPT m2_l1
#define IPC_SEMOP (IPC_BASE+7)
# define SEMOP_ID m2_i1
# define SEMOP_OPS m2_l1
# define SEMOP_SIZE m2_i2
#endif /* _MINIX_COM_H */
+1 -4
View File
@@ -3,7 +3,7 @@
/* Minix release and version numbers. */
#define OS_RELEASE "3"
#define OS_VERSION "1.4"
#define OS_VERSION "1.5"
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains
@@ -95,7 +95,4 @@
#define SPROFILE 1 /* statistical profiling */
#define CPROFILE 0 /* call profiling */
/* Compile kernel so that first page of code and data can be unmapped. */
#define VM_KERN_NOPAGEZERO 1
#endif /* _CONFIG_H */
-2
View File
@@ -44,8 +44,6 @@
#define PHYS_SEG 0x0400 /* flag indicating entire physical memory */
#define GRANT_SEG 0x0800 /* flag indicating grant for umap */
#define LOCAL_VM_SEG 0x1000 /* same as LOCAL_SEG, but with vm lookup */
#define VM_D (LOCAL_VM_SEG | D)
#define VM_T (LOCAL_VM_SEG | T)
+8
View File
@@ -0,0 +1,8 @@
/* Prototypes for crtso.s. */
#ifndef _MINIX_CRTSO_H
#define _MINIX_CRTSO_H
_PROTOTYPE( void _minix_unmapzero, (void));
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef _MINIX_DEBUG_H
#define _MINIX_DEBUG_H 1
/* For reminders of things to be fixed. */
#define FIXME(str) { static int fixme_warned = 0; \
if(!fixme_warned) { \
printf("FIXME: %s:%d: %s\n", __FILE__, __LINE__, str);\
fixme_warned = 1; \
} \
}
#endif /* _MINIX_DEBUG_H */
+3
View File
@@ -34,5 +34,8 @@ _PROTOTYPE( int ds_retrieve_str, (char *name, char *val, size_t len));
_PROTOTYPE( int ds_check_u32, (char *n, size_t namelen, u32_t *val));
_PROTOTYPE( int ds_check_str, (char *n, size_t namelen, char *v, size_t vlen));
/* lib/sysvipc/ds.c */
_PROTOTYPE( int mini_ds_retrieve_u32, (char *name, u32_t *val) );
#endif /* _MINIX_DS_H */
+1 -1
View File
@@ -15,7 +15,7 @@ _PROTOTYPE(void std_err, (char *_s));
_PROTOTYPE(void prints, (const char *_s, ...));
_PROTOTYPE(int fsversion, (char *_dev, char *_prog));
_PROTOTYPE(int getprocessor, (void));
_PROTOTYPE(int _cpuid, (u32_t eax_in, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
_PROTOTYPE(void _cpuid, (u32_t eax_in, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
_PROTOTYPE(int load_mtab, (char *_prog_name));
_PROTOTYPE(int rewrite_mtab, (char *_prog_name));
_PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
+6
View File
@@ -4,6 +4,8 @@ minix/rs.h
Interface to the reincarnation server
*/
#include <minix/bitmap.h>
#define RSS_NR_IRQ 16
#define RSS_NR_IO 16
#define RSS_NR_PCI_ID 16
@@ -35,6 +37,8 @@ struct rs_start
size_t rss_labellen;
char *rss_ipc;
size_t rss_ipclen;
#define RSS_VM_CALL_SIZE BITMAP_CHUNKS(VM_NCALLS)
bitchunk_t rss_vm[RSS_VM_CALL_SIZE];
};
#define RF_COPY 0x01 /* Copy the brinary into RS to make it possible
@@ -58,3 +62,5 @@ struct rs_pci
struct { u32_t class; u32_t mask; } rsp_class[RSP_NR_CLASS];
};
_PROTOTYPE( int minix_rs_lookup, (const char *name, endpoint_t *value));
+4 -6
View File
@@ -35,7 +35,7 @@ _PROTOTYPE( int sys_enable_iop, (endpoint_t proc));
_PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr,
char *aout, vir_bytes initpc));
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, int *,
struct mem_map *ptr, u32_t vm));
struct mem_map *ptr, u32_t vm, vir_bytes *));
_PROTOTYPE( int sys_newmap, (endpoint_t proc, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (endpoint_t proc));
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc, long addr, long *data_p));
@@ -53,9 +53,8 @@ _PROTOTYPE( int sys_vmctl, (endpoint_t who, int param, u32_t value));
_PROTOTYPE( int sys_vmctl_get_pagefault_i386, (endpoint_t *who, u32_t *cr2, u32_t *err));
_PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
_PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem,
vir_bytes *len, int *wrflag) );
vir_bytes *len, int *wrflag, endpoint_t *) );
_PROTOTYPE( int sys_vmctl_enable_paging, (struct mem_map *));
_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
_PROTOTYPE( int sys_stime, (time_t boottime));
@@ -85,6 +84,7 @@ _PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
#define AC_ALIGN4K 0x01
#define AC_LOWER16M 0x02
#define AC_ALIGN64K 0x04
#define AC_LOWER1M 0x08
/* Clock functionality: get system times, (un)schedule an alarm call, or
* retrieve/set a process-virtual timer.
@@ -167,8 +167,6 @@ _PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
#define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0)
#define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0)
#define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0)
#define sys_getbiosbuffer(virp, sizep) \
sys_getinfo(GET_BIOSBUFFER, virp, sizeof(*virp), sizep, sizeof(*sizep))
#define sys_getprivid(nr) sys_getinfo(GET_PRIVID, 0, 0,0, nr)
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *val_ptr2, int val_len2) );
+2 -4
View File
@@ -66,7 +66,7 @@ typedef struct {
} iovec_s_t;
/* PM passes the address of a structure of this type to KERNEL when
* sys_sendsig() is invoked as part of the signal catching mechanism.
* sys_sigsend() is invoked as part of the signal catching mechanism.
* The structure contain all the information that KERNEL needs to build
* the signal stack.
*/
@@ -97,9 +97,6 @@ struct kinfo {
int nr_tasks; /* number of kernel tasks */
char release[6]; /* kernel release number */
char version[6]; /* kernel version number */
#if DEBUG_LOCK_CHECK
int relocking; /* interrupt locking depth (should be 0) */
#endif
};
/* Load data accounted every this no. of seconds. */
@@ -178,6 +175,7 @@ struct kmessages {
char km_buf[_KMESS_BUF_SIZE]; /* buffer for messages */
};
#include <minix/config.h>
#include <ibm/interrupt.h>
/* randomness struct: random sources after interrupts: */
+4 -1
View File
@@ -23,7 +23,10 @@ _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));
_PROTOTYPE( int vm_allocmem, (phys_clicks memclicks, phys_clicks *retmembase));
_PROTOTYPE( int vm_notify_sig, (endpoint_t ep, endpoint_t ipc_ep));
_PROTOTYPE( int vm_ctl, (int what, int param));
_PROTOTYPE( int vm_set_priv, (int procnr, void *buf));
_PROTOTYPE( int vm_query_exit, (int *endpt));
#endif /* _MINIX_VM_H */