change log for rtems (2011-05-18)
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Jun 7 15:26:34 UTC 2011
On 05/18/2011 07:12 AM, rtems-vc at rtems.org wrote:
> diff -u rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.9 rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.9.2.1
> --- rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c:1.9 Sun Nov 29 22:29:47 2009
> +++ rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c Wed May 18 00:08:35 2011
> @@ -70,8 +70,8 @@
> #include <sys/types.h>
> #include <unistd.h>
>
> -static uint32_t remaining_start=0;
> -static uint32_t remaining_size=0;
> +static void * remaining_start=(void*)-1LL;
> +static uintptr_t remaining_size=0;
>
> /* App. may provide a value by defining the BSP_sbrk_policy
> * variable.
> @@ -81,16 +81,17 @@
> * 0 -> limit memory effectively to 32M.
> *
> */
> -extern uint32_t BSP_sbrk_policy __attribute__((weak));
> +extern uintptr_t BSP_sbrk_policy __attribute__((weak));
>
> -#define LIMIT_32M 0x02000000
> +#define LIMIT_32M ((void*)0x02000000)
>
> -uintptr_t _bsp_sbrk_init(
> - uintptr_t heap_start,
> +uintptr_t bsp_sbrk_init(
> + void *heap_start,
> uintptr_t *heap_size_p
> )
> {
> uintptr_t rval=0;
> + uintptr_t policy;
>
> remaining_start = heap_start;
> remaining_size = *heap_size_p;
> @@ -104,30 +105,22 @@
> remaining_size = rval;
> }
>
> - if ( 0 != &BSP_sbrk_policy ) {
> - switch ( BSP_sbrk_policy ) {
> - case (uint32_t)(-1):
> + policy = (0 == &BSP_sbrk_policy ? (uintptr_t)(-1) : BSP_sbrk_policy);
> + switch ( policy ) {
> + case (uintptr_t)(-1):
> *heap_size_p += rval;
> remaining_start = heap_start + *heap_size_p;
> remaining_size = 0;
> - /* return a nonzero sbrk_amount because the libsupport code
> - * at some point divides by this number prior to trying an
> - * sbrk() which will fail.
> - */
> - rval = 1;
> break;
>
> case 0:
> remaining_size = 0;
> - /* see above for why we return 1 */
> - rval = 1;
> break;
>
> default:
> - if ( rval > BSP_sbrk_policy )
> - rval = BSP_sbrk_policy;
> + if ( rval > policy )
> + rval = policy;
> break;
> - }
> }
>
> return rval;
Something is wrong with this patch, please have a look at:
http://www.rtems.org/cvsweb/cvsweb.cgi/rtems/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c?annotate=1.11
The error is around line 124, a brace is to much.
--
Sebastian Huber, embedded brains GmbH
Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
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 vc
mailing list