This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Hello, First of all, I'm not one of your customers. I use the gcc cross compiler with your newlib 1.8.1. May I suggest you the following correction to your module sbrk.c for the Hitachi H8/300(H) : --------------------------------------------------------------------- #include <_ansi.h> #include <sys/types.h> #include <sys/stat.h> register char *stack_ptr asm ("sp"); caddr_t _sbrk(incr) int incr; { extern char end; /* Defined by the linker */ static char *heap_end; char *prev_heap_end; if (heap_end == 0) { heap_end = &end; } /* Correction */ if((short)heap_end & 1) ++heap_end; /* This ensures that the allocated space always begins at an even address. We need this because it can contain any type of data and the processor can access words (and long words for 300H) ONLY ON EVEN addresses and since we can allocate an odd number of bytes ... !!! */ /* end of correction */ prev_heap_end = heap_end; if (heap_end + incr > stack_ptr) { _write (1, "Heap and stack collision\n", 25); abort (); } heap_end += incr; return (caddr_t)prev_heap_end; } --------------------------------------------------------------------- Best regards, Giovanni Caterina -------------------------------------------------------------------------- e-mail : Giova@idtech.be ___ ____ _ _ IDtech S.A. |_ _| _ \| |_ ___ ___| |__ 62, rue Saucin | || | | | __/ _ \/ __| '_ \ B-5032 Gembloux Tel : (32) 81/55.46.10 | || |_| | || __/ (__| | | | Belgium Fax : (32) 81/55.46.58 |___|____/ \__\___|\___|_| |_| Access Control, Time Attendance, Alarm Monitoring... info@idtech.be --------------------------------------------------------------------------