<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 14, 2020 at 1:13 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Utkarsh,<br>
<br>
if you look a the stuff you added to the score and compare it with <br>
something existing in the score, do you notice differences in the naming <br>
conventions and the code format? Have you looked at<br>
<br>
<a href="https://docs.rtems.org/branches/master/eng/coding.html" rel="noreferrer" target="_blank">https://docs.rtems.org/branches/master/eng/coding.html</a><br>
<br>
?<br></blockquote><div><br></div><div>Yes, sorry, I realize I need to do a better job with the coding standard and maintaining namespace consistency. I will rectify this.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On 13/07/2020 18:33, Utkarsh Rai wrote:<br>
> - This is the complete set of changes for strict isolation of thread stacks.<br>
> - There needs to be a confiuration operation,(#if defined(USE_THREAD_STACK_PROTECTION) for simple configuration can be used)<br>
> - The stack attributes are allocated through malloc, this needs to be done through score unlimited objects.<br>
> ---<br>
> bsps/arm/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a> | 1 +<br>
> .../include/bsp/arm-cp15-set-ttb-entries.h | 7 +<br>
> .../shared/cp15/arm-cp15-set-ttb-entries.c | 3 +<br>
> bsps/arm/xilinx-zynq/mmu/bsp-set-mmu-attr.c | 72 +++++++++<br>
> bsps/shared/start/stackalloc.c | 20 ++-<br>
> c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am | 5 +-<br>
> cpukit/Makefile.am | 1 +<br>
> cpukit/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a> | 2 +<br>
> cpukit/include/rtems/score/memorymanagement.h | 22 +++<br>
> cpukit/include/rtems/score/stackmanagement.h | 49 ++++++<br>
> cpukit/score/cpu/arm/cpu.c | 3 +<br>
> cpukit/score/cpu/arm/cpu_asm.S | 22 ++-<br>
> .../score/cpu/arm/include/rtems/score/cpu.h | 20 +++<br>
> cpukit/score/src/stackmanagement.c | 143 ++++++++++++++++++<br>
> 14 files changed, 365 insertions(+), 5 deletions(-)<br>
> create mode 100644 bsps/arm/include/bsp/arm-cp15-set-ttb-entries.h<br>
> create mode 100644 bsps/arm/xilinx-zynq/mmu/bsp-set-mmu-attr.c<br>
> create mode 100644 cpukit/include/rtems/score/memorymanagement.h<br>
> create mode 100644 cpukit/include/rtems/score/stackmanagement.h<br>
> create mode 100644 cpukit/score/src/stackmanagement.c<br>
><br>
> diff --git a/bsps/arm/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a> b/bsps/arm/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a><br>
> index 3d2b09effa..b1e86f3385 100644<br>
> --- a/bsps/arm/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a><br>
> +++ b/bsps/arm/<a href="http://headers.am" rel="noreferrer" target="_blank">headers.am</a><br>
> @@ -15,6 +15,7 @@ include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-a9mpcore-clock.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-a9mpcore-irq.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-a9mpcore-regs.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-a9mpcore-start.h<br>
> +include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-cp15-set-ttb-entries.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-cp15-start.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-errata.h<br>
> include_bsp_HEADERS += ../../../../../bsps/arm/include/bsp/arm-gic-irq.h<br>
> diff --git a/bsps/arm/include/bsp/arm-cp15-set-ttb-entries.h b/bsps/arm/include/bsp/arm-cp15-set-ttb-entries.h<br>
> new file mode 100644<br>
> index 0000000000..39170927da<br>
> --- /dev/null<br>
> +++ b/bsps/arm/include/bsp/arm-cp15-set-ttb-entries.h<br>
> @@ -0,0 +1,7 @@<br>
> +#include<bsp/arm-cp15-start.h><br>
> +<br>
> +uint32_t arm_cp15_set_translation_table_entries(<br>
> + const void *begin,<br>
> + const void *end,<br>
> + uint32_t section_flags<br>
> +);<br>
> \ No newline at end of file<br>
Why did you add this header file?<br></blockquote><div><br></div><div>It was not meant to be included in the patch, this has crept in while I was squashing the commits.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> diff --git a/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c b/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c<br>
> index 507277dca1..f5d0494167 100644<br>
> --- a/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c<br>
> +++ b/bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c<br>
> @@ -14,6 +14,7 @@<br>
> <br>
> #include <rtems.h><br>
> #include <libcpu/arm-cp15.h><br>
> +#include <bsp/arm-cp15-set-ttb-entries.h><br>
> #include <bspopts.h><br>
> <br>
> /*<br>
> @@ -30,6 +31,8 @@<br>
> * ARM DDI 0406C.b (ID072512)<br>
> */<br>
> <br>
> +#define ARM_MMU_USE_SMALL_PAGES<br>
> +<br>
<br>
This is the wrong place to define this define. This is supposed to be a <br>
BSP option.<br>
<br>
> static uint32_t set_translation_table_entries(<br>
> const void *begin,<br>
> const void *end,<br>
> diff --git a/bsps/arm/xilinx-zynq/mmu/bsp-set-mmu-attr.c b/bsps/arm/xilinx-zynq/mmu/bsp-set-mmu-attr.c<br>
> new file mode 100644<br>
> index 0000000000..978e35b86c<br>
> --- /dev/null<br>
> +++ b/bsps/arm/xilinx-zynq/mmu/bsp-set-mmu-attr.c<br>
> @@ -0,0 +1,72 @@<br>
> +#include <bsp/arm-cp15-start.h><br>
> +#include <bsp/arm-cp15-set-ttb-entries.h><br>
> +#include <rtems/score/memorymanagement.h><br>
> +#include <libcpu/arm-cp15.h><br>
> +#include <rtems.h><br>
> +<br>
> +#ifdef USE_THREAD_STACK_PROTECTION<br>
<br>
Who defines USE_THREAD_STACK_PROTECTION?<br>
<br></blockquote><div><br></div><div>I have not yet decided on how to configure thread-stack protection for an application. The ' #ifdef USE_THREAD_STACK_PROTECTION ' is a temporary hack that I have been using to compile the code related to thread-stack protection.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[...]<br>
<br>
</blockquote></div></div>