haiku/headers/private/kernel
David Karoly 745a40d78a kernel/arm: implement memory attributes
Set AP[2:0] and XN flags based on page attributes.
PXN is not implemented as it seems to be available only
in L1 descriptors on ARMv7.

Set TEX, B, C flags based on memoryType:
* B_MTR_UC is mapped to Strongly Ordered (TEX=0, B=0, C=0)
* B_MTR_WC is mapped to Shareable Device Memory (TEX=0, B=1, C=0)
* B_MTR_WT is mapped to Outer and Inner Write-Through, no Write-Allocate (TEX=0, B=0, C=1)
* B_MTR_WB is mapped to Outer and Inner Write-Back, no Write-Allocate (TEx=0, B=1, C=1)
* B_MTR_WP has no direct equivalent on the ARM so it's mapped as B_MTR_WB
* default is Write-Back

Implement ARMPagingMethod32Bit::AttributesToPageTableEntryFlags()
for mapping from page attributes to AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::PageTableEntryFlagsToAttributes()
for the reverse mapping used in Query() and QueryInterrupt()
i.e. recover page attributes from AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::MemoryTypeToPageTableEntryFlags()
fr mapping from memoryType to TEX, B, C flags.

Implement ARMVMTranslationMap32Bit::Protect() which used to be commented out.

Accessed and modified flags are not implemented yet, so no such
flags are returned from Query() and QueryInterrupt().

Also because of this, we just invalidate TLB on any call to Protect()
without checking whether the page has been accessed.

Change-Id: I027af5c02bd6218d9f92a58044aeb26373e1956b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5236
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-04-23 12:52:59 +00:00
..
arch kernel/arm: implement memory attributes 2022-04-23 12:52:59 +00:00
boot boot/efi/arm: add debug logs for initial CPU state 2022-03-29 07:09:14 +00:00
disk_device_manager partitioning: pass along reference to parent when uninitializing. 2016-12-23 18:53:15 +13:00
fs KPath: Use an object_cache for the path buffers in the normal case. 2019-07-11 22:52:10 -04:00
platform efi: fix alignment for block device protocol 2022-01-04 17:56:41 +00:00
posix POSIX: introduce sem_clockwait 2022-02-18 21:27:06 +00:00
slab kernel: Whitespace cleanup only. 2020-06-13 23:24:27 +02:00
util kernel/util: Implement more features in the Bitmap class. 2022-03-30 20:17:50 +00:00
vm riscv64/smp: Implement multi-processor support 2021-12-12 15:35:24 +00:00
AllocationTracking.h
AreaKeeper.h AreaKeeper.h: move to headers/private/kernel 2020-03-23 16:38:01 +00:00
block_cache.h
boot_device.h
boot_item.h
boot_splash.h
commpage_compat.h kernel: add a compatibility commpage on x86_64. 2018-05-18 05:11:07 +00:00
commpage.h commpage: randomize position of commpage 2013-04-04 15:27:22 +02:00
condition_variable.h kernel/condition_variable: Remove a confusing requirement for published variables. 2022-03-09 18:55:55 -05:00
console.h
core_dump.h kernel: Add core dump facility 2016-04-24 18:22:14 +02:00
cpu.h cpu.h: Fix size of array element is not a multiple of its alignment 2021-05-11 15:56:06 +00:00
debug_heap.h
debug_hex_dump.h Add a hex dump utility for use in KDL commands 2013-11-25 12:45:36 +01:00
debug_paranoia.h
debug.h kernel/debug: Adjust range marker macros. 2021-08-31 22:00:36 -04:00
debugger_keymaps.h Make US-english the default KDL keymap again. 2016-10-10 07:18:12 +02:00
DPC.h kernel: DPC: remove schedulerLocked argument 2013-11-04 23:51:18 +01:00
elf_priv.h Revert team and thread changes for COMPAT_MODE (hrev52010 & hrev52011). 2018-06-14 22:25:06 -04:00
elf.h kernel: support elf32 on x86_64. 2018-05-15 10:29:00 +00:00
file_cache.h Clean up various whitespace and fix one header guard. 2015-08-02 23:19:07 +02:00
frame_buffer_console.h
generic_syscall.h
heap.h kernel: Remove malloc_referenced now that it is unused. 2022-02-09 16:42:06 -05:00
int.h x86[_64]: Support assigning MSI IRQs to arbitrary CPU 2013-12-20 01:07:08 +01:00
kdevice_manager.h
kdriver_settings.h
kernel_c++_structs.h
kernel_daemon.h
kernel.h kernel: Toggle not toogle; no functional change 2014-05-20 18:36:30 -05:00
kimage.h runtime loader: Register extended image info with kernel 2016-04-27 02:16:09 +02:00
kmodule.h
kscheduler.h kernel/scheduler: enable cpu load tracking after boot 2020-09-17 15:45:25 +00:00
ksignal.h _user_debug_thread(): Use new signal SIGNAL_DEBUG_THREAD 2016-04-24 11:54:17 +02:00
ksyscalls.h
ksystem_info.h kernel, libroot: Introduce new API for obtaining system info 2013-12-16 03:58:43 +01:00
listeners.h kernel: Remove gSchedulerLock 2013-11-08 02:41:26 +01:00
load_tracking.h kernel: Fix overflow in load tracking for very large deltas. 2018-01-05 22:48:56 +01:00
lock.h Cleanup: Various comment and whitespace fixes. 2020-08-01 19:23:27 +00:00
low_resource_manager.h
messaging.h
MessagingServiceDefs.h Remove remaining unnecessary 'volatile' qualifiers 2013-11-06 00:03:07 +01:00
Notifications.h Add missing includes following previous commit. 2021-09-01 13:10:04 -04:00
port.h Reduce lock contention in kernel port subsystem. 2013-10-26 16:10:03 +02:00
real_time_clock.h
safemode.h safemode.h: make it usable from C code. 2014-10-28 23:52:22 +01:00
scheduling_analysis.h Use B_PRId32. 2015-04-01 20:18:00 +02:00
sem.h
smp.h kernel/smp: Avoid casting spinlocks, which are structures. 2021-11-23 13:52:44 -05:00
stack_protector.h Implement stack protection support 2021-05-03 17:52:31 +00:00
syscall_restart.h kernel: Style fixup. 2021-08-27 19:02:20 -04:00
system_profiler.h kernel: profile system when SYSTEM_PROFILER is defined. 2015-07-22 20:39:52 +02:00
team.h kernel: Commit missing change to team.h. 2019-07-08 17:58:43 -04:00
thread_types.h kernel/vm: Completely replace mlock() implementation. 2022-03-30 20:17:50 +00:00
thread.h Assorted whitespace cleanup and typo fixes. 2015-08-20 21:54:41 +02:00
timer.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
tracing.h
user_atomic.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
user_debugger.h syscalls: Add get_stack_trace and lookup_symbol syscalls. 2015-04-10 16:00:49 +02:00
user_mutex.h Reimplement unnamed POSIX semaphores using user_mutex 2015-05-24 14:03:40 +01:00
UserEvent.h kernel: Fix missing reference release in CreateThreadEvent. 2014-11-01 16:32:04 +01:00
usergroup.h
UserTimer.h kernel: Workaround for double lock of spinlock in user timers. 2014-10-29 00:25:37 +01:00
vfs.h POSIX: introduce ppoll 2021-06-19 18:09:25 +00:00
wait_for_objects.h wait_for_objects: add macros for output-only select types 2018-02-26 10:43:54 +00:00