Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Retire tlbpid_t (u_short):
details: https://anonhg.NetBSD.org/src/rev/3778dd308460
branches: trunk
changeset: 745548:3778dd308460
user: rin <rin%NetBSD.org@localhost>
date: Thu Mar 05 02:14:52 2020 +0000
description:
Retire tlbpid_t (u_short):
- PID (ctx, ASID) is 8-bit length, not half word.
- For struct pmap, no need to use integer types smaller than word as
pm_ctx because of alignment.
- For ppc4xx_tlb_enter(), we need word-length storage for pid (and msr).
XXX
Better to rewrite pmap module with more suggestive integer types rather
than char, int, long, and so on.
diffstat:
sys/arch/powerpc/ibm4xx/pmap.c | 7 +++----
sys/arch/powerpc/include/ibm4xx/pmap.h | 4 ++--
sys/arch/powerpc/include/ibm4xx/tlb.h | 3 +--
3 files changed, 6 insertions(+), 8 deletions(-)
diffs (63 lines):
diff -r 41c77dd06677 -r 3778dd308460 sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c Thu Mar 05 02:02:08 2020 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c Thu Mar 05 02:14:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.83 2020/03/05 01:35:00 rin Exp $ */
+/* $NetBSD: pmap.c,v 1.84 2020/03/05 02:14:52 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.83 2020/03/05 01:35:00 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.84 2020/03/05 02:14:52 rin Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -1293,8 +1293,7 @@
ppc4xx_tlb_enter(int ctx, vaddr_t va, u_int pte)
{
u_long th, tl, idx;
- tlbpid_t pid;
- u_short msr;
+ int msr, pid;
paddr_t pa;
int sz;
diff -r 41c77dd06677 -r 3778dd308460 sys/arch/powerpc/include/ibm4xx/pmap.h
--- a/sys/arch/powerpc/include/ibm4xx/pmap.h Thu Mar 05 02:02:08 2020 +0000
+++ b/sys/arch/powerpc/include/ibm4xx/pmap.h Thu Mar 05 02:14:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.19 2019/07/17 08:39:03 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.20 2020/03/05 02:14:53 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -143,7 +143,7 @@
* Pmap stuff
*/
struct pmap {
- volatile tlbpid_t pm_ctx; /* PID to identify PMAP's entries in TLB */
+ volatile int pm_ctx; /* PID to identify PMAP's entries in TLB */
int pm_refs; /* ref count */
struct pmap_statistics pm_stats; /* pmap statistics */
volatile u_int *pm_ptbl[STSZ]; /* Array of 64 pointers to page tables. */
diff -r 41c77dd06677 -r 3778dd308460 sys/arch/powerpc/include/ibm4xx/tlb.h
--- a/sys/arch/powerpc/include/ibm4xx/tlb.h Thu Mar 05 02:02:08 2020 +0000
+++ b/sys/arch/powerpc/include/ibm4xx/tlb.h Thu Mar 05 02:14:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tlb.h,v 1.5 2018/04/19 21:50:07 christos Exp $ */
+/* $NetBSD: tlb.h,v 1.6 2020/03/05 02:14:53 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -89,7 +89,6 @@
#ifndef _LOCORE
-typedef u_short tlbpid_t;
typedef struct tlb_s {
u_int tlb_hi;
u_int tlb_lo;
Home |
Main Index |
Thread Index |
Old Index