[PATCH 1/5] libmm score API
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Aug 26 15:22:52 UTC 2013
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
#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
--
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
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list