diff options
author | Takuya ASADA <syuu@cvs.openbsd.org> | 2010-01-05 06:44:59 +0000 |
---|---|---|
committer | Takuya ASADA <syuu@cvs.openbsd.org> | 2010-01-05 06:44:59 +0000 |
commit | 477076752b7770cea6c16096132b1fb23d952479 (patch) | |
tree | 68fac107bdb39e7f98098cd383d3948816f557a8 /sys/arch/mips64/include/pmap.h | |
parent | 772e89cb237b0c3daf3b850ea024b5e608242a8e (diff) |
Dynamic allocation for ASID and ASID generation number on struct pmap. ok miod@
Diffstat (limited to 'sys/arch/mips64/include/pmap.h')
-rw-r--r-- | sys/arch/mips64/include/pmap.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/arch/mips64/include/pmap.h b/sys/arch/mips64/include/pmap.h index f1778730471..93cf0a690a9 100644 --- a/sys/arch/mips64/include/pmap.h +++ b/sys/arch/mips64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.18 2009/12/30 01:17:59 syuu Exp $ */ +/* $OpenBSD: pmap.h,v 1.19 2010/01/05 06:44:58 syuu Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -91,6 +91,11 @@ struct segtab { pt_entry_t *seg_tab[PMAP_SEGTABSIZE]; }; +struct pmap_asid_info { + u_int pma_asid; /* address space tag */ + u_int pma_asidgen; /* TLB PID generation number */ +}; + /* * Machine dependent pmap structure. */ @@ -98,11 +103,18 @@ typedef struct pmap { int pm_count; /* pmap reference count */ simple_lock_data_t pm_lock; /* lock on pmap */ struct pmap_statistics pm_stats; /* pmap statistics */ - u_int pm_tlbpid[MAXCPUS]; /* address space tag */ - u_int pm_tlbgen[MAXCPUS]; /* TLB PID generation number */ struct segtab *pm_segtab; /* pointers to pages of PTEs */ + struct pmap_asid_info pm_asid[1]; /* ASID information */ } *pmap_t; +/* + * Compute the sizeof of a pmap structure. Subtract one because one + * ASID info structure is already included in the pmap structure itself. + */ +#define PMAP_SIZEOF(x) \ + (ALIGN(sizeof(struct pmap) + \ + (sizeof(struct pmap_asid_info) * ((x) - 1)))) + /* flags for pv_entry */ #define PV_UNCACHED PG_PMAP0 /* Page is mapped unchached */ @@ -111,11 +123,11 @@ typedef struct pmap { #define PV_ATTR_REF PG_PMAP3 #define PV_PRESERVE (PV_ATTR_MOD | PV_ATTR_REF) -extern struct pmap kernel_pmap_store; +extern struct pmap *const kernel_pmap_ptr; #define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) #define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count) -#define pmap_kernel() (&kernel_pmap_store) +#define pmap_kernel() (kernel_pmap_ptr) #define pmap_phys_address(ppn) ptoa(ppn) #define PMAP_STEAL_MEMORY /* Enable 'stealing' during boot */ |