<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 8:21 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Aug 26, 2013 at 2:15 PM, Hesham Moustafa<br>
<<a href="mailto:heshamelmatary@gmail.com">heshamelmatary@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Aug 26, 2013 at 5:22 PM, Sebastian Huber<br>
> <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br>
>><br>
>> On 2013-08-26 02:14, Hesham AL-Matary wrote:<br>
>>><br>
>>> +/**<br>
>>> + * @brief _Memory_management_Region Flags defs<br>
>>> + */<br>
>>> +#define RTEMS_MM_REGION_NO_PROTECTION 0x0<br>
>>> +#define RTEMS_MM_REGION_PROTECTION_READ_ONLY 0x1<br>
>>> +#define RTEMS_MM_REGION_PROTECTION_WRITE 0x2<br>
>>> +#define RTEMS_MM_REGION_NO_ACCESS 0x3<br>
>>> +//#define RTEMS_MM_REGION_PROTECTION_EXEC 0x4<br>
>><br>
>><br>
>> I prefer to actually have flags here and not a single integer value.<br>
>><br>
>> So I would use this:<br>
>><br>
>> #define RTEMS_MM_REGION_BIT_READ 0<br>
>> #define RTEMS_MM_REGION_BIT_WRITE 1<br>
>> #define RTEMS_MM_REGION_BIT_EXECUTE 2<br>
>> #define RTEMS_MM_REGION_BIT_CACHE 3<br>
>> #define RTEMS_MM_REGION_BIT_DEVICE 4<br>
>> #define RTEMS_MM_REGION_BIT_SHARED 5<br>
>><br>
> Some of these flags are not supported on some architectures like<br>
> RTEMS_MM_REGION_BIT_SHARED, or targets that do not have<br>
> Cache Unit. How should we handle some of these flags for such<br>
> targets that do not support these features in hardware ?<br>
</div></div>I would think the BSP will have to handle / ignore the attributes that<br>
do not make sense for it?<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div>I think of that solution too. But the developer may expect to apply this </div><div>attribute and wonder why it does not work as expected. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
>><br>
>> #define RTEMS_MM_REGION_READ (1U << RTEMS_MM_REGION_BIT_WRITE)<br>
>> etc.<br>
>><br>
>> This can be used to get architecture specific values easily:<br>
>><br>
>> ((flags >> RTEMS_MM_REGION_BIT_READ) & 0x1U) << ARCH_READ_SHIFT<br>
>><br>
> That make sense.<br>
>><br>
>> --<br>
>> Sebastian Huber, embedded brains GmbH<br>
>><br>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
>> Phone : +49 89 189 47 41-16<br>
>> Fax : +49 89 189 47 41-09<br>
>> E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a><br>
>> PGP : Public key available on request.<br>
>><br>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
>><br>
>> _______________________________________________<br>
>> rtems-devel mailing list<br>
>> <a href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a><br>
>> <a href="http://www.rtems.org/mailman/listinfo/rtems-devel" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> rtems-devel mailing list<br>
> <a href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a><br>
> <a href="http://www.rtems.org/mailman/listinfo/rtems-devel" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
><br>
</div></div></blockquote></div><br></div></div>