diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/mainbus.c | 9 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 36 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/vm_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/hppa/include/pmap.h | 6 |
4 files changed, 26 insertions, 29 deletions
diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c index b15508c8a58..833e5caeb82 100644 --- a/sys/arch/hppa/hppa/mainbus.c +++ b/sys/arch/hppa/hppa/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.25 2002/02/16 02:41:15 mickey Exp $ */ +/* $OpenBSD: mainbus.c,v 1.26 2002/02/21 06:12:30 mickey Exp $ */ /* * Copyright (c) 1998-2001 Michael Shalayeff @@ -116,10 +116,9 @@ mbus_add_mapping(bus_addr_t bpa, bus_size_t size, int cachable, u_int64_t pa; if (len > pdc_btlb.max_size << PGSHIFT) len = pdc_btlb.max_size << PGSHIFT; - if (btlb_insert(kernel_pmap->pmap_space, spa, - spa, &len, - kernel_pmap->pmap_pid | - pmap_prot(kernel_pmap, + if (btlb_insert(HPPA_SID_KERNEL, spa, spa, &len, + pmap_sid2pid(HPPA_SID_KERNEL) | + pmap_prot(pmap_kernel, VM_PROT_ALL)) < 0) return -1; pa = spa + len - 1; diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 2f6225cd158..d2d6775d0fb 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.59 2002/02/12 16:28:53 mickey Exp $ */ +/* $OpenBSD: pmap.c,v 1.60 2002/02/21 06:12:30 mickey Exp $ */ /* * Copyright (c) 1998-2001 Michael Shalayeff @@ -198,7 +198,7 @@ struct simplelock pmap_lock; /* XXX this is all broken */ struct simplelock sid_pid_lock; /* pids */ u_int pages_per_vm_page; -u_int pid_counter; +u_int sid_counter; TAILQ_HEAD(, pv_page) pv_page_freelist; u_int pv_nfree; @@ -642,7 +642,6 @@ pmap_bootstrap(vstart, vend) kernel_pmap->pmap_refcnt = 1; kernel_pmap->pmap_space = HPPA_SID_KERNEL; - kernel_pmap->pmap_pid = HPPA_PID_KERNEL; /* * Allocate various tables and structures. @@ -690,9 +689,9 @@ pmap_bootstrap(vstart, vend) (sizeof(struct pv_entry) * maxproc / 8 + sizeof(struct vm_page))); /* XXX PCXS needs two separate inserts in separate btlbs */ - if (btlb_insert(kernel_pmap->pmap_space, 0, 0, vstart, - kernel_pmap->pmap_pid | - pmap_prot(kernel_pmap, VM_PROT_ALL)) < 0) + if (btlb_insert(HPPA_SID_KERNEL, 0, 0, vstart, + pmap_sid2pid(HPPA_SID_KERNEL) | + pmap_prot(kernel_pmap, VM_PROT_ALL)) < 0) panic("pmap_bootstrap: cannot block map kernel"); virtual_avail = *vstart; @@ -797,7 +796,7 @@ pmap_init() pmapdebug = opmapdebug /* | PDB_VA | PDB_PV */; #endif TAILQ_INIT(&pmap_freelist); - pid_counter = HPPA_PID_KERNEL + 2; + sid_counter = HPPA_SID_KERNEL + 1; pmap_initialized = TRUE; @@ -821,34 +820,33 @@ void pmap_pinit(pmap) pmap_t pmap; { - register u_int pid; + pa_space_t sid; int s; - DPRINTF(PDB_FOLLOW, ("pmap_pinit(%p), pid=%x\n", pmap, pmap->pmap_pid)); + DPRINTF(PDB_FOLLOW, ("pmap_pinit(%p)\n", pmap)); - if (!(pid = pmap->pmap_pid)) { + if (!(sid = pmap->pmap_space)) { /* * Allocate space and protection IDs for the pmap. * If all are allocated, there is nothing we can do. */ s = splimp(); - if (pid_counter < HPPA_MAX_PID) { - pid = pid_counter; - pid_counter += 2; + if (sid_counter < HPPA_SID_MAX) { + sid = sid_counter; + sid_counter++; } else - pid = 0; + sid = 0; splx(s); - if (pid == 0) - panic ("no more pmap ids\n"); + if (sid == 0) + panic("no more space ids\n"); simple_lock_init(&pmap->pmap_lock); } s = splimp(); - pmap->pmap_pid = pid; - pmap->pmap_space = (pid >> 1) - 1; + pmap->pmap_space = sid; pmap->pmap_refcnt = 1; pmap->pmap_stats.resident_count = 0; pmap->pmap_stats.wired_count = 0; @@ -967,7 +965,7 @@ pmap_enter(pmap, va, pa, prot, flags) panic("pmap_enter: pmap_find_pv failed"); tlbpage = tlbbtop(pa); - tlbprot = TLB_UNCACHEABLE | pmap_prot(pmap, prot) | pmap->pmap_pid; + tlbprot = TLB_UNCACHEABLE | pmap_prot(pmap, prot) | pmap_sid2pid(space); if (!(ppv = pmap_find_va(space, va))) { /* diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c index 368170a2b21..90293feb08e 100644 --- a/sys/arch/hppa/hppa/vm_machdep.c +++ b/sys/arch/hppa/hppa/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.32 2002/02/11 21:16:32 mickey Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.33 2002/02/21 06:12:30 mickey Exp $ */ /* * Copyright (c) 1999-2002 Michael Shalayeff @@ -217,7 +217,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) p2->p_vmspace->vm_map.pmap->pmap_space; tf->tf_iisq_head = tf->tf_iisq_tail = p2->p_vmspace->vm_map.pmap->pmap_space; - tf->tf_pidr1 = tf->tf_pidr2 = p2->p_vmspace->vm_map.pmap->pmap_pid; + tf->tf_pidr1 = tf->tf_pidr2 = pmap_sid2pid(tf->tf_sr0); /* * theoretically these could be inherited from the father, diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h index 935473902fa..b9924dbda60 100644 --- a/sys/arch/hppa/include/pmap.h +++ b/sys/arch/hppa/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.16 2002/01/10 01:23:08 mickey Exp $ */ +/* $OpenBSD: pmap.h,v 1.17 2002/02/21 06:12:31 mickey Exp $ */ /* * Copyright (c) 1998,1999 Michael Shalayeff @@ -88,7 +88,6 @@ struct pmap { struct simplelock pmap_lock; /* lock on map */ int pmap_refcnt; /* reference count */ pa_space_t pmap_space; /* space for this pmap */ - u_int pmap_pid; /* protection id for pmap */ struct pmap_statistics pmap_stats; /* statistics */ } *pmap_t; extern pmap_t kernel_pmap; /* The kernel's map */ @@ -140,7 +139,7 @@ struct pv_page { struct pv_entry pvp_pv[NPVPPG]; }; -#define HPPA_MAX_PID 0xfffa +#define HPPA_SID_MAX 0x7fff #define HPPA_SID_KERNEL 0 #define HPPA_PID_KERNEL 2 @@ -169,6 +168,7 @@ extern void gateway_page __P((void)); #define pmap_kernel_va(VA) \ (((VA) >= VM_MIN_KERNEL_ADDRESS) && ((VA) <= VM_MAX_KERNEL_ADDRESS)) +#define pmap_sid2pid(s) (((s) + 1) << 1) #define pmap_kernel() (kernel_pmap) #define pmap_resident_count(pmap) ((pmap)->pmap_stats.resident_count) #define pmap_reference(pmap) \ |