Commit bdc5f2c7 authored by Abramo Bagnara's avatar Abramo Bagnara Committed by Anas Nashif
Browse files

coding guidelines: comply with MISRA C:2012 Rule 8.3



In particular:

- use always the same parameter names in every redeclarations

Signed-off-by: default avatarAbramo Bagnara <abramo.bagnara@bugseng.com>
parent 29155bdd
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -42,18 +42,18 @@ void z_x86_spurious_irq(const z_arch_esf_t *esf)
}

__pinned_func
void arch_syscall_oops(void *ssf)
void arch_syscall_oops(void *ssf_ptr)
{
	struct _x86_syscall_stack_frame *ssf_ptr =
		(struct _x86_syscall_stack_frame *)ssf;
	struct _x86_syscall_stack_frame *ssf =
		(struct _x86_syscall_stack_frame *)ssf_ptr;
	z_arch_esf_t oops = {
		.eip = ssf_ptr->eip,
		.cs = ssf_ptr->cs,
		.eflags = ssf_ptr->eflags
		.eip = ssf->eip,
		.cs = ssf->cs,
		.eflags = ssf->eflags
	};

	if (oops.cs == USER_CODE_SEG) {
		oops.esp = ssf_ptr->esp;
		oops.esp = ssf->esp;
	}

	z_x86_fatal_error(K_ERR_KERNEL_OOPS, &oops);
+4 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);

unsigned char _irq_to_interrupt_vector[CONFIG_MAX_IRQ_LINES];
uint8_t _irq_to_interrupt_vector[CONFIG_MAX_IRQ_LINES];

/*
 * The low-level interrupt code consults these arrays to dispatch IRQs, so
@@ -101,8 +101,8 @@ void z_x86_irq_connect_on_vector(unsigned int irq,
 */

int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
			     void (*func)(const void *arg),
			     const void *arg, uint32_t flags)
			     void (*routine)(const void *parameter),
			     const void *parameter, uint32_t flags)
{
	uint32_t key;
	int vector;
@@ -113,7 +113,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,

	vector = z_x86_allocate_vector(priority, -1);
	if (vector >= 0) {
		z_x86_irq_connect_on_vector(irq, (uint8_t)vector, func, arg, flags);
		z_x86_irq_connect_on_vector(irq, (uint8_t)vector, routine, parameter, flags);
	}

	irq_unlock(key);
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ static ALWAYS_INLINE int sys_test_and_clear_bit(mem_addr_t addr,
 * at build time and defined via the linker script. On Intel64, it's an array.
 */

extern uint8_t _irq_to_interrupt_vector[];
extern uint8_t _irq_to_interrupt_vector[CONFIG_MAX_IRQ_LINES];

#define Z_IRQ_TO_INTERRUPT_VECTOR(irq) \
	(_irq_to_interrupt_vector[(irq)])
+8 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#if !defined(_ASMLANGUAGE)
#include <arch/cpu.h>
#include <sys/util.h>
#include <sys/arch_interface.h>

#ifdef __cplusplus
extern "C" {
@@ -114,8 +115,10 @@ static inline char *z_stack_ptr_align(char *ptr)
 * elsewhere into scope.
 *
 * @param sym Thread stack symbol name
 * @param size Thread stack size
 */
#define K_KERNEL_STACK_EXTERN(sym) extern k_thread_stack_t sym[]
#define K_KERNEL_STACK_EXTERN(sym, size) \
	extern k_thread_stack_t sym[Z_KERNEL_STACK_SIZE_ADJUST(size)]

/**
 * @addtogroup thread_stack_api
@@ -173,7 +176,7 @@ static inline char *z_stack_ptr_align(char *ptr)
 * @param lsect Linker section for this stack
 */
#define Z_KERNEL_STACK_DEFINE_IN(sym, size, lsect) \
	struct z_thread_stack_element lsect \
	k_thread_stack_t lsect \
		__aligned(Z_KERNEL_STACK_OBJ_ALIGN) \
		sym[Z_KERNEL_STACK_SIZE_ADJUST(size)]

@@ -402,8 +405,10 @@ static inline char *Z_KERNEL_STACK_BUFFER(k_thread_stack_t *sym)
 * elsewhere into scope.
 *
 * @param sym Thread stack symbol name
 * @param size Thread stack size
 */
#define K_THREAD_STACK_EXTERN(sym) extern k_thread_stack_t sym[]
#define K_THREAD_STACK_EXTERN(sym, size) \
	extern k_thread_stack_t sym[Z_THREAD_STACK_SIZE_ADJUST(size)]

/**
 * @brief Obtain an extern reference to a thread stack array
+2 −2
Original line number Diff line number Diff line
@@ -680,11 +680,11 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
 * we want the oops to appear to come from where the system call was invoked
 * and not inside the validation function.
 *
 * @param ssf System call stack frame pointer. This gets passed as an argument
 * @param ssf_ptr System call stack frame pointer. This gets passed as an argument
 *            to _k_syscall_handler_t functions and its contents are completely
 *            architecture specific.
 */
FUNC_NORETURN void arch_syscall_oops(void *ssf);
FUNC_NORETURN void arch_syscall_oops(void *ssf_ptr);

/**
 * @brief Safely take the length of a potentially bad string
Loading