summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-11-21 16:48:59 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-22 20:29:51 +0000
commitd4aa274081c99f3443886977f004721670cc3b35 (patch)
treef811de702a2d653530c072099f3f79b524939df0
parent4ba3538ac420d388a2fe81f70b8ad90a88a7eb74 (diff)
downloadchrome-ec-d4aa274081c99f3443886977f004721670cc3b35.tar.gz
core: Sort header files
Sort all headers in core with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j$(nproc) buildall_only runtests TEST=zmake compare-builds Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ie1dafb879dca3fcb9254025da8a70b5cd169481d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4047095 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
-rw-r--r--core/cortex-m/cpu.h3
-rw-r--r--core/cortex-m/llsr.c5
-rw-r--r--core/cortex-m/mpu.c2
-rw-r--r--core/cortex-m/panic.c2
-rw-r--r--core/cortex-m/vecttable.c1
-rw-r--r--core/cortex-m0/cpu.h3
-rw-r--r--core/cortex-m0/panic.c2
-rw-r--r--core/cortex-m0/vecttable.c6
-rw-r--r--core/host/host_task.h4
-rw-r--r--core/host/panic.c10
-rw-r--r--core/host/stack_trace.c9
-rw-r--r--core/host/task.c19
-rw-r--r--core/host/timer.c6
-rw-r--r--core/minute-ia/mpu.c2
-rw-r--r--core/minute-ia/task.c6
-rw-r--r--core/riscv-rv32i/panic.c2
16 files changed, 44 insertions, 38 deletions
diff --git a/core/cortex-m/cpu.h b/core/cortex-m/cpu.h
index 8c284d6132..4a36d63dda 100644
--- a/core/cortex-m/cpu.h
+++ b/core/cortex-m/cpu.h
@@ -8,10 +8,11 @@
#ifndef __CROS_EC_CPU_H
#define __CROS_EC_CPU_H
-#include <stdint.h>
#include "compile_time_macros.h"
#include "debug.h"
+#include <stdint.h>
+
/* Macro to access 32-bit registers */
#define CPUREG(addr) (*(volatile uint32_t *)(addr))
diff --git a/core/cortex-m/llsr.c b/core/cortex-m/llsr.c
index 0ab920f628..933382034b 100644
--- a/core/cortex-m/llsr.c
+++ b/core/cortex-m/llsr.c
@@ -5,10 +5,11 @@
/* Enable the use of right shift for uint64_t. */
-#include <console.h>
-#include <compile_time_macros.h>
#include <stdint.h>
+#include <compile_time_macros.h>
+#include <console.h>
+
union words {
uint64_t u64;
uint32_t w[2];
diff --git a/core/cortex-m/mpu.c b/core/cortex-m/mpu.c
index db03936dfa..953cbb7393 100644
--- a/core/cortex-m/mpu.c
+++ b/core/cortex-m/mpu.c
@@ -6,9 +6,9 @@
/* MPU module for Chrome EC */
#include "builtin/assert.h"
-#include "mpu.h"
#include "console.h"
#include "cpu.h"
+#include "mpu.h"
#include "registers.h"
#include "task.h"
#include "util.h"
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c
index 0f803dc8e5..1de8376cfb 100644
--- a/core/cortex-m/panic.c
+++ b/core/cortex-m/panic.c
@@ -7,8 +7,8 @@
#include "console.h"
#include "cpu.h"
#include "host_command.h"
-#include "panic.h"
#include "panic-internal.h"
+#include "panic.h"
#include "printf.h"
#include "system.h"
#include "task.h"
diff --git a/core/cortex-m/vecttable.c b/core/cortex-m/vecttable.c
index 037bc28c36..aea4bf3dc7 100644
--- a/core/cortex-m/vecttable.c
+++ b/core/cortex-m/vecttable.c
@@ -9,6 +9,7 @@
#define ___INIT
#include "compiler.h"
#include "config.h"
+
#include <task.h>
#endif
diff --git a/core/cortex-m0/cpu.h b/core/cortex-m0/cpu.h
index 568b16eedb..bdb7a3c6f5 100644
--- a/core/cortex-m0/cpu.h
+++ b/core/cortex-m0/cpu.h
@@ -8,10 +8,11 @@
#ifndef __CROS_EC_CPU_H
#define __CROS_EC_CPU_H
-#include <stdint.h>
#include "compile_time_macros.h"
#include "debug.h"
+#include <stdint.h>
+
/* Macro to access 32-bit registers */
#define CPUREG(addr) (*(volatile uint32_t *)(addr))
diff --git a/core/cortex-m0/panic.c b/core/cortex-m0/panic.c
index 3e4c1eb3be..533e45713d 100644
--- a/core/cortex-m0/panic.c
+++ b/core/cortex-m0/panic.c
@@ -7,8 +7,8 @@
#include "console.h"
#include "cpu.h"
#include "host_command.h"
-#include "panic.h"
#include "panic-internal.h"
+#include "panic.h"
#include "printf.h"
#include "system.h"
#include "task.h"
diff --git a/core/cortex-m0/vecttable.c b/core/cortex-m0/vecttable.c
index 7fd5c7fb8f..050a7d318a 100644
--- a/core/cortex-m0/vecttable.c
+++ b/core/cortex-m0/vecttable.c
@@ -7,13 +7,13 @@
#ifndef ___INIT
#define ___INIT
-#include <stddef.h>
-#include <stdint.h>
-
#include "compiler.h"
#include "config.h"
#include "panic-internal.h"
#include "task.h"
+
+#include <stddef.h>
+#include <stdint.h>
#endif /* __INIT */
typedef void (*func)(void);
diff --git a/core/host/host_task.h b/core/host/host_task.h
index 82b33f96c5..e79111f6f4 100644
--- a/core/host/host_task.h
+++ b/core/host/host_task.h
@@ -8,10 +8,10 @@
#ifndef __CROS_EC_HOST_TASK_H
#define __CROS_EC_HOST_TASK_H
-#include <pthread.h>
-
#include "task.h"
+#include <pthread.h>
+
/**
* Returns the thread corresponding to the task.
*/
diff --git a/core/host/panic.c b/core/host/panic.c
index e354757d75..0dd00ac604 100644
--- a/core/host/panic.c
+++ b/core/host/panic.c
@@ -3,16 +3,16 @@
* found in the LICENSE file.
*/
+#include "config.h"
+#include "panic.h"
+#include "stack_trace.h"
+
#include <assert.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdint.h>
#include <string.h>
-#include "config.h"
-#include "panic.h"
-#include "stack_trace.h"
-
void panic_assert_fail(const char *msg, const char *func, const char *fname,
int linenum)
{
diff --git a/core/host/stack_trace.c b/core/host/stack_trace.c
index 14d6abcab2..4f4ab380d9 100644
--- a/core/host/stack_trace.c
+++ b/core/host/stack_trace.c
@@ -3,14 +3,15 @@
* found in the LICENSE file.
*/
-#include <execinfo.h>
+#include "host_task.h"
+#include "host_test.h"
+#include "timer.h"
+
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include "host_task.h"
-#include "host_test.h"
-#include "timer.h"
+#include <execinfo.h>
#define SIGNAL_TRACE_DUMP SIGTERM
#define MAX_TRACE 30
diff --git a/core/host/task.c b/core/host/task.c
index 31ea386f2e..fa853dce60 100644
--- a/core/host/task.c
+++ b/core/host/task.c
@@ -5,15 +5,6 @@
/* Task scheduling / events module for Chrome EC operating system */
-#include <malloc.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "atomic.h"
#include "common.h"
#include "console.h"
@@ -23,6 +14,16 @@
#include "test_util.h"
#include "timer.h"
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <malloc.h>
+#include <pthread.h>
+#include <semaphore.h>
+
#define SIGNAL_INTERRUPT SIGUSR1
struct emu_task_t {
diff --git a/core/host/timer.c b/core/host/timer.c
index 66f047cd4d..b2c9c5c478 100644
--- a/core/host/timer.c
+++ b/core/host/timer.c
@@ -5,15 +5,15 @@
/* Timer module */
-#include <stdint.h>
-#include <stdio.h>
-
#include "builtin/assert.h"
#include "task.h"
#include "test_util.h"
#include "timer.h"
#include "util.h"
+#include <stdint.h>
+#include <stdio.h>
+
static timestamp_t boot_time;
static int time_set;
diff --git a/core/minute-ia/mpu.c b/core/minute-ia/mpu.c
index d91d71f99c..6cbf4c634f 100644
--- a/core/minute-ia/mpu.c
+++ b/core/minute-ia/mpu.c
@@ -5,8 +5,8 @@
/* MPU module for ISH */
-#include "mpu.h"
#include "console.h"
+#include "mpu.h"
#include "registers.h"
#include "task.h"
#include "util.h"
diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c
index b4b747baa0..540e387d2a 100644
--- a/core/minute-ia/task.c
+++ b/core/minute-ia/task.c
@@ -16,14 +16,14 @@
#include "builtin/assert.h"
#include "common.h"
#include "console.h"
+#include "hpet.h"
+#include "interrupts.h"
#include "link_defs.h"
#include "panic.h"
#include "task.h"
+#include "task_defs.h"
#include "timer.h"
#include "util.h"
-#include "task_defs.h"
-#include "interrupts.h"
-#include "hpet.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_SYSTEM, outstr)
diff --git a/core/riscv-rv32i/panic.c b/core/riscv-rv32i/panic.c
index 3ac34c7774..0ea86840f9 100644
--- a/core/riscv-rv32i/panic.c
+++ b/core/riscv-rv32i/panic.c
@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
-#include "cpu.h"
#include "console.h"
+#include "cpu.h"
#include "panic.h"
#include "task.h"
#include "util.h"