On Mon, Jul 15, 2013 at 4:22 PM, Gedare Bloom <ged...@rtems.org> wrote:

> Are there compiler function attributes that can limit code generation
> when stubs are used?
>
> I searched for GCC functions attributes and found that there are some
function attributes that may be used for that purpose but not sure about
that. These attributes are :

cold :
The cold attribute on functions is used to inform the compiler that the
function is unlikely to be executed. The function is optimized for size
rather than speed and on many targets it is placed into special subsection
of the text section so all cold functions appears close together improving
code locality of non-cold parts of program.

optimize:
The optimize attribute is used to specify that a function is to be compiled
with different optimization options than specified on the command line.

unused :
This attribute, attached to a function, means that the function is meant to
be possibly unused. GCC does not produce a warning for this function.

 for more details check [1]
[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

On Sat, Jul 13, 2013 at 7:05 PM, Hesham AL-Matary
> <heshamelmat...@gmail.com> wrote:
> > From: Hesham ALmatary <heshamelmat...@gmail.com>
> >
> > ---
> >  c/src/lib/libcpu/shared/include/mm.h              | 23
> +++++++++++++++++++++++
> >  c/src/lib/libcpu/shared/src/no_memorymanagement.c | 17 +++++++++++++++++
> >  2 files changed, 40 insertions(+)
> >  create mode 100644 c/src/lib/libcpu/shared/include/mm.h
> >  create mode 100644 c/src/lib/libcpu/shared/src/no_memorymanagement.c
> >
> > diff --git a/c/src/lib/libcpu/shared/include/mm.h
> b/c/src/lib/libcpu/shared/include/mm.h
> > new file mode 100644
> > index 0000000..02903f1
> > --- /dev/null
> > +++ b/c/src/lib/libcpu/shared/include/mm.h
> > @@ -0,0 +1,23 @@
> > +/*
> > + * 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 __LIBCPU_MM_H
> > +#define __LIBCPU_MM_H
> > +
> > +#include <rtems/score/mm.h>
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +void _CPU_Memory_management_Initialize(void);
> > +
> > +#ifdef __cplusplus
> > +}
> > +#endif
> > +#endif
> > diff --git a/c/src/lib/libcpu/shared/src/no_memorymanagement.c
> b/c/src/lib/libcpu/shared/src/no_memorymanagement.c
> > new file mode 100644
> > index 0000000..2e3f528
> > --- /dev/null
> > +++ b/c/src/lib/libcpu/shared/src/no_memorymanagement.c
> > @@ -0,0 +1,17 @@
> > +/*
> > + * 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 <libcpu/mm.h>
> > +
> > +void _CPU_Memory_management_Initialize( void ) { }
> > +
> > +void _CPU_Memory_management_Install_entry( Memory_management_Entry
> *mpe, uint32_t flags ) { }
> > +
> > +void _CPU_Memory_management_Uninstall_entry( Memory_management_Entry
> *mpe ) { }
> > --
> > 1.8.3.1
> >
> > _______________________________________________
> > rtems-devel mailing list
> > rtems-devel@rtems.org
> > http://www.rtems.org/mailman/listinfo/rtems-devel
>
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to