From: Philip Homburg Date: Fri, 30 Sep 2005 12:47:03 +0000 (+0000) Subject: Changes to includes for VM, IOPL, logging. Increased _NR_PROCS, CLICK_SIZE is X-Git-Tag: v3.1.2a~691 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/cppcheck-error.log?a=commitdiff_plain;h=31c1d6bf0d2e28a4454ebbef2bd9ea73bdd83d36;p=minix.git Changes to includes for VM, IOPL, logging. Increased _NR_PROCS, CLICK_SIZE is now 4096. --- diff --git a/include/minix/com.h b/include/minix/com.h index 7728d336e..479cedd25 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -216,8 +216,11 @@ # define SYS_TIMES (KERNEL_CALL + 25) /* sys_times() */ # 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_VM_MAP (KERNEL_CALL + 30) /* sys_vm_map() */ -#define NR_SYS_CALLS 28 /* number of system calls */ +#define NR_SYS_CALLS 31 /* number of system calls */ /* Field names for SYS_MEMSET, SYS_SEGCTL. */ #define MEM_PTR m2_p1 /* base */ @@ -408,5 +411,8 @@ # define DIAG_PRINT_BUF m1_p1 # define DIAG_BUF_COUNT m1_i1 # define DIAG_PROC_NR m1_i2 +#define GET_KMESS 101 /* get kmess from TTY */ +# define GETKM_PTR m1_p1 + #endif /* _MINIX_COM_H */ diff --git a/include/minix/const.h b/include/minix/const.h index ef901a093..3814621a3 100755 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -72,8 +72,8 @@ /* Memory is allocated in clicks. */ #if (CHIP == INTEL) -#define CLICK_SIZE 1024 /* unit in which memory is allocated */ -#define CLICK_SHIFT 10 /* log2 of CLICK_SIZE */ +#define CLICK_SIZE 4096 /* unit in which memory is allocated */ +#define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */ #endif #if (CHIP == SPARC) || (CHIP == M68000) diff --git a/include/minix/sys_config.h b/include/minix/sys_config.h index 7a86e076f..59a2115a9 100755 --- a/include/minix/sys_config.h +++ b/include/minix/sys_config.h @@ -18,7 +18,7 @@ #define _PTR_SIZE _EM_WSIZE #endif -#define _NR_PROCS 64 +#define _NR_PROCS 100 #define _NR_SYS_PROCS 32 /* Set the CHIP type based on the machine selected. The symbol CHIP is actually diff --git a/include/minix/syslib.h b/include/minix/syslib.h index 8e21763f7..ea4ad9ba3 100755 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -26,6 +26,7 @@ struct reg86u; _PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr)); _PROTOTYPE( int sys_abort, (int how, ...)); +_PROTOTYPE( int sys_enable_iop, (int proc)); _PROTOTYPE( int sys_exec, (int proc, char *ptr, char *aout, vir_bytes initpc)); _PROTOTYPE( int sys_fork, (int parent, int child)); @@ -37,6 +38,10 @@ _PROTOTYPE( int sys_svrctl, (int proc, int req, int priv,vir_bytes argp)); _PROTOTYPE( int sys_nice, (int proc, int priority)); _PROTOTYPE( int sys_int86, (struct reg86u *reg86p)); +_PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size, + phys_bytes high)); +_PROTOTYPE( int sys_vm_map, (int proc_nr, int do_map, + phys_bytes base, phys_bytes size, phys_bytes offset)); /* Shorthands for sys_sdevio() system call. */ #define sys_insb(port, proc_nr, buffer, count) \ diff --git a/include/sys/ioc_memory.h b/include/sys/ioc_memory.h index f025a55bb..d7f5fd4da 100755 --- a/include/sys/ioc_memory.h +++ b/include/sys/ioc_memory.h @@ -10,5 +10,7 @@ #include #define MIOCRAMSIZE _IOW('m', 3, u32_t) +#define MIOCMAP _IOR('m', 4, struct mapreq) +#define MIOCUNMAP _IOR('m', 5, struct mapreq) #endif /* _S_I_MEMORY_H */ diff --git a/include/sys/vm.h b/include/sys/vm.h new file mode 100644 index 000000000..555a76380 --- /dev/null +++ b/include/sys/vm.h @@ -0,0 +1,28 @@ +/* +sys/vm.h +*/ + +#define PAGE_SIZE 4096 + +/* MIOCMAP */ +struct mapreq +{ + void *base; + size_t size; + off_t offset; + int readonly; +}; + +/* i386 paging constants */ +#define I386_VM_PRESENT 0x001 /* Page is present */ +#define I386_VM_WRITE 0x002 /* Read/write access allowed */ +#define I386_VM_USER 0x004 /* User access allowed */ +#define I386_VM_ADDR_MASK 0xFFFFF000 /* physical address */ + +#define I386_VM_PT_ENT_SIZE 4 /* Size of a page table entry */ +#define I386_VM_DIR_ENTRIES 1024 /* Number of entries in a page dir */ +#define I386_VM_DIR_ENT_SHIFT 22 /* Shift to get entry in page dir. */ +#define I386_VM_PT_ENT_SHIFT 12 /* Shift to get entry in page table */ +#define I386_VM_PT_ENT_MASK 0x3FF /* Mask to get entry in page table */ + +#define I386_CR0_PG 0x80000000 /* Enable paging */