[PATCH 3/6] libmm-libbsp-shared. Files shared between all target BSPs and low-level implementations for libmm. These shared files contain mm.h which is a link between high-level score api and low-level implemenation of libmm. mm.h contains function declarations which should be implemented by target BSP to support libmm. no_memorymanagement.c contains stubs for BSPs that do not support libmm.

Gedare Bloom gedare at rtems.org
Thu Sep 12 18:06:35 UTC 2013


Actually you should not include the arm-cp15-start.h in the
shared/include/mm.h file because that would introduce a backwards
dependency. You could, however, include <bsp/mm.h> in arm-cp15-start.h
to get rid of some redundancy?

-Gedare

On Thu, Sep 12, 2013 at 2:00 PM, Hesham Moustafa
<heshamelmatary at gmail.com> wrote:
>
>
>
> On Thu, Sep 12, 2013 at 2:55 PM, Gedare Bloom <gedare at rtems.org> wrote:
>>
>> On Thu, Sep 12, 2013 at 2:59 AM, Hesham AL-Matary
>> <heshamelmatary at gmail.com> wrote:
>> > ---
>> >  c/src/lib/libbsp/shared/include/mm.h              | 36
>> > +++++++++++++++++++++++
>> >  c/src/lib/libbsp/shared/src/no_memorymanagement.c | 21 +++++++++++++
>> >  2 files changed, 57 insertions(+)
>> >  create mode 100644 c/src/lib/libbsp/shared/include/mm.h
>> >  create mode 100644 c/src/lib/libbsp/shared/src/no_memorymanagement.c
>> >
>> > diff --git a/c/src/lib/libbsp/shared/include/mm.h
>> > b/c/src/lib/libbsp/shared/include/mm.h
>> > new file mode 100644
>> > index 0000000..f2ac71c
>> > --- /dev/null
>> > +++ b/c/src/lib/libbsp/shared/include/mm.h
>> > @@ -0,0 +1,36 @@
>> > +/*
>> > + * Copyright (c) 2013 Gedare Bloom.
>> > + *
>> > + * The license and distribution terms for this file may be
>> > + * found in the file LICENSE in this distribution or at
>> > + * http://www.rtems.com/license/LICENSE.
>> > + */
>> > +
>> > +#ifndef __LIBBSP_MM_H
>> > +#define __LIBBSP_MM_H
>> > +
>> > +#include <stdint.h>
>> > +#include <stdlib.h>
>> > +
>> > +#ifdef __cplusplus
>> > +extern "C" {
>> > +#endif
>> > +
>> > +typedef struct {
>> > +  uint32_t begin;
>> > +  uint32_t end;
>> > +  uint32_t flags;
>> > +} mm_init_start_config;
>> Should begin/end be uintptr_t? This structure appears to be unused
>> here, so perhaps it should be left out?
>>
> I copied the struct definition from arm-cp15-start.h so that
> mm_config_table.c
> can include it and recognize such a type.
>  I can't include arm-cp15-start.h (which it has an exact definition)
> to mm_config_table.c because there will be a multiple-definition
> compilation error (as arm-cp15-start.h implements some routines) because
> mm.c also includes it.
>>
>> > +
>> > +void bsp_memory_management_initialize(void);
>> > +
>> > +void bsp_memory_management_set_attributes(
>> > +  uintptr_t base,
>> > +  size_t size,
>> > +  uint32_t attr
>> > +);
>> > +
>> > +#ifdef __cplusplus
>> > +}
>> > +#endif
>> > +#endif
>> > diff --git a/c/src/lib/libbsp/shared/src/no_memorymanagement.c
>> > b/c/src/lib/libbsp/shared/src/no_memorymanagement.c
>> > new file mode 100644
>> > index 0000000..1a5fc63
>> > --- /dev/null
>> > +++ b/c/src/lib/libbsp/shared/src/no_memorymanagement.c
>> > @@ -0,0 +1,21 @@
>> > +/*
>> > + * Copyright (c) 2013 Hesham AL-Matary
>> > + * Copyright (c) 2013 Gedare Bloom.
>> > + *
>> > + * The license and distribution terms for this file may be
>> > + * found in the file LICENSE in this distribution or at
>> > + * http://www.rtems.com/license/LICENSE.
>> > + */
>> > +
>> > +#include <rtems.h>
>> > +#include <libbsp/mm.h>
>> > +
>> > +void bsp_memory_management_initialize( void ) { }
>> > +
>> > +void bsp_memory_management_set_attributes(
>> > +  uintptr_t base,
>> > +  size_t size,
>> > +  uint32_t flags
>> > +)
>> > +{
>> > +}
>> > --
>> > 1.8.3.1
>> >
>> > _______________________________________________
>> > rtems-devel mailing list
>> > rtems-devel at rtems.org
>> > http://www.rtems.org/mailman/listinfo/rtems-devel
>
>



More information about the devel mailing list