mman: Reserve two PROT_ for CHERI use

In CheriBSD we use two bits to control load and store of CHERI
capabilities (pointers).  In anticipation of merging CHERI support in
time for FreeBSD 16, reserved these two bits to avoid the (low, but
non-zero) risk of a flag day downstream.

I've used PROT_CHERI0 and PROT_CHERI1 rather than their downstream name
in hopes of avoiding the impression they do something today.

Reviewed by:	kevans, adrian
Suggested by:	kevans, adrian
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D50621
This commit is contained in:
Brooks Davis 2025-06-06 00:55:35 +01:00
parent 8e35800732
commit 934df0ca61

View file

@ -53,6 +53,8 @@
#define PROT_WRITE 0x02 /* pages can be written */
#define PROT_EXEC 0x04 /* pages can be executed */
#if __BSD_VISIBLE
#define PROT_CHERI0 0x08
#define PROT_CHERI1 0x10
#define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC)
#define PROT_EXTRACT(prot) ((prot) & _PROT_ALL)