You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dave A. <ai...@us...> - 2001-06-08 21:55:04
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv13097/include/asm-vax Modified Files: unistd.h Log Message: DA: fixed a couple of problems in syscall macros.. missing setting of r0 in syscall0 extra crap in syscall2 chmk line Index: unistd.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/unistd.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- unistd.h 2001/05/27 23:20:11 1.8 +++ unistd.h 2001/06/08 21:55:00 1.9 @@ -245,6 +245,7 @@ long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ + _sc_0 = __NR_##name; \ __asm__ __volatile__ ("pushl $0x0\n\t" \ "movl sp, ap\n\t" \ "chmk r0 # %0 %1\n\t" \ @@ -278,7 +279,7 @@ #define _syscall2(type,name,type1,arg1,type2,arg2) \ type name(type1 arg1,type2 arg2) \ { \ - long _sc_ret; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ _sc_0 = __NR_##name; \ @@ -286,7 +287,7 @@ "pushl %2\n\t" \ "pushl $0x2\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2 %3 %4\n\t" \ + "chmk r0 # %0 %1 %2 %3\n\t" \ : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2) \ : _syscall_clobbers); \ @@ -295,6 +296,8 @@ _syscall_return(type); \ } +/* "movl sp, ap\n\t" \ + */ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ type name(type1 arg1,type2 arg2,type3 arg3) \ { \ |
From: Dave A. <ai...@us...> - 2001-06-08 20:11:15
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv25693/kernel Modified Files: setup.c Log Message: DA: flush needed to make bootup go properly... with this flush in we seem to boot properly.. and load a binary.. woohoo Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- setup.c 2001/02/21 00:20:30 1.7 +++ setup.c 2001/06/08 20:11:10 1.8 @@ -19,6 +19,7 @@ #include <asm/rpb.h> #include <asm/page.h> #include <asm/mv.h> +#include <asm/mm/tlb.h> #define COMMAND_LINE_SIZE 256 @@ -118,7 +119,10 @@ /* No root filesystem yet */ ROOT_DEV = NODEV; - + /* Inserted by D.A. - 8 Jun 2001 - THIS IS NECESSARY + if not correct */ + flush_tlb(); + /* * Identify the flock of penguins. */ |
From: Dave A. <ai...@us...> - 2001-06-07 21:23:53
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv32332 Modified Files: init.c Log Message: DA: incorrect working out of S0pte... Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/init.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- init.c 2001/05/27 13:20:30 1.10 +++ init.c 2001/06/07 21:23:51 1.11 @@ -146,7 +146,11 @@ /* address in S0 space is page pointer */ /* find the entry in the SPTE corresponding to this page */ - S0pte = (pte_t *)((__pa(page) >> PAGELET_SHIFT)+sys_pgd->br); + page_physical_address=__pa(page); + S0pte = pte_offset(sys_pgd, page_physical_address); + + /* S0pte = (pte_t *)((__pa(page) >> PAGELET_SHIFT)+sys_pgd->br);*/ + printk("remap: virt addr %p, pteval %8lX , S0pte %p, %8lX\n", page, pte_val(*page), S0pte, pte_val(*S0pte)); if (!pte_present(*S0pte)) |
From: Dave A. <ai...@us...> - 2001-05-28 22:40:31
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv10807 Modified Files: bitops.h Log Message: DA: bitops incorrect.. ffz not doing ffz... noticed while doing file descriptor stuff .. should be right now Index: bitops.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/bitops.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- bitops.h 2001/01/17 16:18:52 1.1 +++ bitops.h 2001/05/28 22:40:27 1.2 @@ -177,7 +177,7 @@ { __asm__("ffc $0, $32, %1 , %0" :"=r" (word) - :"r" (~word)); + :"r" (word)); return word; } |
From: Dave A. <ai...@us...> - 2001-05-27 23:20:15
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv13351/include/asm-vax Modified Files: unistd.h Log Message: DA: re-written again... this time the return value from the syscall is correct at the callee... before it was pure crapola... I hate header files.. re-compiling takes too long :-) Index: unistd.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/unistd.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- unistd.h 2001/05/27 16:51:29 1.7 +++ unistd.h 2001/05/27 23:20:11 1.8 @@ -225,8 +225,16 @@ /* this from alpha port, easier to rework - atp */ #define _syscall_return(type) \ - return (_sc_err ? errno = _sc_ret, _sc_ret = -1L : 0), (type) _sc_ret +do { \ + if ((unsigned long)(_sc_ret) >= (unsigned long)(-125)) { \ + errno = -(_sc_ret); \ + _sc_ret = -1; \ + } \ + return (type) (_sc_ret); \ +} while (0) + /* return (_sc_ret ? errno = _sc_ret, _sc_ret = -1L : 0), (type) _sc_ret */ + #define _syscall_clobbers \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \ "r9", "r10", "r11" @@ -234,40 +242,35 @@ #define _syscall0(type, name) \ type name(void) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ - _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl $0x0\n\t" \ + __asm__ __volatile__ ("pushl $0x0\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + "chmk r0 # %0 %1\n\t" \ + : "=r"(_sc_0) \ : "0"(_sc_0) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ - _syscall_return(type); \ + _syscall_return(type); \ } #define _syscall1(type,name,type1,arg1) \ type name(type1 arg1) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ - _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl %3\n\t" \ + _sc_0 = __NR_##name; \ + __asm__ __volatile__ ("pushl %2\n\t" \ "pushl $0x1\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2 %3\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + "chmk r0 # %0 %1 %2\n\t" \ + : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ _syscall_return(type); \ } @@ -275,21 +278,19 @@ #define _syscall2(type,name,type1,arg1,type2,arg2) \ type name(type1 arg1,type2 arg2) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl %4\n\t" \ - "pushl %3\n\t" \ + __asm__ __volatile__ ("pushl %3\n\t" \ + "pushl %2\n\t" \ "pushl $0x2\n\t" \ "movl sp, ap\n\t" \ "chmk r0 # %0 %1 %2 %3 %4\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ _syscall_return(type); \ } @@ -297,23 +298,21 @@ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ type name(type1 arg1,type2 arg2,type3 arg3) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ - _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl %5\n\t" \ - "pushl %4\n\t" \ + _sc_0 = __NR_##name; \ + __asm__ __volatile__ ("pushl %4\n\t" \ "pushl %3\n\t" \ + "pushl %2\n\t" \ "pushl $0x3\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2 %3 %4 %5\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + "chmk r0 # %0 %1 %2 %3 %4\n\t" \ + : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ "m"((long)arg3) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ _syscall_return(type); \ } @@ -321,24 +320,22 @@ #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl %6\n\t" \ - "pushl %5\n\t" \ + __asm__ __volatile__ ("pushl %5\n\t" \ "pushl %4\n\t" \ "pushl %3\n\t" \ + "pushl %2\n\t" \ "pushl $0x4\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2 %3 %4 %5 %6\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + "chmk r0 # %0 %1 %2 %3 %4 %5\n\t" \ + : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ "m"((long) arg3), "m"((long) arg4) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ _syscall_return(type); \ } @@ -347,26 +344,24 @@ type5,arg5) \ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ { \ - long _sc_ret, _sc_err; \ + long _sc_ret; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_9 __asm__("r9"); \ - \ _sc_0 = __NR_##name; \ - __asm__ __volatile__ ("pushl %7\n\t" \ - "pushl %6\n\t" \ + __asm__ __volatile__ ("pushl %6\n\t" \ "pushl %5\n\t" \ "pushl %4\n\t" \ "pushl %3\n\t" \ + "pushl %2\n\t" \ "pushl $0x5\n\t" \ "movl sp, ap\n\t" \ - "chmk r0 # %0 %1 %2 %3 %4 %5 %6 %7\n\t" \ - : "=r"(_sc_0), "=r"(_sc_9) \ + "chmk r0 # %0 %1 %2 %3 %4 %5 %6\n\t" \ + : "=r"(_sc_0) \ : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ "m"((long)arg3), "m"((long)arg4), \ "m"((long)arg5) \ : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + _sc_ret = _sc_0; \ } \ _syscall_return(type); \ } |
From: Dave A. <ai...@us...> - 2001-05-27 16:51:32
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv26926/include/asm-vax Modified Files: unistd.h Log Message: DA: fix extra , in syscall2 macro Index: unistd.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/unistd.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- unistd.h 2001/05/23 22:26:00 1.6 +++ unistd.h 2001/05/27 16:51:29 1.7 @@ -287,7 +287,7 @@ "movl sp, ap\n\t" \ "chmk r0 # %0 %1 %2 %3 %4\n\t" \ : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ + : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2) \ : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ |
From: Dave A. <ai...@us...> - 2001-05-27 16:35:16
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv22125/arch/vax/kernel Modified Files: signal.c Log Message: DA: implement copy_siginfo_to_user.. last unimpl call... copied from mips.. which is same as x86 Index: signal.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/signal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- signal.c 2001/01/26 00:27:00 1.1 +++ signal.c 2001/05/27 16:35:13 1.2 @@ -6,7 +6,21 @@ */ +#include <linux/config.h> +#include <linux/sched.h> +#include <linux/mm.h> +#include <linux/smp.h> +#include <linux/smp_lock.h> +#include <linux/kernel.h> +#include <linux/signal.h> #include <linux/errno.h> +#include <linux/wait.h> +#include <linux/ptrace.h> +#include <linux/unistd.h> + +#include <asm/bitops.h> +#include <asm/pgalloc.h> +#include <asm/uaccess.h> /* FIXME: obviously, these need to be filled in... */ @@ -17,6 +31,7 @@ int sys_sigsuspend(void) { + return -ENOSYS; } @@ -40,3 +55,38 @@ return -ENOSYS; } +int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) +{ + if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t))) + return -EFAULT; + if (from->si_code < 0) + return __copy_to_user(to, from, sizeof(siginfo_t)); + else { + int err; + + /* If you change siginfo_t structure, please be sure + this code is fixed accordingly. + It should never copy any pad contained in the structure + to avoid security leaks, but must copy the generic + 3 ints plus the relevant union member. */ + err = __put_user(from->si_signo, &to->si_signo); + err |= __put_user(from->si_errno, &to->si_errno); + err |= __put_user((short)from->si_code, &to->si_code); + /* First 32bits of unions are always present. */ + err |= __put_user(from->si_pid, &to->si_pid); + switch (from->si_code >> 16) { + case __SI_FAULT >> 16: + break; + case __SI_CHLD >> 16: + err |= __put_user(from->si_utime, &to->si_utime); + err |= __put_user(from->si_stime, &to->si_stime); + err |= __put_user(from->si_status, &to->si_status); + default: + err |= __put_user(from->si_uid, &to->si_uid); + break; + /* case __SI_RT: This is not generated by the kernel as of now. */ + } + return err; + } + +} |
From: Dave A. <ai...@us...> - 2001-05-27 16:17:47
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv17983/arch/vax/kernel Modified Files: process.c Log Message: DA: set the DS to USER_DS and also pujt the user stack into the USR Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- process.c 2001/05/20 17:49:42 1.8 +++ process.c 2001/05/27 16:17:42 1.9 @@ -12,7 +12,7 @@ #include <linux/smp_lock.h> #include <linux/fs.h> #include <linux/malloc.h> - +#include <asm/uaccess.h> #include <asm/current.h> #include <asm/processor.h> #include <asm/io.h> @@ -251,10 +251,11 @@ { printk("starting thread %8lX %8lX %8lX\n", new_pc, new_sp, regs->sp); - // set_fs(USER_DS); + set_fs(USER_DS); regs->pc = new_pc; regs->sp = new_sp; regs->psl.prevmode = PSL_MODE_USER; regs->psl.accmode = PSL_MODE_USER; - + /* write the sp into the user stack pointer register */ + __mtpr(new_sp, PR_USP); } |
From: Dave A. <ai...@us...> - 2001-05-27 13:25:35
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv1335/kernel Modified Files: interrupt.c Log Message: DA: move to __mk_pte from mk_pte Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- interrupt.c 2001/02/24 23:50:57 1.10 +++ interrupt.c 2001/05/27 13:25:29 1.11 @@ -69,7 +69,7 @@ to expand the interrupt stack before they can do any damage. */ /* if this is a 4k page - need to use set_pte here */ - p = mk_pte(&interrupt_stack[smp_processor_id()],__pgprot(_PAGE_KR|_PAGE_VALID)); + p = __mk_pte(&interrupt_stack[smp_processor_id()],__pgprot(_PAGE_KR|_PAGE_VALID)); /* debug hwpte calculations FIXME: remove */ /* asm("movl %0, r2\n" |
From: Dave A. <ai...@us...> - 2001-05-27 13:20:32
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv32697/arch/vax/mm Modified Files: init.c Log Message: DA: move to __mk_pte instead of mk_pte Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/init.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- init.c 2001/05/19 12:12:02 1.9 +++ init.c 2001/05/27 13:20:30 1.10 @@ -149,7 +149,6 @@ S0pte = (pte_t *)((__pa(page) >> PAGELET_SHIFT)+sys_pgd->br); printk("remap: virt addr %p, pteval %8lX , S0pte %p, %8lX\n", page, pte_val(*page), S0pte, pte_val(*S0pte)); - printk("empty_zero_page %p %8lX\n", &empty_zero_page, __pa(&empty_zero_page)>>PAGELET_SHIFT); if (!pte_present(*S0pte)) { unsigned long phy_addr; @@ -160,7 +159,7 @@ //spte = pte_offset(sys_pgd, ((unsigned long)ret - PAGE_OFFSET)); clear_page((void *)ret); pte_clear(S0pte); - tpte = mk_pte((void *)ret, (pgprot_t)PAGE_KERNEL); + tpte = __mk_pte((void *)ret, (pgprot_t)PAGE_KERNEL); set_pte(S0pte, tpte); /* grab a free page */ |
From: Dave A. <ai...@us...> - 2001-05-27 12:51:28
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv25822 Modified Files: pagelet_pte.h Log Message: DA: changes to mk_pte, creation of __mk_pte.. there is a FIXME in there now... this code is ugly and need a cleanup Index: pagelet_pte.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/pagelet_pte.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pagelet_pte.h 2001/03/07 02:01:42 1.2 +++ pagelet_pte.h 2001/05/27 12:51:25 1.3 @@ -112,14 +112,16 @@ * * See asm-i386/pgtable-3level.h for background. */ - -static inline pte_t mk_pte(void *page, pgprot_t pgprot) +/* D.A. May 2001 - FIXME: this needs cleaning up, hacked in a mk_pte and __mk_pte... will clean up later.. our mk_pte is being use incorrectly in some VAX code so I needed __mk_pte. + */ +static inline pte_t __mk_pte(void *page, pgprot_t pgprot) { pte_t pte; pte.pte = (__pa(page) >> PAGELET_SHIFT) | pgprot_val(pgprot); return pte; } +#define mk_pte(page, pgprot) __mk_pte(((page)-mem_map)<<PAGE_SHIFT,(pgprot)) /* This takes a physical page address that is used by the remapping functions */ static inline pte_t mk_pte_phys(void *physpage, pgprot_t pgprot) { |
From: Dave A. <ai...@us...> - 2001-05-27 12:34:17
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv21374/arch/vax/kernel Modified Files: entry.S Log Message: DA: return from syscall needed to copy the PSL from the pt_regs struct into the save PSL.. otherwise we would never use the value set in start_thread and never make it into user mode... Well done Kenn on the commenting... found what I needed in about 10 secs .. I'll have to start forcing myself to comment like this :-) Index: entry.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/entry.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- entry.S 2001/01/29 00:55:04 1.3 +++ entry.S 2001/05/27 12:34:13 1.4 @@ -152,6 +152,12 @@ the R0 index skips over the exception info */ movl 4(sp), 20(sp)[r0] + /* + * D.A. May 2001 - we need to copy the PSL down, to + * get to usermode originally as we make up a new PSL + * in start_thread and we need the CPU to believe it + */ + movl 8(sp), 24(sp)[r0] /* The stack now looks like: SP: saved SP for previous mode |
From: Dave A. <ai...@us...> - 2001-05-23 22:26:07
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv22488/include/asm-vax Modified Files: unistd.h Log Message: DA: added some comments Index: unistd.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/unistd.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- unistd.h 2001/05/20 19:34:09 1.5 +++ unistd.h 2001/05/23 22:26:00 1.6 @@ -1,6 +1,12 @@ #ifndef _ASM_VAX_UNISTD_H_ #define _ASM_VAX_UNISTD_H_ +/* + * syscall macros Copyright (c) David Airlie 2001 (ai...@li...) + * -- see comments + */ + + /* FIXME: Who do we want to be compatible with? * e.g. see ../asm-mips/unistd.h */ @@ -200,6 +206,22 @@ /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */ +/* + * syscall functions for system calls with 0->5 arguments are implemented + * here-in, for inclusion in libc also. + * All syscalls are implemented the same, the syscall arguments are + * pushed onto the stack, the number of arguments is pushed, the sp + * is loaded into the ap register and the chmk call is made with the + * syscall number as the argument in the r0 register. + * + * Possible optimisations, don't need to use r0 to pass the chmk argument + * suggested by Kenn, will examine later as we are using r0 for the + * return value. + * + * Opposing code is in arch/vax/kernel/syscall.c as is from Kenn Humborg, + * any changes here should be reflected there and vice-versa. + * - Dave Airlie, May 2001 + */ /* this from alpha port, easier to rework - atp */ #define _syscall_return(type) \ |
From: Dave A. <ai...@us...> - 2001-05-20 20:46:02
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv5099 Modified Files: clear_user.S Log Message: DA: get it right in the end ... thinkos typos .. Index: clear_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/clear_user.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- clear_user.S 2001/05/20 20:37:55 1.3 +++ clear_user.S 2001/05/20 20:45:59 1.4 @@ -25,7 +25,7 @@ movl 4(ap), r1 /* r1 now has addr */ movl 8(ap), r0 /* r0 has size */ beql 2f -1: EX(movb, (r1)+, 0, fault) +1: EX(movb, $0, (r1)+, fault) sobgtr r0, 1b 2: ret |
From: Dave A. <ai...@us...> - 2001-05-20 20:38:00
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv3581/arch/vax/lib Modified Files: clear_user.S Log Message: DA: typo .. wrong reg... Index: clear_user.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/clear_user.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- clear_user.S 2001/03/14 22:36:58 1.2 +++ clear_user.S 2001/05/20 20:37:55 1.3 @@ -23,7 +23,7 @@ ENTRY(__clear_user) .word 0x3e movl 4(ap), r1 /* r1 now has addr */ - movl 8(ap), r1 /* r0 has size */ + movl 8(ap), r0 /* r0 has size */ beql 2f 1: EX(movb, (r1)+, 0, fault) sobgtr r0, 1b |
From: Dave A. <ai...@us...> - 2001-05-20 19:34:12
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv25739/include/asm-vax Modified Files: unistd.h Log Message: DA: unistd.h updated to actually syscall execve and dup and loads of others.. more like mips one than alpha one now .. fixed up all the syscall macros .. still need to do syscall6 + 7 Index: unistd.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/unistd.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- unistd.h 2001/02/26 02:43:55 1.4 +++ unistd.h 2001/05/20 19:34:09 1.5 @@ -200,17 +200,14 @@ /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */ -#if defined(__LIBRARY__) && defined(__GNUC__) -#error These syscall macros are all wrong. Kenn - 2000-10-14 - /* this from alpha port, easier to rework - atp */ #define _syscall_return(type) \ return (_sc_err ? errno = _sc_ret, _sc_ret = -1L : 0), (type) _sc_ret #define _syscall_clobbers \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \ - "r9", "r10", "r11" \ + "r9", "r10", "r11" #define _syscall0(type, name) \ type name(void) \ @@ -220,10 +217,12 @@ register long _sc_0 __asm__("r0"); \ register long _sc_9 __asm__("r9"); \ \ - _sc_0 = __NR_##name; \ - __asm__("chmk # %0 %1 %2" \ + _sc_0 = __NR_##name; \ + __asm__ __volatile__ ("pushl $0x0\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2\n\t" \ : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0) \ + : "0"(_sc_0) \ : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ @@ -236,15 +235,16 @@ long _sc_ret, _sc_err; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_6 __asm__("r6"); \ register long _sc_9 __asm__("r9"); \ \ _sc_0 = __NR_##name; \ - _sc_6 = (long) (arg1); \ - __asm__("chmk # %0 %1 %2 %3" \ + __asm__ __volatile__ ("pushl %3\n\t" \ + "pushl $0x1\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2 %3\n\t" \ : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "r"(_sc_6) \ - : _syscall_clobbers); \ + : "0"(_sc_0), "m"((long)arg1) \ + : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ _syscall_return(type); \ @@ -256,17 +256,17 @@ long _sc_ret, _sc_err; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_6 __asm__("r6"); \ - register long _sc_7 __asm__("r7"); \ - register long _sc_9 __asm__("r9"); \ + register long _sc_9 __asm__("r9"); \ \ _sc_0 = __NR_##name; \ - _sc_6 = (long) (arg1); \ - _sc_7 = (long) (arg2); \ - __asm__("chmk # %0 %1 %2 %3 %4" \ + __asm__ __volatile__ ("pushl %4\n\t" \ + "pushl %3\n\t" \ + "pushl $0x2\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2 %3 %4\n\t" \ : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "r"(_sc_6), "r"(_sc_7) \ - : _syscall_clobbers); \ + : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ + : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ _syscall_return(type); \ @@ -276,21 +276,20 @@ type name(type1 arg1,type2 arg2,type3 arg3) \ { \ long _sc_ret, _sc_err; \ - { \ + { \ register long _sc_0 __asm__("r0"); \ - register long _sc_6 __asm__("r6"); \ - register long _sc_7 __asm__("r7"); \ - register long _sc_8 __asm__("r8"); \ register long _sc_9 __asm__("r9"); \ \ _sc_0 = __NR_##name; \ - _sc_6 = (long) (arg1); \ - _sc_7 = (long) (arg2); \ - _sc_8 = (long) (arg3); \ - __asm__("chmk # %0 %1 %2 %3 %4 %5" \ + __asm__ __volatile__ ("pushl %5\n\t" \ + "pushl %4\n\t" \ + "pushl %3\n\t" \ + "pushl $0x3\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2 %3 %4 %5\n\t" \ : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "r"(_sc_6), "r"(_sc_7), \ - "r"(_sc_8) \ + : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ + "m"((long)arg3) \ : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ @@ -303,25 +302,24 @@ long _sc_ret, _sc_err; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_16 __asm__("r6"); \ - register long _sc_17 __asm__("r7"); \ - register long _sc_18 __asm__("r8"); \ - register long _sc_19 __asm__("r9"); \ + register long _sc_9 __asm__("r9"); \ \ _sc_0 = __NR_##name; \ - _sc_6 = (long) (arg1); \ - _sc_7 = (long) (arg2); \ - _sc_8 = (long) (arg3); \ - _sc_9 = (long) (arg4); \ - __asm__("chmk # %0 %1 %2 %3 %4 %5 %6" \ - : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "r"(_sc_6), "r"(_sc_7), \ - "r"(_sc_8), "1"(_sc_9) \ - : _syscall_clobbers); \ + __asm__ __volatile__ ("pushl %6\n\t" \ + "pushl %5\n\t" \ + "pushl %4\n\t" \ + "pushl %3\n\t" \ + "pushl $0x4\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2 %3 %4 %5 %6\n\t" \ + : "=r"(_sc_0), "=r"(_sc_9) \ + : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ + "m"((long) arg3), "m"((long) arg4) \ + : _syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ _syscall_return(type); \ -} +} #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ @@ -330,28 +328,26 @@ long _sc_ret, _sc_err; \ { \ register long _sc_0 __asm__("r0"); \ - register long _sc_6 __asm__("r6"); \ - register long _sc_7 __asm__("r7"); \ - register long _sc_8 __asm__("r8"); \ register long _sc_9 __asm__("r9"); \ - register long _sc_10 __asm__("r10"); \ \ _sc_0 = __NR_##name; \ - _sc_6 = (long) (arg1); \ - _sc_7 = (long) (arg2); \ - _sc_8 = (long) (arg3); \ - _sc_9 = (long) (arg4); \ - _sc_10 = (long) (arg5); \ - __asm__("chmk # %0 %1 %2 %3 %4 %5 %6 %7" \ - : "=r"(_sc_0), "=r"(_sc_9) \ - : "0"(_sc_0), "r"(_sc_6), "r"(_sc_7), \ - "r"(_sc_8), "1"(_sc_9), "r"(_sc_10) \ - : _syscall_clobbers); \ - _sc_ret = _sc_0, _sc_err = _sc_9; \ + __asm__ __volatile__ ("pushl %7\n\t" \ + "pushl %6\n\t" \ + "pushl %5\n\t" \ + "pushl %4\n\t" \ + "pushl %3\n\t" \ + "pushl $0x5\n\t" \ + "movl sp, ap\n\t" \ + "chmk r0 # %0 %1 %2 %3 %4 %5 %6 %7\n\t" \ + : "=r"(_sc_0), "=r"(_sc_9) \ + : "0"(_sc_0), "m"((long)arg1), "m"((long)arg2), \ + "m"((long)arg3), "m"((long)arg4), \ + "m"((long)arg5) \ + : _syscall_clobbers); \ + _sc_ret = _sc_0, _sc_err = _sc_9; \ } \ _syscall_return(type); \ } -#endif /* __LIBRARY__ && __GNUC__ */ #ifdef __KERNEL_SYSCALLS__ @@ -386,88 +382,31 @@ extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); +#define __NR__exit __NR_exit +static inline _syscall0(int,sync) +static inline _syscall0(pid_t,setsid) +static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) +static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) +static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) +static inline _syscall1(int,dup,int,fd) +static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) +static inline _syscall3(int,open,const char *,file,int,flag,int,mode) +static inline _syscall1(int,close,int,fd) +static inline _syscall1(int,_exit,int,exitcode) +static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) +static inline _syscall1(int,delete_module,const char *,name) + extern int sys_idle(void); static inline int idle(void) { return sys_idle(); } -static inline int open(const char * name, int mode, int flags) -{ - return sys_open(name, mode, flags); -} - -extern int sys_dup(int); -static inline int dup(int fd) -{ - return sys_dup(fd); -} - -static inline int close(int fd) -{ - return sys_close(fd); -} - -extern off_t sys_lseek(int, off_t, int); -static inline off_t lseek(int fd, off_t off, int whense) -{ - return sys_lseek(fd, off, whense); -} - -extern int sys_exit(int); -static inline int _exit(int value) -{ - return sys_exit(value); -} - #define exit(x) _exit(x) -extern int sys_write(int, const char *, int); -static inline int write(int fd, const char * buf, int nr) -{ - return sys_write(fd, buf, nr); -} - -extern int sys_read(int, char *, int); -static inline int read(int fd, char * buf, int nr) -{ - return sys_read(fd, buf, nr); -} - -extern int sys_execve(char * file, char ** argvp, char ** envp, struct pt_regs *regs); -static inline int execve(char * file, char ** argvp, char ** envp) -{ - struct pt_regs regs; - memset(®s, 0, sizeof(regs)); - return sys_execve(file, argvp, envp, ®s); -} - -extern int sys_setsid(void); -static inline int setsid(void) -{ - return sys_setsid(); -} - -extern int sys_sync(void); -static inline int sync(void) -{ - return sys_sync(); -} - -static inline pid_t waitpid(int pid, int * wait_stat, int flags) -{ - return sys_wait4(pid, wait_stat, flags, NULL); -} - static inline pid_t wait(int * wait_stat) { return waitpid(-1,wait_stat,0); -} - -extern int sys_delete_module(const char *name); -static inline int delete_module(const char *name) -{ - return sys_delete_module(name); } #endif |
From: Dave A. <ai...@us...> - 2001-05-20 17:49:44
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv7649 Modified Files: process.c Log Message: switch to include linux/unistd rather than asm/unistd.. implement first attempt at start_thread Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- process.c 2001/03/07 02:03:25 1.7 +++ process.c 2001/05/20 17:49:42 1.8 @@ -7,6 +7,7 @@ */ #define __KERNEL_SYSCALLS__ +#include <stdarg.h> #include <linux/smp_lock.h> #include <linux/fs.h> @@ -19,7 +20,7 @@ #include <asm/mtpr.h> #include <asm/ptrace.h> -#include <asm/unistd.h> +#include <linux/unistd.h> #include <asm/elf.h> @@ -129,7 +130,8 @@ p->thread.pcb.usp = usp; p->thread.pcb.pc = (unsigned long)ret_from_syscall; p->thread.pcb.psl = __psl; - + + /* We could speed this up by loading the register values into the PCB and start the new thread just before the REI in entry.S, letting the regular context switching load the @@ -243,4 +245,16 @@ { /* no FPU support .. YET - D.A. 25 Feb 2001 */ return 0; +} + +void start_thread(struct pt_regs *regs, unsigned long new_pc, unsigned long new_sp) +{ + + printk("starting thread %8lX %8lX %8lX\n", new_pc, new_sp, regs->sp); + // set_fs(USER_DS); + regs->pc = new_pc; + regs->sp = new_sp; + regs->psl.prevmode = PSL_MODE_USER; + regs->psl.accmode = PSL_MODE_USER; + } |
From: Dave A. <ai...@us...> - 2001-05-20 13:25:16
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv382 Modified Files: fault.c Log Message: DA: fix incorrect reason defines... assert copyright Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/fault.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- fault.c 2001/04/11 21:36:53 1.4 +++ fault.c 2001/05/20 13:25:11 1.5 @@ -2,6 +2,9 @@ * linux/arch/alpha/mm/fault.c * * Copyright (C) 1995 Linus Torvalds + * + * Copyright (C) 2001 Kenn Humborg, Andy Phillips, David Airlie + * (Vax Porting team) */ #include <linux/sched.h> @@ -32,15 +35,15 @@ * it off to handle_mm_fault(). * * reason: - * 0 = length violation - * 1 = fault during PPTE reference - * 2 = fault-on-read if 0, fault-on-write if 1 + * bit 0 = length violation + * bit 1 = fault during PPTE reference + * bit 2 = fault-on-read if 0, fault-on-write if 1 * */ -#define REASON_LENGTH 0 -#define REASON_PPTEREF 1 -#define REASON_WRITE 2 +#define REASON_LENGTH (1<<0) +#define REASON_PPTEREF (1<<1) +#define REASON_WRITE (1<<2) static void |
From: Dave A. <ai...@us...> - 2001-05-19 12:12:05
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv29098/arch/vax/mm Modified Files: init.c Log Message: DA: moved remap_and_clear_pte_page around it now allocates a page of S0 space to put P0/P1 ptes into .. it clears the page .. it is called from pte_alloc .. not sure if this was the right place to do this .. but it look as good as any ... Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/init.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- init.c 2001/02/18 16:42:45 1.8 +++ init.c 2001/05/19 12:12:02 1.9 @@ -138,25 +138,37 @@ /* remap a given page to be part of a contiguous page table for p0/1 space */ void remap_and_clear_pte_page(pgd_t *pagetable, pte_t *page, unsigned long pte_page) { - unsigned long page_physical_address, page_virtual_address; + unsigned long page_physical_address, page_virtual_address, page_s0_address; pte_t *S0pte; pte_t tpte; - - /* zero out these pte's */ - clear_page((void *) page); - - /* page addresses */ - page_physical_address = __pa(page); - page_virtual_address = (pte_page * PAGE_SIZE) + pagetable->br; - - /* S0 pte entry for this virtual address */ - S0pte = ((page_virtual_address - PAGE_OFFSET) >> PAGE_SHIFT)+swapper_pg_dir; + pte_t *newpage; + pgd_t *sys_pgd = swapper_pg_dir+2; + /* address in S0 space is page pointer */ + /* find the entry in the SPTE corresponding to this page */ - /* FIXME: what if the page is already mapped? (TASK_SIZE) */ - pte_clear(S0pte); - tpte = mk_pte_phys((void*)page_physical_address,(pgprot_t)PAGE_KERNEL); - set_pte(S0pte, tpte); + S0pte = (pte_t *)((__pa(page) >> PAGELET_SHIFT)+sys_pgd->br); + printk("remap: virt addr %p, pteval %8lX , S0pte %p, %8lX\n", page, pte_val(*page), S0pte, pte_val(*S0pte)); + + printk("empty_zero_page %p %8lX\n", &empty_zero_page, __pa(&empty_zero_page)>>PAGELET_SHIFT); + if (!pte_present(*S0pte)) + { + unsigned long phy_addr; + pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL); + /* we have address in S0 of free page */ + /* need to remap this free page to the address in S0 where we are */ + /* Get the phy address of the page */ + //spte = pte_offset(sys_pgd, ((unsigned long)ret - PAGE_OFFSET)); + clear_page((void *)ret); + pte_clear(S0pte); + tpte = mk_pte((void *)ret, (pgprot_t)PAGE_KERNEL); + + set_pte(S0pte, tpte); + /* grab a free page */ + printk("S0 page invalid, %p %8lX\n", ret, pte_val(tpte)); + return; + } + /* zero out these pte's */ + // clear_page((void *) page); return; } - |
From: Dave A. <ai...@us...> - 2001-05-19 12:07:01
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv28699/include/asm-vax/mm Modified Files: pgtable.h Log Message: DA: change for SPT entries .. page vs pagelet stuff Index: pgtable.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/pgtable.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- pgtable.h 2001/03/07 02:02:30 1.10 +++ pgtable.h 2001/05/19 12:06:58 1.11 @@ -38,9 +38,13 @@ #define SPT_MAX_IOMAP 1024 #define SPT_MAX_VMALLOC 4096 -#define SPT_ENTRIES_IOMAP (SPT_MAX_IOMAP >> (PAGE_SHIFT-10)) +/* entries is (1024 * 1024) >> PAGELET_SIZE */ +#define SPT_HWPTES_IOMAP (SPT_MAX_IOMAP<<1) +#define SPT_PTES_IOMAP (SPT_MAX_IOMAP >> 2) + /*/>> (PAGE_SHIFT-10)) */ /* FIXME: (PAGE_SHIFT-10) is hardwired here to 2. asm bug in head.S */ -#define SPT_ENTRIES_VMALLOC (SPT_MAX_VMALLOC >> 2) +#define SPT_HWPTES_VMALLOC (SPT_MAX_VMALLOC << 1) +#define SPT_PTES_VMALLOC (SPT_MAX_VMALLOC >> 2) #define SPT_BASE ((unsigned long)( (swapper_pg_dir[2]).br )) #define SPT_SIZE ((unsigned long)( (swapper_pg_dir[2]).lr )) |
From: Dave A. <ai...@us...> - 2001-05-19 12:05:54
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv28407/include/asm-vax/mm Modified Files: pgalloc.h Log Message: DA: extensive changes to pgalloc.h allocates p0 + p1 page tables at correct place in system for 2.4 implement pte_alloc_kernel + pte_alloc in a much simplified fashion fixed process size... needs #defining properly.. Index: pgalloc.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/pgalloc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pgalloc.h 2001/02/15 01:17:23 1.3 +++ pgalloc.h 2001/05/19 12:05:51 1.4 @@ -13,12 +13,15 @@ * pgds into a single page, and add pages as needed. The quicklists * structure can be hijacked for this. Or at least one per pagelet... */ - +/* + * (c) Copyright Dave Airlie 2001 - ai...@li... + * -- re-write for fixed sized processes + */ #include <asm/processor.h> #include <linux/threads.h> #include <asm/mm/virtmap.h> +#include <linux/vmalloc.h> - #ifndef CONFIG_SMP extern struct pgtable_cache_struct { unsigned long *pgd_cache; @@ -31,7 +34,6 @@ #define quicklists cpu_data[smp_processor_id()] #endif - #define pgd_quicklist (quicklists.pgd_cache) #define pmd_quicklist ((unsigned long *)0) #define pte_quicklist (quicklists.pte_cache) @@ -63,7 +65,9 @@ * used to allocate a kernel page table - this turns on ASN bits * if any. */ - +#if 0 +extern pgd_t *get_pgd_slow(void); +#else extern __inline__ pgd_t *get_pgd_slow(void) { /* @@ -75,13 +79,22 @@ pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL); if (ret) { - /* set p0 and p1 regions to empty values */ - memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); - /* set the s0 region, from the master copy in swapper_pg_dir */ - memcpy(ret + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); + /* Allocate space for the p0/p1 page tables */ + /* allocate 192 pages at 4096 bytes each for page tables? */ + ret[0].br = (unsigned long)vmalloc(192 * PAGE_SIZE); + ret[0].lr = ((160*PAGE_SIZE)>>SIZEOF_PTE_LOG2); + /* the p1br needs to be set back from the end of the p1 ptes */ + ret[1].br = (ret[0].br - 0x800000) + (192*PAGE_SIZE); + ret[1].lr = 0x40000-((32*PAGE_SIZE)>>SIZEOF_PTE_LOG2); + + printk("get_pgd: p0: %8lX, %8lX, p1: %8lX, %8lx\n", ret[0].br, ret[0].lr, ret[1].br, ret[1].lr); + + /* set the s0 region, from the master copy in swapper_pg_dir */ + memcpy(ret + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); } return ret; } +#endif extern __inline__ pgd_t *get_pgd_fast(void) { @@ -93,6 +106,7 @@ pgtable_cache_size--; } else ret = (unsigned long *)get_pgd_slow(); + return (pgd_t *)ret; } @@ -179,12 +193,21 @@ * * - At present I'm ducking this. We fix the S0 page table size at * boot time, and disallow dynamic expansion. atp Feb 2001. + * + * - we still need to implement this ... linux still calls it .. + * - D.A. May 2001. */ extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) { - return NULL; -} + pgd_t *pgdptr = (pgd_t *)pmd; + /* note the lr in the system pgd is in PAGELETS.... shift it down to + give page view */ + if ((address >> PAGE_SHIFT) < (pgdptr->lr>>3)) + return pte_offset(pmd, address); + else + return NULL; +} /* * allocate a page, to hold page table entries. @@ -195,7 +218,45 @@ */ extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address) { - + unsigned long pte_number, pte_page, pte_page_offset; + pgd_t *pgdptr = (pgd_t *)pmd; + pte_t *newpte= NULL; + + /* Deal with P0 vs P1 spaces */ + /* need to handle error cases */ + if (address < 0x40000000) + { + pte_number = (address >> PAGE_SHIFT); + pte_page = (pte_number >> SIZEOF_PTE_LOG2); + pte_page_offset = pte_number & (PTRS_PER_PTE - 1); + if ((pte_number) < (pgdptr->lr)) { + newpte = pte_offset(pmd, address); + } + } + else + { + address-=0x40000000; + pte_number = (address>>PAGE_SHIFT); + pte_page = (pte_number >> SIZEOF_PTE_LOG2); + pte_page_offset = pte_number & (PTRS_PER_PTE - 1); + if ((pte_number) > (pgdptr->lr)) { + newpte = pte_offset(pmd, address); + } + + } + + if (newpte) + { + remap_and_clear_pte_page((pgd_t *)pmd, newpte, pte_page); + pte_clear(newpte); + /* make sure a page in S0 space is mapped */ + + } + return newpte; + + /* old 2.2 code commented out for now .. in case it is of any use + to anyone later - D.A. May 2001 */ +#if 0 /* calculate the offset of the requested pte in this pagetable page */ unsigned long pte_number, pte_page, pte_page_offset; pgd_t *pgdptr = (pgd_t *)pmd; @@ -209,6 +270,7 @@ /* do we have a pgd base and length set ? */ /* The p0br and p1br should be setup at process initialisation. */ if (pmd_none(*pmd)) { + printk("Got pmd_none\n"); return NULL; } @@ -248,6 +310,7 @@ pgdptr->lr += PTRS_PER_PTE; } return (pte_t *)( pgdptr->br + pte_number*BYTES_PER_PTE_T); +#endif /* if 0 */ } |
From: Dave A. <ai...@us...> - 2001-05-19 12:04:28
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv28248/include/asm-vax/mm Modified Files: mmu_context.h Log Message: DA: set P0/P1 page stuff at switch_mm stage - 2.4 lazy tlb stuff this is the proper place set_page_dir is gone Index: mmu_context.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/mmu_context.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mmu_context.h 2001/01/18 15:52:28 1.1 +++ mmu_context.h 2001/05/19 12:04:25 1.2 @@ -1,6 +1,8 @@ #ifndef _ASM_VAX_MMU_CONTEXT_H #define _ASM_VAX_MMU_CONTEXT_H +#include <asm/mm/tlb.h> + /* mmu_contexts are part of process control block */ #define init_new_context(tsk,mm) 0 @@ -15,7 +17,15 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu) { - clear_bit(cpu, &prev->cpu_vm_mask); + if (prev!=next) { + clear_bit(cpu, &prev->cpu_vm_mask); + __mtpr(next->pgd[0].br, PR_P0BR); + __mtpr((next->pgd[0].lr * 8 | 0x04000000), PR_P0LR); + __mtpr(next->pgd[1].br, PR_P1BR); + __mtpr((next->pgd[1].lr * 8), PR_P1LR); + flush_tlb_all(); + + } set_bit(cpu, &next->cpu_vm_mask); } |
From: Dave A. <ai...@us...> - 2001-05-19 12:03:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv28123/arch/vax/mm Modified Files: ioremap.c Log Message: fix for SPT entries difference between page/pagelet stuff Index: ioremap.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/ioremap.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ioremap.c 2001/02/15 16:50:54 1.4 +++ ioremap.c 2001/05/19 12:03:00 1.5 @@ -57,7 +57,7 @@ We need this because iounmap() doesn't take a size arg. We store the size as a PTE count. */ -static unsigned int iomap_sizes[SPT_ENTRIES_IOMAP]; +static unsigned int iomap_sizes[SPT_PTES_IOMAP]; void *ioremap(unsigned long phys_addr, unsigned long size) { @@ -80,7 +80,7 @@ start_pte = NULL; p = iomap_base; - while (p < iomap_base+SPT_ENTRIES_IOMAP) { + while (p < iomap_base+SPT_PTES_IOMAP) { if (pte_val(*p) & _PAGE_VALID) { /* PTE in use, start over */ @@ -144,7 +144,7 @@ p = GET_HWSPTE_VIRT(addr); - if ((p < iomap_base) && (p >= (iomap_base + SPT_ENTRIES_IOMAP))) { + if ((p < iomap_base) && (p >= (iomap_base + SPT_PTES_IOMAP))) { printk("iounmap: virtual addr 0x%08lx not in IOMAP region\n", (unsigned long) addr); return; |
From: Dave A. <ai...@us...> - 2001-05-19 12:03:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot In directory usw-pr-cvs1:/tmp/cvs-serv28123/arch/vax/boot Modified Files: head.S Log Message: fix for SPT entries difference between page/pagelet stuff Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/head.S,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- head.S 2001/03/07 02:03:52 1.6 +++ head.S 2001/05/19 12:03:00 1.7 @@ -6,7 +6,7 @@ #include <asm/mtpr.h> /* Processor register definitions */ #include <asm/mv.h> /* machine vector definitions */ #include <asm/page.h> /* get PAGE_OFFSET definition */ -#include <asm/pgtable.h> /* PTE definitions */ +#include <asm/pgtable.h> /* PTE definitions */ #include <asm/irq.h> /* interrupt stack definitions */ .section .vaxboot @@ -176,10 +176,9 @@ # save RPB before it gets obliterated movl boot_r11, r11 movc3 rpb_size, (r11), boot_rpb - movl mv, r3 calls $0, *MV_PRE_VM_INIT(r3) - + # set up the system page table for all of physical memory. # for the i386, the first page only is setup. For us, as the # system memory map is contiguous anyway, we might as well setup @@ -213,13 +212,20 @@ # Zero out the spare part of the SPT (the entries that will be used # to map I/O space and provide virtual addrs for vmalloc() later) movl r5, iomap_base - addl2 $SPT_ENTRIES_IOMAP+SPT_ENTRIES_VMALLOC, r7 -sparefill: + addl2 $SPT_HWPTES_IOMAP+0, r7 +sparef1: movl $0x00000000, (r5)+ incl r6 # next PFN cmpl r6, r7 # one page of PTE Table -> 128 Pages of PTES - blssu sparefill + blssu sparef1 + movl r5, vmallocmap_base + addl2 $SPT_HWPTES_VMALLOC, r7 +sparefill2: + movl $0x00000000, (r5)+ + incl r6 # next PFN + cmpl r6, r7 # one page of PTE Table -> 128 Pages of PTES + blssu sparefill2 # system page table is setup. Save SPT length and zap processor registers moval swapper_pg_dir, r0 movl r7, 20(r0) @@ -234,6 +240,7 @@ moval swapper_pg_dir, r0 addl2 $PAGE_OFFSET, 16(r0) # fix up our reference to the system page tbl. addl2 $PAGE_OFFSET, iomap_base # ... and the IOMAP PTEs + addl2 $PAGE_OFFSET, vmallocmap_base # ... and the IOMAP PTEs addl2 $PAGE_OFFSET, mv # fix up machine vector pointer movl mv, r3 addl2 $PAGE_OFFSET, MV_CPU_TYPE_STR(r3) @@ -322,6 +329,9 @@ # Once VM is enabled, this is replaced with the VIRTUAL address .globl iomap_base iomap_base: .int 0x00000000 + +.globl vmallocmap_base +vmallocmap_base: .int 0x00000000 # These global symbols allow us to pass stuff to C in a relatively painless # manner. |
From: Dave A. <ai...@us...> - 2001-05-19 12:01:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/mm In directory usw-pr-cvs1:/tmp/cvs-serv27862/arch/vax/mm Modified Files: pgtable.c Log Message: mistake .. function is never called anyways.. but may as well fix it Index: pgtable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/mm/pgtable.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- pgtable.c 2001/04/11 21:51:36 1.4 +++ pgtable.c 2001/05/19 12:01:02 1.5 @@ -33,8 +33,8 @@ /* Note the factor of 8 in the length registers */ void set_page_dir_kernel(pgd_t * pgdir) { - __mtpr( (pgdir[3]).br, PR_SBR); - __mtpr( (pgdir[3]).lr, PR_SLR); + __mtpr( (pgdir[2]).br, PR_SBR); + __mtpr( (pgdir[2]).lr, PR_SLR); flush_tlb_all(); } |