[PATCH] Add Xilinx MicroBlaze support (1 of 3)

Michael Eager eager@eagercon.com
Sat Sep 5 16:15:00 GMT 2009


Jeff Johnston wrote:
> Hi Michael,
> 
> A number of comments.
> 
> 1. setjmp and longjmp go in newlib
> 2. moddi3 should be in the compiler, not libgloss
> 3. why are you providing errno.c?
> 4. What is the XMK flag?  Everywhere else you are looking at 
> __MICROBLAZE__ or MICROBLAZE
> 5. write your own abort instead of touching the shared one
> 6. I can live with the refill.c change, but the test should be for a
>    single generic flag that is set in config.h for various platforms
> 7. All checks for MICROBLAZE should be __MICROBLAZE__ (including 
> ChangeLog comments)
> 8. I do not want special cases for platform in mallocr.c.  Is it really
> needed?  I believe the CYGWIN check there is historical due to the WIN32 
> stuff being in the code that was originally ported over and Cygwin not 
> wanting to use it.  I would like to remove that check as well and if 
> still needed, use a generic flag instead.
> 9. The Xilinx license is needed in COPYING.NEWLIB as well since you
>    have added Microblaze files there.

Updated patch attached.  I eliminated the changes to errno.c, refill.c,
mallocr.c, and some of the other changes.

XMK is a light-weight OS that Xilinx ships with its Embedded
Development Kit (EDK) for MicroBlaze.  It has a subset of POSIX APIs.
Other OS's are also supported; only XMK requires the conditional.


2009-09-05 Michael Eager <eager@eagercon.com>

* COPYING.LIBGLOSS: Add Microblaze to Xilinx copyright notice.
* COPYING.NEWLIB: Add Xilinx copyright notice for MicroBlaze.

Libgloss:
* configure.in: Add microblaze.
* configure: Regenerate.
* microblaze: NEW microblaze target directory.
* microblaze/configure.in: NEW.
* microblaze/configure: Generate.
* microblaze/Makefile.in: NEW.
* microblaze/{crt0.s,crt1.s,crt2.s,crt3.s,crt4.s,crtinit.s}: NEW.
* microblaze/{pgcrtinit.s,_program_clean.s,_program_init.s,sbrk.c,
sim-crtinit.s,sim-pgcrtinit.s,timer.c,_exception_handler.s,
_hw_exception_handler.s,_interrupt_handler.s,xil_malloc.c,xil_sbrk.c: NEW.
* microblaze/xilinx.ld: NEW.

Newlib:
* configure.host: Add microblaze.
* libc/include/machine/ieeefp.h [__MICROBLAZE__]: Define __IEEE_BIG_ENDIAN.
* libc/include/machine/setjmp.h [__MICROBLAZE__]: Define _JBLEN, _JBTYPE.
* libc/include/pthread.h [__XMK__]: XMK uses UNIX98_THREAD_MUTEX_ATTRIBUTES.
* libc/include/sys/config.h [__MICROBLAZE__]: Define _REENT_SMALL.
* libc/include/sys/types.h [_XMK__]: Treat XMK like rtems, define
PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE,
PTHREAD_MUTEX_DEFAULT, PTHREAD_STACK_MIN, define struct pthread_attr_s.
* libc/include/sys/unistd.h [__XMK__]: Don't declare _unlink.
* libc/machine/configure.in: Add microblaze.
* libc/machine/configure: Regenerate.
* libc/machine/microblaze/configure.in: NEW.
* libc/machine/microblaze/configure: Generate.
* libc/machine/microblaze/Makefile.am: NEW.
* libc/machine/microblaze/Makefile.in: Generate.
* libc/machine/microblaze/{abort.c,strcmp.c,strcpy.c,strlen.c,longjmp.S,
setjmp.S}: NEW.
* libc/stdlib/abort.c [__MICROBLAZE__]: Call exit instead of _exit.
* libc/stdlib/mallocr.c: mALLOc(): return malloc value.




-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newlib-1.patch.bz2
Type: application/x-bzip2
Size: 31439 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20090905/c6c429c1/attachment.bz2>


More information about the Newlib mailing list