Commit 5f349a4d authored by Wayne Ren's avatar Wayne Ren Committed by Anas Nashif
Browse files

arch: arc: fix the comments and coding style



Signed-off-by: default avatarWayne Ren <wei.ren@synopsys.com>
parent cdfb59a2
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ static inline u32_t _get_region_attr_by_type(u32_t type, u32_t size)
	/* no Write and Execute to guard region */
#if CONFIG_ARC_MPU_VER == 2
		u8_t bits = find_msb_set(size) + 1;

		return  AUX_MPU_RDP_REGION_SIZE(bits) |
			AUX_MPU_RDP_UR | AUX_MPU_RDP_KR;
#elif CONFIG_ARC_MPU_VER == 3
@@ -87,7 +88,7 @@ static inline u32_t _get_region_attr_by_type(u32_t type, u32_t size)
static inline void _region_init(u32_t index, u32_t region_addr, u32_t size,
			 u32_t region_attr)
{
/* ARC MPU version 2 and verison 3 have different aux reg interface */
/* ARC MPU version 2 and version 3 have different aux reg interface */
#if CONFIG_ARC_MPU_VER == 2
	u8_t bits = find_msb_set(size) + 1;
	index = 2 * index;
@@ -126,6 +127,7 @@ static inline void _region_init(u32_t index, u32_t region_addr, u32_t size,
static inline s32_t _mpu_probe(u32_t addr)
{
	u32_t val;

	_arc_v2_aux_reg_write(_ARC_V2_MPU_PROBE, addr);
	val = _arc_v2_aux_reg_read(_ARC_V2_MPU_INDEX);

@@ -215,7 +217,7 @@ void arc_core_mpu_configure(u8_t type, u32_t base, u32_t size)

	_region_init(region_index, base, size, region_attr);
#elif CONFIG_ARC_MPU_VER == 3
	static s32_t last_index = 0;
	static s32_t last_index;
	s32_t index;
	u32_t last_region = _get_num_regions() - 1;

@@ -237,8 +239,8 @@ void arc_core_mpu_configure(u8_t type, u32_t base, u32_t size)
	 */
	index = _mpu_probe(base);

	/* ARC MPU version doesnot support region overlap.
	 * So it can not be directly used for stack/stack guard prtocet.
	/* ARC MPU version doesn't support region overlap.
	 * So it can not be directly used for stack/stack guard protect
	 * One way to do this is splitting the ram region as follow:
	 *
	 *  Take THREAD_STACK_GUARD_REGION as example:
@@ -251,7 +253,7 @@ void arc_core_mpu_configure(u8_t type, u32_t base, u32_t size)
	if (index >= 0) {  /* need to split, only 1 split is allowed */
		/* find the correct region to mpu_config.mpu_regions */
		if (index == last_region) {
			/* already splitted */
			/* already split */
			index = last_index;
		} else {
			/* new split */
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ _return_from_exc:
	sr ilink, [_ARC_V2_ERET]

	/* put status32 into estatus */
	ld ilink, [sp, ___isf_t_status32_OFFSET - ___isf_t_pc_OFFSET] /* status32 into ilink */
	ld ilink, [sp, ___isf_t_status32_OFFSET - ___isf_t_pc_OFFSET]
	sr ilink, [_ARC_V2_ERSTATUS]
	add_s sp, sp, ___isf_t_status32_OFFSET - ___isf_t_pc_OFFSET + 4
	rtie
+3 −1
Original line number Diff line number Diff line
@@ -64,9 +64,11 @@ void arc_core_mpu_default(u32_t region_attr);
 *
 * @param   index   MPU region index
 * @param   base    base address
 * @param   size    size of region
 * @param   region_attr region attribute
 */
void arc_core_mpu_region(u32_t index, u32_t base, u32_t size, u32_t region_attr);
void arc_core_mpu_region(u32_t index, u32_t base, u32_t size,
			 u32_t region_attr);

/**
 * @brief configure the base address and size for an MPU region
+2 −2

File changed.

Contains only whitespace changes.