summaryrefslogtreecommitdiff
path: root/sys/src/9/port/portdat.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-08-26 22:34:38 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-08-26 22:34:38 +0200
commit128ea44a89c7905612ad2fa5a61a9325ddfb5e1e (patch)
treec8d115acc86fb2e50e38af952741b725bd4366ae /sys/src/9/port/portdat.h
parent91a8d03040a3533e27f51d33bbbfed33d84b5043 (diff)
kernel: expose no execute bit to portable mmu code as SG_NOEXEC / PTENOEXEC, add PTECACHED bits
a portable SG_NOEXEC segment attribute was added to allow non-executable (physical) segments. which will set the PTENOEXEC bits for putmmu(). in the future, this can be used to make non-executable stack / bss segments. the SG_DEVICE attribute was added to distinguish between mmio regions and uncached memory. only matterns on arm64. on arm, theres the issue that PTEUNCACHED would have no bits set when using the hardware bit definitions. this is the reason bcm, kw, teg2 and omap kernels use arteficial PTE constants. on zynq, the XN bit was used as a hack to give PTEUNCACHED a non-zero value and when the bit is clear then cache attributes where added to the pte. to fix this, PTECACHED constant was added. the portable mmu code in fault.c will now explicitely set PTECACHED bits for cached memory and PTEUNCACHED for uncached memory. that way the hardware bit definitions can be used everywhere.
Diffstat (limited to 'sys/src/9/port/portdat.h')
-rw-r--r--sys/src/9/port/portdat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h
index 3f4ec4e75..bfa310db4 100644
--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -373,7 +373,9 @@ enum
SG_RONLY = 0040, /* Segment is read only */
SG_CEXEC = 0100, /* Detach at exec */
SG_FAULT = 0200, /* Fault on access */
- SG_CACHED = 0400,
+ SG_CACHED = 0400, /* Normal cached memory */
+ SG_DEVICE = 01000, /* Memory mapped device */
+ SG_NOEXEC = 02000, /* No execute */
};
#define PG_ONSWAP 1