From: Andy P. <at...@us...> - 2001-02-15 01:26:18
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv31452/kernel Modified Files: cpu_ka46.c interrupt.c setup.c Log Message: pagelet updates, MM updates. shot 9 Index: cpu_ka46.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/cpu_ka46.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- cpu_ka46.c 2001/01/17 16:13:57 1.1 +++ cpu_ka46.c 2001/02/15 01:26:58 1.2 @@ -74,8 +74,8 @@ void ka46_post_vm_init(void) { init_dz11_console(0x200A0000, 3); - dz_serial_console_init(0, 0); + asm("halt"); } const char *ka46_cpu_type_str(void) Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- interrupt.c 2001/01/29 00:56:19 1.5 +++ interrupt.c 2001/02/15 01:26:58 1.6 @@ -22,9 +22,9 @@ #include "interrupt.h" /* Local, private definitions */ -unsigned char __attribute((__aligned__(VPAGE_SIZE))) interrupt_stack[NR_CPUS][INT_STACK_SIZE]; +unsigned char __attribute((__aligned__(PAGE_SIZE))) interrupt_stack[NR_CPUS][INT_STACK_SIZE]; -union scb_and_device_vectors __attribute((__aligned__(VPAGE_SIZE))) scb; +union scb_and_device_vectors __attribute((__aligned__(PAGE_SIZE))) scb; /* Statically-defined pool of irqvector structures. This will go once we have a working kmalloc()/kfree(). @@ -48,22 +48,34 @@ void guard_int_stack(void) { - pte_t *p; - - if (INT_STACK_SIZE <= VPAGE_SIZE) { - printk("Interrupt stack too small, must be > VPAGE_SIZE\n"); + pte_t p, *q; + unsigned char *t, *s; + t = &interrupt_stack[0]; + s = SPT_BASE; + /* Do we need more than a page for the int stack? */ + if (INT_STACK_SIZE < PAGE_SIZE) { + printk("Interrupt stack too small, must be > PAGE_SIZE\n"); machine_halt(); } - - p = GET_SPTE_VIRT(interrupt_stack[smp_processor_id()]); + /* FIXME: kenn - does this want to be a 4k page or a hardware page ? */ + /* see include/asm/mm/pgtable.h */ +/* q = (((unsigned long) &interrupt_stack[smp_processor_id()])-PAGE_OFFSET)>>PAGELET_SHIFT;*/ + q = GET_HWSPTE_VIRT(&interrupt_stack[smp_processor_id()]); /* Set first page of interrupt stack area to kernel read, thus trapping any writes to this page. This will catch attempts to expand the interrupt stack before they can do any damage. */ - pte_val(*p) &= ~PAGE_PROT_MASK; - pte_val(*p) |= _PAGE_KR; + /* 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)); +/* debug hwpte calculations FIXME: remove */ +/* asm("movl %0, r2\n" + "movl %1 ,r3\n" + "movl %2 ,r4\n" + "halt" : : "g"(q), "g"(t), "g"(s) ); */ + set_pte(q, p); + __flush_tlb_one(interrupt_stack[smp_processor_id()]); } Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- setup.c 2001/01/29 00:58:11 1.3 +++ setup.c 2001/02/15 01:26:58 1.4 @@ -14,9 +14,11 @@ #include <linux/bootmem.h> #include <linux/init.h> #include <linux/string.h> +#include <linux/delay.h> #include <asm/rpb.h> #include <asm/page.h> +#include <asm/mv.h> #define COMMAND_LINE_SIZE 256 @@ -29,6 +31,28 @@ /* Linker will put this at the end of the kernel image */ extern char _end; +/* + * BUFFER is PAGE_SIZE bytes long. + */ +int get_cpuinfo(char *buffer) +{ + int len; + + len = sprintf(buffer, "cpu\t\t\t: VAX\n" + "cpu type\t\t: %s\n" + "cpu sidex\t\t: %d\n" + "page size\t\t: %ld\n" + "BogoMIPS\t\t: %lu.%02lu\n", + (char *)mv->cpu_type_str, + /* mv->sidex */ + 0x0, + PAGE_SIZE, + loops_per_jiffy / (500000/HZ), + (loops_per_jiffy / (5000/HZ)) % 100); + return len; +} + + void __init setup_arch(char **cmdline_p) { unsigned long bootmap_size; @@ -71,6 +95,7 @@ memset(¤t->thread.pcb, 0, sizeof(current->thread.pcb)); current->thread.pcb.astlvl = 4; + /* swapper_pg_dir is a 4 x pgd_t array */ SET_PAGE_DIR(current, swapper_pg_dir); /* No root filesystem yet */ |