diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 8 | ||||
-rw-r--r-- | sys/powerpc/aim/mmu_oea64.c | 7 | ||||
-rw-r--r-- | sys/powerpc/booke/pmap.c | 7 | ||||
-rw-r--r-- | sys/powerpc/include/mmuvar.h | 38 |
4 files changed, 34 insertions, 26 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 2ade00f..a31e072 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -379,12 +379,8 @@ static mmu_method_t moea_methods[] = { { 0, 0 } }; -static mmu_def_t oea_mmu = { - MMU_TYPE_OEA, - moea_methods, - 0 -}; -MMU_DEF(oea_mmu); +MMU_DEF(oea_mmu, MMU_TYPE_OEA, moea_methods, 0); + static void tlbie(vm_offset_t va) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index dc055a3..6328e57 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -474,12 +474,7 @@ static mmu_method_t moea64_methods[] = { { 0, 0 } }; -static mmu_def_t oea64_mmu = { - MMU_TYPE_G5, - moea64_methods, - 0 -}; -MMU_DEF(oea64_mmu); +MMU_DEF(oea64_mmu, MMU_TYPE_G5, moea64_methods, 0); static __inline u_int va_to_pteg(uint64_t vsid, vm_offset_t addr, int large) diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 7f2feb9..c5e285c 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -384,12 +384,7 @@ static mmu_method_t mmu_booke_methods[] = { { 0, 0 } }; -static mmu_def_t booke_mmu = { - MMU_TYPE_BOOKE, - mmu_booke_methods, - 0 -}; -MMU_DEF(booke_mmu); +MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); static inline void tlb_miss_lock(void) diff --git a/sys/powerpc/include/mmuvar.h b/sys/powerpc/include/mmuvar.h index 6e5a213..821a497 100644 --- a/sys/powerpc/include/mmuvar.h +++ b/sys/powerpc/include/mmuvar.h @@ -31,7 +31,8 @@ /* * A PowerPC MMU implementation is declared with a kernel object and - * an associated method table, similar to a device driver. + * an associated method table. The MMU_DEF macro is used to declare + * the class, and also links it to the global MMU class list. * * e.g. * @@ -44,13 +45,12 @@ * { 0, 0 } * }; * - * static mmu_def_t ppc8xx_mmu = { - * "ppc8xx", - * ppc8xx_methods, - * sizeof(ppc8xx_mmu_softc), // or 0 if no softc - * }; + * MMU_DEF(ppc8xx, MMU_TYPE_8xx, ppc8xx_methods, sizeof(ppc8xx_mmu_softc)); + * + * A single level of inheritance is supported in a similar fashion to + * kobj inheritance e.g. * - * MMU_DEF(ppc8xx_mmu); + * MMU_DEF_1(ppc860c, MMU_TYPE_860c, ppc860c_methods, 0, ppc8xx); */ #include <sys/kobj.h> @@ -84,7 +84,29 @@ typedef struct kobj_class mmu_def_t; #define MMUMETHOD KOBJMETHOD -#define MMU_DEF(name) DATA_SET(mmu_set, name) +#define MMU_DEF(name, ident, methods, size) \ + \ +mmu_def_t name = { \ + ident, methods, size, NULL \ +}; \ +DATA_SET(mmu_set, name) + +#define MMU_DEF_INHERIT(name, ident, methods, size, base1) \ + \ +static kobj_class_t name ## _baseclasses[] = \ + { &base1, NULL }; \ +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; \ +DATA_SET(mmu_set, name) + + +#if 0 +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; +DATA_SET(mmu_set, name) +#endif /* * Known MMU names |