[PATCH 1/5] libmm score API

Hesham Moustafa heshamelmatary at gmail.com
Mon Aug 26 18:15:29 UTC 2013


On Mon, Aug 26, 2013 at 5:22 PM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 2013-08-26 02:14, Hesham AL-Matary wrote:
>
>> +/**
>> + * @brief _Memory_management_Region Flags defs
>> + */
>> +#define RTEMS_MM_REGION_NO_PROTECTION           0x0
>> +#define RTEMS_MM_REGION_PROTECTION_**READ_ONLY    0x1
>> +#define RTEMS_MM_REGION_PROTECTION_**WRITE        0x2
>> +#define RTEMS_MM_REGION_NO_ACCESS               0x3
>> +//#define RTEMS_MM_REGION_PROTECTION_**EXEC   0x4
>>
>
> I prefer to actually have flags here and not a single integer value.
>
> So I would use this:
>
> #define RTEMS_MM_REGION_BIT_READ 0
> #define RTEMS_MM_REGION_BIT_WRITE 1
> #define RTEMS_MM_REGION_BIT_EXECUTE 2
> #define RTEMS_MM_REGION_BIT_CACHE 3
> #define RTEMS_MM_REGION_BIT_DEVICE 4
> #define RTEMS_MM_REGION_BIT_SHARED 5
>
> Some of these flags are not supported on some architectures like
RTEMS_MM_REGION_BIT_SHARED, or targets that do not have
Cache Unit. How should we handle some of these flags for such
targets that do not support these features in hardware ?

> #define RTEMS_MM_REGION_READ (1U << RTEMS_MM_REGION_BIT_WRITE)
> etc.
>
> This can be used to get architecture specific values easily:
>
> ((flags >> RTEMS_MM_REGION_BIT_READ) & 0x1U) << ARCH_READ_SHIFT
>
> That make sense.

> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> ______________________________**_________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/**listinfo/rtems-devel<http://www.rtems.org/mailman/listinfo/rtems-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130826/1f939b79/attachment-0001.html>


More information about the devel mailing list