Thu Mar 5 02:14:53 2020 UTC ()
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.
(rin)
diff -r1.83 -r1.84 src/sys/arch/powerpc/ibm4xx/pmap.c
diff -r1.19 -r1.20 src/sys/arch/powerpc/include/ibm4xx/pmap.h
diff -r1.5 -r1.6 src/sys/arch/powerpc/include/ibm4xx/tlb.h
--- src/sys/arch/powerpc/ibm4xx/pmap.c 2020/03/05 01:35:00 1.83
+++ src/sys/arch/powerpc/ibm4xx/pmap.c 2020/03/05 02:14:52 1.84
@@ -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;
--- src/sys/arch/powerpc/include/ibm4xx/pmap.h 2019/07/17 08:39:03 1.19
+++ src/sys/arch/powerpc/include/ibm4xx/pmap.h 2020/03/05 02:14:53 1.20
@@ -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. */
--- src/sys/arch/powerpc/include/ibm4xx/tlb.h 2018/04/19 21:50:07 1.5
+++ src/sys/arch/powerpc/include/ibm4xx/tlb.h 2020/03/05 02:14:53 1.6
@@ -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;