Skip to content

Commit 7c0a245

Browse files
pflnashif
authored andcommitted
arch: Rename reserved function names
Rename reserved function names in arch/ subdirectory. The Python script gen_priv_stacks.py was updated to follow the 'z_' prefix naming. Signed-off-by: Patrik Flykt <[email protected]>
1 parent 97b3bd1 commit 7c0a245

File tree

109 files changed

+556
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+556
-558
lines changed

arch/arc/core/fault.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ void _Fault(NANO_ESF *esf)
151151
}
152152
#endif
153153

154-
vector = _ARC_V2_ECR_VECTOR(ecr);
155-
code = _ARC_V2_ECR_CODE(ecr);
156-
parameter = _ARC_V2_ECR_PARAMETER(ecr);
154+
vector = Z_ARC_V2_ECR_VECTOR(ecr);
155+
code = Z_ARC_V2_ECR_CODE(ecr);
156+
parameter = Z_ARC_V2_ECR_PARAMETER(ecr);
157157

158158

159159
/* exception raised by kernel */

arch/arc/core/fault_s.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <syscall.h>
2020

2121
GTEXT(_Fault)
22-
GTEXT(_do_kernel_oops)
22+
GTEXT(z_do_kernel_oops)
2323
GTEXT(__reset)
2424
GTEXT(__memory_error)
2525
GTEXT(__instruction_error)
@@ -35,7 +35,7 @@ GTEXT(__ev_div_zero)
3535
GTEXT(__ev_dc_error)
3636
GTEXT(__ev_maligned)
3737
#ifdef CONFIG_IRQ_OFFLOAD
38-
GTEXT(_irq_do_offload);
38+
GTEXT(z_irq_do_offload);
3939
#endif
4040

4141
GDATA(exc_nest_count)
@@ -215,7 +215,7 @@ _do_non_syscall_trap:
215215
exc_nest_handle:
216216
push_s r0
217217

218-
jl _irq_do_offload
218+
jl z_irq_do_offload
219219

220220
pop sp
221221

arch/arc/core/irq_manage.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void z_arch_irq_enable(unsigned int irq)
4040
{
4141
unsigned int key = irq_lock();
4242

43-
_arc_v2_irq_unit_int_enable(irq);
43+
z_arc_v2_irq_unit_int_enable(irq);
4444
irq_unlock(key);
4545
}
4646

@@ -57,7 +57,7 @@ void z_arch_irq_disable(unsigned int irq)
5757
{
5858
unsigned int key = irq_lock();
5959

60-
_arc_v2_irq_unit_int_disable(irq);
60+
z_arc_v2_irq_unit_int_disable(irq);
6161
irq_unlock(key);
6262
}
6363

@@ -83,7 +83,7 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags)
8383

8484
__ASSERT(prio < CONFIG_NUM_IRQ_PRIO_LEVELS,
8585
"invalid priority %d for irq %d", prio, irq);
86-
_arc_v2_irq_unit_prio_set(irq, prio);
86+
z_arc_v2_irq_unit_prio_set(irq, prio);
8787
irq_unlock(key);
8888
}
8989

arch/arc/core/irq_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static irq_offload_routine_t offload_routine;
1515
static void *offload_param;
1616

1717
/* Called by trap_s exception handler */
18-
void _irq_do_offload(void)
18+
void z_irq_do_offload(void)
1919
{
2020
offload_routine(offload_param);
2121
}

arch/arc/core/mpu/arc_mpu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(mpu);
2121
* @brief Get the number of supported MPU regions
2222
*
2323
*/
24-
static inline u8_t _get_num_regions(void)
24+
static inline u8_t get_num_regions(void)
2525
{
2626
u32_t num = z_arc_v2_aux_reg_read(_ARC_V2_MPU_BUILD);
2727

@@ -34,7 +34,7 @@ static inline u8_t _get_num_regions(void)
3434
* This internal function is utilized by the MPU driver to parse the intent
3535
* type (i.e. THREAD_STACK_REGION) and return the correct parameter set.
3636
*/
37-
static inline u32_t _get_region_attr_by_type(u32_t type)
37+
static inline u32_t get_region_attr_by_type(u32_t type)
3838
{
3939
switch (type) {
4040
case THREAD_STACK_USER_REGION:
@@ -52,7 +52,6 @@ static inline u32_t _get_region_attr_by_type(u32_t type)
5252
}
5353
}
5454

55-
5655
#if CONFIG_ARC_MPU_VER == 2
5756
#include "arc_mpu_v2_internal.h"
5857
#elif CONFIG_ARC_MPU_VER == 3

arch/arc/core/mpu/arc_mpu_v2_internal.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static inline void _region_init(u32_t index, u32_t region_addr, u32_t size,
5757
* This internal function is utilized by the MPU driver to parse the intent
5858
* type (i.e. THREAD_STACK_REGION) and return the correct region index.
5959
*/
60-
static inline int _get_region_index_by_type(u32_t type)
60+
static inline int get_region_index_by_type(u32_t type)
6161
{
6262
/*
6363
* The new MPU regions are allocated per type after the statically
@@ -71,21 +71,21 @@ static inline int _get_region_index_by_type(u32_t type)
7171
*/
7272
switch (type) {
7373
case THREAD_STACK_USER_REGION:
74-
return _get_num_regions() - mpu_config.num_regions
74+
return get_num_regions() - mpu_config.num_regions
7575
- THREAD_STACK_REGION;
7676
case THREAD_STACK_REGION:
7777
case THREAD_APP_DATA_REGION:
7878
case THREAD_STACK_GUARD_REGION:
79-
return _get_num_regions() - mpu_config.num_regions - type;
79+
return get_num_regions() - mpu_config.num_regions - type;
8080
case THREAD_DOMAIN_PARTITION_REGION:
8181
#if defined(CONFIG_MPU_STACK_GUARD)
82-
return _get_num_regions() - mpu_config.num_regions - type;
82+
return get_num_regions() - mpu_config.num_regions - type;
8383
#else
8484
/*
8585
* Start domain partition region from stack guard region
8686
* since stack guard is not enabled.
8787
*/
88-
return _get_num_regions() - mpu_config.num_regions - type + 1;
88+
return get_num_regions() - mpu_config.num_regions - type + 1;
8989
#endif
9090
default:
9191
__ASSERT(0, "Unsupported type");
@@ -154,8 +154,8 @@ static inline bool _is_user_accessible_region(u32_t r_index, int write)
154154
*/
155155
static inline int _mpu_configure(u8_t type, u32_t base, u32_t size)
156156
{
157-
s32_t region_index = _get_region_index_by_type(type);
158-
u32_t region_attr = _get_region_attr_by_type(type);
157+
s32_t region_index = get_region_index_by_type(type);
158+
u32_t region_attr = get_region_attr_by_type(type);
159159

160160
LOG_DBG("Region info: 0x%x 0x%x", base, size);
161161

@@ -283,7 +283,7 @@ void arc_core_mpu_default(u32_t region_attr)
283283
int arc_core_mpu_region(u32_t index, u32_t base, u32_t size,
284284
u32_t region_attr)
285285
{
286-
if (index >= _get_num_regions()) {
286+
if (index >= get_num_regions()) {
287287
return -EINVAL;
288288
}
289289

@@ -304,7 +304,7 @@ int arc_core_mpu_region(u32_t index, u32_t base, u32_t size,
304304
void arc_core_mpu_configure_mem_domain(struct k_thread *thread)
305305
{
306306
int region_index =
307-
_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
307+
get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
308308
u32_t num_partitions;
309309
struct k_mem_partition *pparts;
310310
struct k_mem_domain *mem_domain = NULL;
@@ -348,7 +348,7 @@ void arc_core_mpu_remove_mem_domain(struct k_mem_domain *mem_domain)
348348
ARG_UNUSED(mem_domain);
349349

350350
int region_index =
351-
_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
351+
get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
352352

353353
for (; region_index >= 0; region_index--) {
354354
_region_init(region_index, 0, 0, 0);
@@ -367,7 +367,7 @@ void arc_core_mpu_remove_mem_partition(struct k_mem_domain *domain,
367367
ARG_UNUSED(domain);
368368

369369
int region_index =
370-
_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
370+
get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
371371

372372
LOG_DBG("disable region 0x%x", region_index + part_id);
373373
/* Disable region */
@@ -379,7 +379,7 @@ void arc_core_mpu_remove_mem_partition(struct k_mem_domain *domain,
379379
*/
380380
int arc_core_mpu_get_max_domain_partition_regions(void)
381381
{
382-
return _get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION) + 1;
382+
return get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION) + 1;
383383
}
384384

385385
/**
@@ -395,7 +395,7 @@ int arc_core_mpu_buffer_validate(void *addr, size_t size, int write)
395395
* matched region that grants permission or denies access.
396396
*
397397
*/
398-
for (r_index = 0; r_index < _get_num_regions(); r_index++) {
398+
for (r_index = 0; r_index < get_num_regions(); r_index++) {
399399
if (!_is_enabled_region(r_index) ||
400400
!_is_in_region(r_index, (u32_t)addr, size)) {
401401
continue;
@@ -426,7 +426,7 @@ static int arc_mpu_init(struct device *arg)
426426
u32_t num_regions;
427427
u32_t i;
428428

429-
num_regions = _get_num_regions();
429+
num_regions = get_num_regions();
430430

431431
/* ARC MPU supports up to 16 Regions */
432432
if (mpu_config.num_regions > num_regions) {

arch/arc/core/mpu/arc_mpu_v3_internal.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static inline int _mpu_probe(u32_t addr)
148148
*/
149149
static inline int _dynamic_region_allocate_index(void)
150150
{
151-
if (dynamic_region_index >= _get_num_regions()) {
151+
if (dynamic_region_index >= get_num_regions()) {
152152
LOG_ERR("no enough mpu entries %d", dynamic_region_index);
153153
return -EINVAL;
154154
}
@@ -314,7 +314,7 @@ static int _dynamic_region_allocate_and_init(u32_t base, u32_t size,
314314
static void _mpu_reset_dynamic_regions(void)
315315
{
316316
u32_t i;
317-
u32_t num_regions = _get_num_regions();
317+
u32_t num_regions = get_num_regions();
318318

319319
for (i = static_regions_num; i < num_regions; i++) {
320320
_region_init(i, 0, 0, 0);
@@ -341,7 +341,7 @@ static void _mpu_reset_dynamic_regions(void)
341341
*/
342342
static inline int _mpu_configure(u8_t type, u32_t base, u32_t size)
343343
{
344-
u32_t region_attr = _get_region_attr_by_type(type);
344+
u32_t region_attr = get_region_attr_by_type(type);
345345

346346
return _dynamic_region_allocate_and_init(base, size, region_attr);
347347
}
@@ -493,7 +493,7 @@ void arc_core_mpu_default(u32_t region_attr)
493493
int arc_core_mpu_region(u32_t index, u32_t base, u32_t size,
494494
u32_t region_attr)
495495
{
496-
if (index >= _get_num_regions()) {
496+
if (index >= get_num_regions()) {
497497
return -EINVAL;
498498
}
499499

@@ -576,7 +576,7 @@ void arc_core_mpu_remove_mem_partition(struct k_mem_domain *domain,
576576
int arc_core_mpu_get_max_domain_partition_regions(void)
577577
{
578578
/* consider the worst case: each partition requires split */
579-
return (_get_num_regions() - MPU_REGION_NUM_FOR_THREAD) / 2;
579+
return (get_num_regions() - MPU_REGION_NUM_FOR_THREAD) / 2;
580580
}
581581

582582
/**
@@ -619,7 +619,7 @@ static int arc_mpu_init(struct device *arg)
619619
u32_t num_regions;
620620
u32_t i;
621621

622-
num_regions = _get_num_regions();
622+
num_regions = get_num_regions();
623623

624624
/* ARC MPU supports up to 16 Regions */
625625
if (mpu_config.num_regions > num_regions) {

arch/arc/core/prep_c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ extern FUNC_NORETURN void z_cstart(void);
117117

118118
void _PrepC(void)
119119
{
120-
_icache_setup();
120+
z_icache_setup();
121121
adjust_vector_table_base();
122122
z_bss_zero();
123123
z_data_copy();

arch/arc/core/thread.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
141141
#endif
142142
}
143143

144-
_new_thread_init(thread, pStackMem, stackAdjSize, priority, options);
145-
144+
z_new_thread_init(thread, pStackMem, stackAdjSize, priority, options);
146145

147146
/* carve the thread entry struct from the "base" of
148147
the privileged stack */
@@ -152,9 +151,9 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
152151
/* fill init context */
153152
pInitCtx->status32 = 0U;
154153
if (options & K_USER) {
155-
pInitCtx->pc = ((u32_t)_user_thread_entry_wrapper);
154+
pInitCtx->pc = ((u32_t)z_user_thread_entry_wrapper);
156155
} else {
157-
pInitCtx->pc = ((u32_t)_thread_entry_wrapper);
156+
pInitCtx->pc = ((u32_t)z_thread_entry_wrapper);
158157
}
159158

160159
/*
@@ -168,7 +167,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
168167
#else /* For no USERSPACE feature */
169168
stackEnd = pStackMem + stackSize;
170169

171-
_new_thread_init(thread, pStackMem, stackSize, priority, options);
170+
z_new_thread_init(thread, pStackMem, stackSize, priority, options);
172171

173172
stackAdjEnd = stackEnd;
174173

@@ -177,7 +176,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
177176
sizeof(struct init_stack_frame));
178177

179178
pInitCtx->status32 = 0U;
180-
pInitCtx->pc = ((u32_t)_thread_entry_wrapper);
179+
pInitCtx->pc = ((u32_t)z_thread_entry_wrapper);
181180
#endif
182181

183182
#ifdef CONFIG_ARC_HAS_SECURE
@@ -270,7 +269,7 @@ FUNC_NORETURN void z_arch_user_mode_enter(k_thread_entry_t user_entry,
270269
/* need to lock cpu here ? */
271270
configure_mpu_thread(_current);
272271

273-
_arc_userspace_enter(user_entry, p1, p2, p3,
272+
z_arc_userspace_enter(user_entry, p1, p2, p3,
274273
(u32_t)_current->stack_obj,
275274
_current->stack_info.size);
276275
CODE_UNREACHABLE;

arch/arc/core/thread_entry_wrapper.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <toolchain.h>
1515
#include <linker/sections.h>
1616

17-
GTEXT(_thread_entry_wrapper)
17+
GTEXT(z_thread_entry_wrapper)
1818

1919
/*
2020
* @brief Wrapper for z_thread_entry
@@ -25,7 +25,7 @@ GTEXT(_thread_entry_wrapper)
2525
* @return N/A
2626
*/
2727

28-
SECTION_FUNC(TEXT, _thread_entry_wrapper)
28+
SECTION_FUNC(TEXT, z_thread_entry_wrapper)
2929

3030
pop_s r3
3131
pop_s r2

0 commit comments

Comments
 (0)