Module Name: src Committed By: tsutsui Date: Thu Jan 6 13:25:32 UTC 2011
Modified Files: src/sys/arch/hp300/hp300: leds.c pmap_bootstrap.c Log Message: Move VA allocation of ledbase to leds.c just before pmap_enter(9) to reduce MD quirk in pmap_bootstrap.c. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/hp300/leds.c cvs rdiff -u -r1.52 -r1.53 src/sys/arch/hp300/hp300/pmap_bootstrap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp300/hp300/leds.c diff -u src/sys/arch/hp300/hp300/leds.c:1.18 src/sys/arch/hp300/hp300/leds.c:1.19 --- src/sys/arch/hp300/hp300/leds.c:1.18 Sun Mar 4 05:59:49 2007 +++ src/sys/arch/hp300/hp300/leds.c Thu Jan 6 13:25:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $ */ +/* $NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $"); #include <sys/param.h> @@ -85,7 +85,7 @@ #include <hp300/hp300/leds.h> -extern void * ledbase; /* kva of LED page */ +static vaddr_t ledbase; /* kva of LED page */ uint8_t *ledaddr; /* actual address of LEDs */ static volatile uint8_t currentleds; /* current LED status */ @@ -96,10 +96,11 @@ ledinit(void) { - pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR, + ledbase = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY); + pmap_enter(pmap_kernel(), ledbase, (paddr_t)LED_ADDR, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); pmap_update(pmap_kernel()); - ledaddr = (uint8_t *) ((long)ledbase | (LED_ADDR & PGOFSET)); + ledaddr = (uint8_t *)(ledbase | (LED_ADDR & PGOFSET)); } /* Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 Thu Jan 6 13:03:47 2011 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 6 13:25:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $"); #include <sys/param.h> #include <uvm/uvm_extern.h> @@ -63,12 +63,10 @@ * CADDR1, CADDR2: pmap zero/copy operations * vmmap: /dev/mem, crash dumps, parity error checking * msgbufaddr: kernel message buffer - * ledbase: SPU LEDs */ void *CADDR1, *CADDR2; char *vmmap; void *msgbufaddr; -void *ledbase; void pmap_bootstrap(paddr_t, paddr_t); @@ -483,8 +481,6 @@ va += PAGE_SIZE; RELOC(vmmap, void *) = (void *)va; va += PAGE_SIZE; - RELOC(ledbase, void *) = (void *)va; - va += PAGE_SIZE; RELOC(msgbufaddr, void *) = (void *)va; va += m68k_round_page(MSGBUFSIZE); RELOC(virtual_avail, vaddr_t) = va;