zephyr/include/logging
Katsuhiro Suzuki 76b3a50e7f logging: add padding for RISC-V 64bits environment
This patch add padding in filter structure of log system.
In RISCV && 64BIT environment. Log system is facing alignment bug.

struct log_source_dynamic_data {
	uint32_t filters;
};

static inline uint32_t *log_dynamic_filters_get(uint32_t source_id)
{
	return &__log_dynamic_start[source_id].filters;
}

A sizeof(log_source_dynamic_data) = 4, address offset of
&__log_dynamic_start[] are:
  - &__log_dynamic_start[0]: +0
  - &__log_dynamic_start[1]: +4
  - &__log_dynamic_start[2]: +8

But RISCV 64bit gcc/ld places each log_dynamic_log, log_dynamic_os
and log_dynamic_test per 8bytes alignment. So address offset of
log_dynamic_* are:
  - &log_dynamic_log : +0
  - &log_dynamic_os  : +8
  - &log_dynamic_test: +16

tests/subsys/logging/log_core cannot set correct log filters in
RISCV && 64BIT environment, so test is always going to fail.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2020-11-19 12:46:35 -05:00
..
log_backend_std.h logging: make log_backend_std header public 2020-10-21 10:21:05 -04:00
log_backend.h
log_core.h logging: fix if else if constructs missing final else 2020-10-07 23:05:18 -07:00
log_ctrl.h
log_frontend.h
log_instance.h logging: add padding for RISC-V 64bits environment 2020-11-19 12:46:35 -05:00
log_msg.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
log_output.h
log.h sys: util: Deprecate GET_ARG2 macro 2020-06-22 15:18:07 +02:00