Module Name:    src
Committed By:   rin
Date:           Thu Mar  5 02:14:53 UTC 2020

Modified Files:
        src/sys/arch/powerpc/ibm4xx: pmap.c
        src/sys/arch/powerpc/include/ibm4xx: pmap.h tlb.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/ibm4xx/pmap.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/ibm4xx/tlb.h

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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.83 src/sys/arch/powerpc/ibm4xx/pmap.c:1.84
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.83	Thu Mar  5 01:35:00 2020
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Mar  5 02:14:52 2020
@@ -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 @@ void
 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;
 

Index: src/sys/arch/powerpc/include/ibm4xx/pmap.h
diff -u src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.19 src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.20
--- src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.19	Wed Jul 17 08:39:03 2019
+++ src/sys/arch/powerpc/include/ibm4xx/pmap.h	Thu Mar  5 02:14:53 2020
@@ -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. */

Index: src/sys/arch/powerpc/include/ibm4xx/tlb.h
diff -u src/sys/arch/powerpc/include/ibm4xx/tlb.h:1.5 src/sys/arch/powerpc/include/ibm4xx/tlb.h:1.6
--- src/sys/arch/powerpc/include/ibm4xx/tlb.h:1.5	Thu Apr 19 21:50:07 2018
+++ src/sys/arch/powerpc/include/ibm4xx/tlb.h	Thu Mar  5 02:14:53 2020
@@ -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;

Reply via email to