From 93180ea26a1c8a991602b7243e1e68e7f510e381 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 9 Jul 1999 17:16:10 +0000 Subject: Patch from Eric Valette : - The same bug fix that was done on pc386 to prevent interrupt from occuring (never experienced it but who knows as I have 8259 emulation :() - Removed every compiler warning (except wrong ones and ones I can't do anything). - Removed any libc available code in code linked with mcp750 rtems executbale. Unfortunately using newlib functions for linking the bootloader does not work as the compilation options in bootloader (-mrelocatable -fixed-r13) are not compatible with newlib options. => I have put any libc external reference in one single new file (lib.c) that is linked only with the boot loader. Removing the file from ${OBJ} and using -lc crash the bootloader. Added big warning... --- .../motorola_powerpc/bootloader/Makefile.in | 20 +++++++++++-- .../powerpc/motorola_powerpc/bootloader/head.S | 33 +++++++++------------- 2 files changed, 30 insertions(+), 23 deletions(-) (limited to 'c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader') diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.in b/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.in index 84e73dad01..85d8963e89 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.in +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.in @@ -9,14 +9,14 @@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ # C source names, if any, go here -- minus the .c -C_PIECES=misc pci zlib mm em86 polled_io +C_PIECES=misc pci zlib mm em86 polled_io lib C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) H_FILES=bootldr.h zlib.h pci.h # Assembly source names, if any, go here -- minus the .s -S_PIECES=head exception em86real consoleLib +S_PIECES=head exception em86real S_FILES=$(S_PIECES:%=%.S) S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o) @@ -57,14 +57,28 @@ IMAGES := rtems.gz # 'make clobber' already includes 'make clean' # -CLEAN_ADDITIONS += bootloader +CLEAN_ADDITIONS += bootloader reloc.O CLOBBER_ADDITIONS += $(IMAGES) +# +# CAUTION : +# +# As we use very specific compilation options in this directory +# we shall not use any other code. This includes the newlib libc.a +# as well as other code located in .o files in mcp750 directory. +# +# NEVER remove lib.c. You have been warned... +# bootloader : ${OBJS} $(IMAGES) $(BINARY_LOADED) ppcboot.lds $(LD) -o bootloader $(OBJS) --just-symbols=$(BINARY_LOADED) \ -b binary $(IMAGES) -T @srcdir@/ppcboot.lds \ -Map bootloader.map +check_unresolved : ${OBJS} + $(LD) -r -o reloc.O ${OBJS} + $(NM) reloc.O |grep ' U ' + echo "Every symbol listed should be defined in @srcdir@/ppcboot.lds" + rtems.gz: $(BINARY_LOADED) $(OBJCOPY) $(BINARY_LOADED) rtems -O binary -R .comment -S gzip -vf9 rtems diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/head.S b/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/head.S index ca8f7a1a29..232232be50 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/head.S +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/head.S @@ -28,6 +28,13 @@ #define USE_PPCBUG #undef USE_PPCBUG + +#define MONITOR_ENTER \ + mfmsr r10 ; \ + ori r10,r10,MSR_IP ; \ + mtmsr r10 ; \ + li r10,0x63 ; \ + sc START_GOT GOT_ENTRY(_GOT2_TABLE_) @@ -50,7 +57,11 @@ /* Point the stack into the PreP partition header in the x86 reserved * code area, so that simple C routines can be called. */ -start: bl 1f +start: +#ifdef USE_PPCBUG + MONITOR_ENTER +#endif + bl 1f 1: mflr r1 li r0,0 stwu r0,start-1b-0x400+0x1b0-FRAME_SIZE(r1) @@ -230,11 +241,7 @@ moved: lwz r1,stack(bd) mtspr HID0,r0 /* Provisional return to FW, works for PPCBug */ #if 0 -1: mfmsr r10 - ori r10,r10,MSR_IP - mtmsr r10 - li r10,0x63 - sc + MONITOR_ENTER #else 1: bctr #endif @@ -313,21 +320,7 @@ flush_tlb: */ sync blr -/* A few utility functions, some copied from arch/ppc/lib/string.S */ -#if 0 - .globl strnlen - .type strnlen,@function -strnlen: - addi r4,r4,1 - mtctr r4 - addi r4,r3,-1 -1: lbzu r0,1(r4) - cmpwi 0,r0,0 - bdnzf eq,1b - subf r3,r3,r4 - blr -#endif .globl codemove codemove: .type codemove,@function -- cgit v1.2.3