core/nds32/task.c: Format with clang-format
BRANCH=none
TEST=none
@@ -44,9 +44,7 @@ CONFIG_TEST_TASK_LIST
/* Task names for easier debugging */
#define TASK(n, r, d, s) #n,
static const char *const task_names[] = {
- "<< idle >>",
- CONFIG_TASK_LIST
- CONFIG_TEST_TASK_LIST
+ "<< idle >>", CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST
};
#undef TASK
@@ -100,7 +98,8 @@ static void task_exit_trap(void)
}
/* Startup parameters for all tasks. */
-#define TASK(n, r, d, s) { \
+#define TASK(n, r, d, s) \
+ { \
.r0 = (uint32_t)d, \
.pc = (uint32_t)r, \
.stack_size = s, \
@@ -109,11 +108,8 @@ static const struct {
uint32_t r0;
uint32_t pc;
uint16_t stack_size;
-} tasks_init[] = {
- TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
- CONFIG_TASK_LIST
- CONFIG_TEST_TASK_LIST
-};
+} tasks_init[] = { TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
+ CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST };
#undef TASK
/* Contexts for all tasks */
@@ -122,20 +118,16 @@ static task_ tasks[TASK_ID_COUNT];
BUILD_ASSERT(TASK_ID_COUNT <= sizeof(unsigned) * 8);
BUILD_ASSERT(TASK_ID_COUNT < (1 << (sizeof(task_id_t) * 8)));
-
/* Stacks for all tasks */
#define TASK(n, r, d, s) +s
-uint8_t task_stacks[0
- TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
- CONFIG_TASK_LIST
- CONFIG_TEST_TASK_LIST
-] __aligned(8);
+uint8_t task_stacks[0 TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
+ CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST] __aligned(8);
#undef TASK
/* Reserve space to discard context on first context switch. */
-uint32_t scratchpad[TASK_SCRATCHPAD_SIZE] __attribute__
- ((section(".bss.task_scratchpad")));
+uint32_t scratchpad[TASK_SCRATCHPAD_SIZE]
+ __attribute__((section(".bss.task_scratchpad")));
task_ *current_task = (task_ *)scratchpad;
@@ -483,8 +475,7 @@ uint32_t __ram_code read_clear_int_mask(void)
{
uint32_t int_mask, int_dis = BIT(30);
- asm volatile(
- "mfsr %0, $INT_MASK\n\t"
+ asm volatile("mfsr %0, $INT_MASK\n\t"
"mtsr %1, $INT_MASK\n\t"
"dsb\n\t"
: "=&r"(int_mask)
@@ -715,9 +706,7 @@ static int command_task_info(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info,
- NULL,
- "Print task info");
+DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info");
static int command_task_ready(int argc, char **argv)
{
@@ -731,8 +720,7 @@ static int command_task_ready(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(taskready, command_task_ready,
- "[setmask]",
+DECLARE_CONSOLE_COMMAND(taskready, command_task_ready, "[setmask]",
"Print/set ready tasks");
void task_pre_init(void)
