zephyr/kernel
Daniel Leung b6dd960be8 kernel: userspace: fix dynamic kernel object alignment
Previous commit 55350a93e9 fixing
address-of-packed-mem warnings uncovered an issue with
the alignment of dynamic kernel objects. On 64-bit platforms,
the alignment is 16 bytes instead of 4/8 bytes (as in pointer,
void *). This changes the function of mapping between kernel
object types and alignments to use the dynamic object struct
as basis for alignment instead of simply using pointers.

This also uncomments the assertion added in the previous commit
55350a93e9 so that we can keep
an eye on the alignment in the future. Note that the assertion
is moved after checking if the incoming kernel object is
dynamically allocated. Static kernel objects are not subjected
to this alignment requirement.

Fixes #41062

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-12-20 12:48:58 -05:00
..
include debug: gdbstub: remove start argument from z_gdb_main_loop() 2021-11-30 15:24:00 -05:00
paging kernel: mmu: z_backing_store* to k_mem_paging_backing_store* 2021-05-28 11:33:22 -04:00
atomic_c.c kernel: atomic: consistently use named type for atomic pointer values 2021-04-19 15:22:13 +02:00
banner.c
cache_handlers.c cache: Rename sys_{dcache,icache}_* to sys_{data,instr}_cache_* 2021-05-08 07:00:33 +02:00
CMakeLists.txt kernel: add support for event objects 2021-10-16 06:27:10 -04:00
compiler_stack_protect.c tests: coverage: exclude the CODE UNREACHABLE of code coverage 2021-01-15 12:42:00 -05:00
condvar.c Tracing: Conditional variable tracing 2021-05-07 22:10:21 -04:00
device.c device: supported devices visitor API 2021-11-23 12:17:14 +01:00
errno.c
events.c kernel: add support for event objects 2021-10-16 06:27:10 -04:00
fatal.c kernel: fatal: Avoid thread api access when no multithreading 2021-04-29 14:50:35 +02:00
futex.c futex: Avoid unnecessary lock 2021-07-30 20:21:04 -04:00
idle.c pm: idle: Remove not necessary branch 2021-11-29 19:37:55 -05:00
init.c kernel: init: remove empty lcov exclusion 2021-09-06 08:18:15 -04:00
Kconfig scripts: gen_handles.py: remove size restrictions 2021-11-16 10:41:59 +01:00
kheap.c kernel: kheap: make init work with demand paging 2021-08-26 21:16:22 -04:00
mailbox.c comments: minor typo fixes 2021-10-05 07:18:13 -04:00
main_weak.c kernel: extract __weak main() into independent file 2021-08-28 08:48:03 -04:00
mem_domain.c kernel: mem_domain: k_mem_domain_add_thread to return errors 2021-11-22 12:45:22 -05:00
mem_slab.c toolchain: migrate iterable sections calls to the external API 2021-08-12 17:47:04 -04:00
mempool.c Tracing: k_free tracing hook heap reference added 2021-11-16 09:45:01 -05:00
mmu.c kernel: mmu: Fix access to unpacked member inside packed struct 2021-12-10 14:08:59 +01:00
msg_q.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
mutex.c kernel: Fix negative mutex lock_count value 2021-07-06 19:19:41 -04:00
pipes.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
poll.c poll: modify the function z_vrfy_k_poll 2021-11-25 18:23:51 -05:00
queue.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
sched.c kernel: add 'static' keyword to select routines 2021-12-13 17:21:58 -05:00
sem.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
smp.c soc: intel_adsp/cavs_v25: Add CPU halt and relaunch APIs 2021-09-03 07:19:34 -04:00
stack.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
system_work_q.c kernel: remove old work queue implementation 2021-03-03 20:06:00 -05:00
thread.c kernel/sched: Separate idle from app thread stats in THREAD_USAGE 2021-11-08 21:32:20 -05:00
timeout.c kernel: fix several typos in a comment in timeout.c 2021-07-23 16:06:54 -04:00
timer.c kernel: timer: Call user handler without spinlock 2021-11-08 11:05:49 -05:00
userspace_handler.c
userspace.c kernel: userspace: fix dynamic kernel object alignment 2021-12-20 12:48:58 -05:00
version.c
work.c kernel: work: remove unused if statement 2021-12-13 17:20:56 -05:00
xip.c linker: align __itcm_load_start / __dtcm_data_load_start linker symbols 2021-08-28 08:48:03 -04:00