Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp300/hp300 Move VA allocation of ledbase to leds.c...
details: https://anonhg.NetBSD.org/src/rev/edc83f947c87
branches: trunk
changeset: 760511:edc83f947c87
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Thu Jan 06 13:25:32 2011 +0000
description:
Move VA allocation of ledbase to leds.c just before pmap_enter(9)
to reduce MD quirk in pmap_bootstrap.c.
diffstat:
sys/arch/hp300/hp300/leds.c | 11 ++++++-----
sys/arch/hp300/hp300/pmap_bootstrap.c | 8 ++------
2 files changed, 8 insertions(+), 11 deletions(-)
diffs (81 lines):
diff -r f9628d4b5aa5 -r edc83f947c87 sys/arch/hp300/hp300/leds.c
--- a/sys/arch/hp300/hp300/leds.c Thu Jan 06 13:13:44 2011 +0000
+++ b/sys/arch/hp300/hp300/leds.c Thu Jan 06 13:25:32 2011 +0000
@@ -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));
}
/*
diff -r f9628d4b5aa5 -r edc83f947c87 sys/arch/hp300/hp300/pmap_bootstrap.c
--- a/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 06 13:13:44 2011 +0000
+++ b/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 06 13:25:32 2011 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index