kernel: Remove duplicated identifier

There was an struct and a variable called _kernel. This is error prone
and a MISRA-C violation. It is changing the struct to have a unique
identifier.

MISRA-C rule 5.8

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-01 17:50:02 -07:00 committed by Anas Nashif
commit a406b88fca
5 changed files with 9 additions and 9 deletions

View file

@ -46,7 +46,7 @@ GEN_OFFSET_SYM(_ready_q_t, cache);
GEN_OFFSET_SYM(_kernel_t, current_fp); GEN_OFFSET_SYM(_kernel_t, current_fp);
#endif #endif
GEN_ABSOLUTE_SYM(_STRUCT_KERNEL_SIZE, sizeof(struct _kernel)); GEN_ABSOLUTE_SYM(_STRUCT_KERNEL_SIZE, sizeof(struct z_kernel));
GEN_OFFSET_SYM(_thread_base_t, user_options); GEN_OFFSET_SYM(_thread_base_t, user_options);
GEN_OFFSET_SYM(_thread_base_t, thread_state); GEN_OFFSET_SYM(_thread_base_t, thread_state);

View file

@ -111,7 +111,7 @@ struct _cpu {
typedef struct _cpu _cpu_t; typedef struct _cpu _cpu_t;
struct _kernel { struct z_kernel {
/* For compatibility with pre-SMP code, union the first CPU /* For compatibility with pre-SMP code, union the first CPU
* record with the legacy fields so code can continue to use * record with the legacy fields so code can continue to use
* the "_kernel.XXX" expressions and assembly offsets. * the "_kernel.XXX" expressions and assembly offsets.
@ -169,9 +169,9 @@ struct _kernel {
struct _kernel_arch arch; struct _kernel_arch arch;
}; };
typedef struct _kernel _kernel_t; typedef struct z_kernel _kernel_t;
extern struct _kernel _kernel; extern struct z_kernel _kernel;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define _current_cpu (_arch_curr_cpu()) #define _current_cpu (_arch_curr_cpu())

View file

@ -37,8 +37,8 @@
#define _priq_wait_best _priq_dumb_best #define _priq_wait_best _priq_dumb_best
#endif #endif
/* the only struct _kernel instance */ /* the only struct z_kernel instance */
struct _kernel _kernel; struct z_kernel _kernel;
static struct k_spinlock sched_lock; static struct k_spinlock sched_lock;

View file

@ -34,8 +34,8 @@ __attribute__((used, section(".openocd_dbg")))
size_t _kernel_openocd_offsets[] = { size_t _kernel_openocd_offsets[] = {
/* Version 0 starts */ /* Version 0 starts */
[OPENOCD_OFFSET_VERSION] = 1, [OPENOCD_OFFSET_VERSION] = 1,
[OPENOCD_OFFSET_K_CURR_THREAD] = offsetof(struct _kernel, current), [OPENOCD_OFFSET_K_CURR_THREAD] = offsetof(struct z_kernel, current),
[OPENOCD_OFFSET_K_THREADS] = offsetof(struct _kernel, threads), [OPENOCD_OFFSET_K_THREADS] = offsetof(struct z_kernel, threads),
[OPENOCD_OFFSET_T_ENTRY] = offsetof(struct k_thread, entry), [OPENOCD_OFFSET_T_ENTRY] = offsetof(struct k_thread, entry),
[OPENOCD_OFFSET_T_NEXT_THREAD] = offsetof(struct k_thread, next_thread), [OPENOCD_OFFSET_T_NEXT_THREAD] = offsetof(struct k_thread, next_thread),
[OPENOCD_OFFSET_T_STATE] = offsetof(struct _thread_base, thread_state), [OPENOCD_OFFSET_T_STATE] = offsetof(struct _thread_base, thread_state),

View file

@ -29,7 +29,7 @@ struct test_struct __kernel_bss kernel_bss;
struct test_struct __kernel_noinit kernel_noinit; struct test_struct __kernel_noinit kernel_noinit;
/* Real kernel variable, check it is in the right place */ /* Real kernel variable, check it is in the right place */
extern struct _kernel _kernel; extern struct z_kernel _kernel;
struct test_struct app_data = {3, 4, NULL}; struct test_struct app_data = {3, 4, NULL};
struct test_struct app_bss; struct test_struct app_bss;