Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[format] cleanup libcpu/aarch64 #8950

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ int dfs_tmpfs_stat(struct dfs_filesystem *fs,
if (d_file == NULL)
return -ENOENT;

st->st_dev = (rt_device_t)dfs_filesystem_lookup(fs->path);
st->st_dev = (dev_t)dfs_filesystem_lookup(fs->path);
st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH |
S_IWUSR | S_IWGRP | S_IWOTH;
if (d_file->type == TMPFS_TYPE_DIR)
Expand Down
10 changes: 5 additions & 5 deletions components/lwp/arch/aarch64/cortex-a/lwp_gcc.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#define __ASSEMBLY__
#endif

#include "rtconfig.h"
#include "asm-generic.h"
#include "asm-fpu.h"
#include "armv8.h"
#include "lwp_arch.h"
#include <rtconfig.h>
#include <asm-generic.h>
#include <asm-fpu.h>
#include <armv8.h>
#include <lwp_arch.h>

/*********************
* SPSR BIT *
Expand Down
4 changes: 3 additions & 1 deletion examples/utest/testcases/kernel/sched_sem_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#error the thread priority should at least be greater than idle
#endif

static rt_atomic_t _star_counter = 1;
static rt_atomic_t _star_counter;
static struct rt_semaphore _thr_exit_sem;
static struct rt_semaphore _level_waiting[TEST_LEVEL_COUNTS];
static rt_thread_t _thread_matrix[TEST_LEVEL_COUNTS][KERN_TEST_CONCURRENT_THREADS];
Expand Down Expand Up @@ -157,6 +157,8 @@ static void scheduler_tc(void)
static rt_err_t utest_tc_init(void)
{
LOG_I("Setup environment...");
_star_counter = 1;
rt_memset(_load_average, 0, sizeof(_load_average));
rt_sem_init(&_thr_exit_sem, "test", 0, RT_IPC_FLAG_PRIO);

for (size_t i = 0; i < TEST_LEVEL_COUNTS; i++)
Expand Down
4 changes: 3 additions & 1 deletion include/rtdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,10 @@ struct rt_cpu
struct rt_thread *current_thread;

rt_uint8_t irq_switch_flag:1;
rt_uint8_t critical_switch_flag:1;
rt_uint8_t sched_lock_flag:1;
#ifndef ARCH_USING_HW_THREAD_SELF
rt_uint8_t critical_switch_flag:1;
#endif /* ARCH_USING_HW_THREAD_SELF */

rt_uint8_t current_priority;
rt_list_t priority_table[RT_THREAD_PRIORITY_MAX];
Expand Down
1 change: 1 addition & 0 deletions include/rtsched.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct rt_sched_thread_ctx
rt_uint8_t stat; /**< thread status */
rt_uint8_t sched_flag_locked:1; /**< calling thread have the scheduler locked */
rt_uint8_t sched_flag_ttmr_set:1; /**< thread timer is start */
rt_uint8_t critical_switch_flag:1; /**< critical switch pending */

#ifdef RT_USING_SMP
rt_uint8_t bind_cpu; /**< thread is bind to cpu */
Expand Down
9 changes: 9 additions & 0 deletions libcpu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if ARCH_ARMV8 && ARCH_CPU_64BIT
config ARCH_HAVE_EFFICIENT_UNALIGNED_ACCESS
bool
default y
config ARCH_USING_GENERIC_CPUID
bool "Using generic cpuid implemenation"
select ARCH_USING_HW_THREAD_SELF
default y if RT_USING_OFW
default n
endmenu
endif

Expand Down Expand Up @@ -267,3 +272,7 @@ config ARCH_HOST_SIMULATOR
config ARCH_CPU_STACK_GROWS_UPWARD
bool
default n

config ARCH_USING_HW_THREAD_SELF
bool
default n
9 changes: 8 additions & 1 deletion libcpu/aarch64/common/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ Import('rtconfig')

cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp') + Glob('*.S')
CPPPATH = [cwd]
CPPPATH = [cwd, cwd + '/include']

if GetDepend('RT_USING_SMP'):
core_model = 'mp'
else:
core_model = 'up'

src += Glob(core_model + '/*.S')

if GetDepend('RT_USING_OFW') == False:
SrcRemove(src, ['setup.c', 'cpu_psci.c', 'psci.c'])
Expand Down
79 changes: 0 additions & 79 deletions libcpu/aarch64/common/asm-fpu.h

This file was deleted.