From dde0daca063cf6eedc6642a7610418fcfa6c12a1 Mon Sep 17 00:00:00 2001 From: matt Date: Sat, 23 Jun 2001 03:16:11 +0000 Subject: [PATCH] Use __asm __volatile. Use _POWERPC_SPR_H_ Add PTE_RO/PTE_RW for old pmap. --- sys/arch/powerpc/include/mpc6xx/pte.h | 4 +++- sys/arch/powerpc/include/spr.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/arch/powerpc/include/mpc6xx/pte.h b/sys/arch/powerpc/include/mpc6xx/pte.h index 927685a86aac..60c3d4f832a6 100644 --- a/sys/arch/powerpc/include/mpc6xx/pte.h +++ b/sys/arch/powerpc/include/mpc6xx/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.4 2001/06/21 18:03:37 matt Exp $ */ +/* $NetBSD: pte.h,v 1.5 2001/06/23 03:16:12 matt Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -65,6 +65,8 @@ struct pte { #define PTE_SW 0x00000001 /* Super. Write-Only (U: RO, S: RW) */ #define PTE_BW 0x00000002 /* Supervisor (U: RW, S: RW) */ #define PTE_BR 0x00000003 /* Both Read Only (U: RO, S: RO) */ +#define PTE_RW PTE_BW +#define PTE_RO PTE_BR #ifndef _LOCORE typedef struct pte pte_t; diff --git a/sys/arch/powerpc/include/spr.h b/sys/arch/powerpc/include/spr.h index 356b16f496e3..dae94364fdd9 100644 --- a/sys/arch/powerpc/include/spr.h +++ b/sys/arch/powerpc/include/spr.h @@ -1,12 +1,12 @@ -#ifndef _SPR_H_ -#define _SPR_H_ +#ifndef _POWERPC_SPR_H_ +#define _POWERPC_SPR_H_ #ifndef _LOCORE -#define mtspr(reg, val) \ - asm volatile("mtspr %0,%1" : : "K"(reg), "r"(val)) -#define mfspr(reg) \ - ( { u_int32_t val; \ - asm volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \ +#define mtspr(reg, val) \ + __asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val)) +#define mfspr(reg) \ + ( { u_int32_t val; \ + __asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \ val; } ) #endif /* _LOCORE */ @@ -170,4 +170,4 @@ #define TBR_TBL 0x10c /* 468 Time Base Lower */ #define TBR_TBU 0x10d /* 468 Time Base Upper */ -#endif /* !_SPR_H_ */ +#endif /* !_POWERPC_SPR_H_ */