Define _NPCM and the last PC_FREEn constant in terms of _NPCPV.

This applies one of the changes from
5567d6b441 to other architectures
besides arm64.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D36263
This commit is contained in:
John Baldwin 2022-08-23 13:31:02 -07:00
parent 9488262679
commit e663907366
10 changed files with 15 additions and 10 deletions

View File

@ -5085,7 +5085,7 @@ pv_to_chunk(pv_entry_t pv)
#define PC_FREE0 0xfffffffffffffffful
#define PC_FREE1 0xfffffffffffffffful
#define PC_FREE2 0x000000fffffffffful
#define PC_FREE2 ((1ul << (_NPCPV % 64)) - 1)
static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 };

View File

@ -439,8 +439,9 @@ typedef struct pv_entry {
* pv_entries are allocated in chunks per-process. This avoids the
* need to track per-pmap assignments.
*/
#define _NPCM 3
#define _NPCPV 168
#define _NPCM howmany(_NPCPV, 64)
#define PV_CHUNK_HEADER \
pmap_t pc_pmap; \
TAILQ_ENTRY(pv_chunk) pc_list; \

View File

@ -2753,7 +2753,7 @@ pv_to_chunk(pv_entry_t pv)
#define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap)
#define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */
#define PC_FREE10 0x0000fffful /* Free values for index 10 */
#define PC_FREE10 ((1ul << (_NPCPV % 32)) - 1) /* Free values for index 10 */
static const uint32_t pc_freemask[_NPCM] = {
PC_FREE0_9, PC_FREE0_9, PC_FREE0_9,

View File

@ -143,8 +143,9 @@ typedef struct pv_entry {
* pv_entries are allocated in chunks per-process. This avoids the
* need to track per-pmap assignments.
*/
#define _NPCM 11
#define _NPCPV 336
#define _NPCM howmany(_NPCPV, 32)
struct pv_chunk {
pmap_t pc_pmap;
TAILQ_ENTRY(pv_chunk) pc_list;

View File

@ -2301,7 +2301,7 @@ pv_to_chunk(pv_entry_t pv)
#define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap)
#define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */
#define PC_FREE10 0x0000fffful /* Free values for index 10 */
#define PC_FREE10 ((1ul << (_NPCPV % 32)) - 1) /* Free values for index 10 */
static const uint32_t pc_freemask[_NPCM] = {
PC_FREE0_9, PC_FREE0_9, PC_FREE0_9,

View File

@ -209,8 +209,9 @@ typedef struct pv_entry {
* pv_entries are allocated in chunks per-process. This avoids the
* need to track per-pmap assignments.
*/
#define _NPCM 11
#define _NPCPV 336
#define _NPCM howmany(_NPCPV, 32)
struct pv_chunk {
pmap_t pc_pmap;
TAILQ_ENTRY(pv_chunk) pc_list;

View File

@ -1169,7 +1169,7 @@ pv_to_chunk(pv_entry_t pv)
#define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap)
#define PC_FREE0 0xfffffffffffffffful
#define PC_FREE1 0x3ffffffffffffffful
#define PC_FREE1 ((1ul << (_NPCPV % 64)) - 1)
static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1 };

View File

@ -214,8 +214,9 @@ struct pmap {
* pv_entries are allocated in chunks per-process. This avoids the
* need to track per-pmap assignments.
*/
#define _NPCM 2
#define _NPCPV 126
#define _NPCM howmany(_NPCPV, 64)
#define PV_CHUNK_HEADER \
pmap_t pc_pmap; \
TAILQ_ENTRY(pv_chunk) pc_list; \

View File

@ -97,8 +97,9 @@ typedef struct pv_entry {
* pv_entries are allocated in chunks per-process. This avoids the
* need to track per-pmap assignments.
*/
#define _NPCM 3
#define _NPCPV 168
#define _NPCM howmany(_NPCPV, 64)
struct pv_chunk {
struct pmap * pc_pmap;
TAILQ_ENTRY(pv_chunk) pc_list;

View File

@ -1727,7 +1727,7 @@ pv_to_chunk(pv_entry_t pv)
#define PC_FREE0 0xfffffffffffffffful
#define PC_FREE1 0xfffffffffffffffful
#define PC_FREE2 0x000000fffffffffful
#define PC_FREE2 ((1ul << (_NPCPV % 64)) - 1)
static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 };