From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: [PATCH 6 of 6] Reorganize PowerPC makefiles and add an "exit" test that uses libcflat Date: Tue, 15 Jan 2008 16:43:44 -0600 Message-ID: <75481de4f07eab17035f.1200437024@basalt> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org # HG changeset patch # User Hollis Blanchard # Date 1200437012 21600 # Node ID 75481de4f07eab17035fb24f14417be2ee62ac10 # Parent d4c0de7599e4a4ae107044aa4f4c95dc50f9ce6a Signed-off-by: Hollis Blanchard --- 3 files changed, 92 insertions(+), 18 deletions(-) user/config-powerpc.mak | 49 +++++++++++++++++++++++++++----------------- user/test/powerpc/cstart.S | 38 ++++++++++++++++++++++++++++++++++ user/test/powerpc/exit.c | 23 ++++++++++++++++++++ diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak --- a/user/config-powerpc.mak +++ b/user/config-powerpc.mak @@ -1,3 +1,4 @@ libcflat := test/lib/libcflat.a +cstart := test/powerpc/cstart.o libcflat := test/lib/libcflat.a cflatobjs += \ @@ -5,27 +6,37 @@ cflatobjs += \ test/lib/powerpc/44x/map.o \ test/lib/powerpc/44x/tlbwe.o +# these tests do not use libcflat +simpletests := \ + test/powerpc/spin.bin \ + test/powerpc/io.bin \ + test/powerpc/sprg.bin \ + test/powerpc/44x/tlbsx.bin \ + test/powerpc/44x/tlbwe_16KB.bin \ + test/powerpc/44x/tlbwe_hole.bin \ + test/powerpc/44x/tlbwe.bin + +# these tests use cstart.o, libcflat, and libgcc +tests := \ + test/powerpc/exit.bin + +all: kvmctl $(tests) $(simpletests) + CFLAGS += -m32 CFLAGS += -D__powerpc__ CFLAGS += -I $(KERNELDIR)/include +CFLAGS += -Wa,-mregnames + +$(simpletests): %.bin: %.o + $(CC) $(LDFLAGS) -nostdlib $^ -o $*.elf + $(OBJCOPY) -O binary $*.elf $@ + +$(tests): %.bin: $(cstart) %.o $(libcflat) + $(CC) $(LDFLAGS) -nostdlib -Wl,-Ttext,0 $^ $(libgcc) -o $*.elf + $(OBJCOPY) -O binary $*.elf $@ + # for some reaons binutils hates tlbsx unless we say we're 405 :( -CFLAGS += -Wa,-mregnames,-m405 - -%.bin: %.o - $(OBJCOPY) -O binary $^ $@ - -testobjs := \ - io.bin \ - spin.bin \ - sprg.bin \ - 44x/tlbsx.bin \ - 44x/tlbwe_16KB.bin \ - 44x/tlbwe_hole.bin \ - 44x/tlbwe.bin - -tests := $(addprefix test/powerpc/, $(testobjs)) - -all: kvmctl $(tests) +test/powerpc/44x/tlbsx.bin: CFLAGS += -Wa,-m405 $(libcflat): LDFLAGS += -nostdlib $(libcflat): CFLAGS += -ffreestanding -I test/lib -I test/lib/powerpc/44x @@ -35,4 +46,6 @@ kvmctl_objs = main-ppc.o iotable.o ../li kvmctl_objs = main-ppc.o iotable.o ../libkvm/libkvm.a arch_clean: - rm -f $(tests) $(cflatobjs) + $(RM) $(simpletests) $(tests) $(cflatobjs) $(libcflat) $(cstart) + $(RM) $(patsubst %.bin, %.elf, $(simpletests) $(tests)) + $(RM) $(patsubst %.bin, %.o, $(simpletests) $(tests)) diff --git a/user/test/powerpc/cstart.S b/user/test/powerpc/cstart.S new file mode 100644 --- /dev/null +++ b/user/test/powerpc/cstart.S @@ -0,0 +1,38 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Hollis Blanchard + */ + +#define OUTPUT_VADDR 0xf0000000 +#define OUTPUT_PADDR 0xf0000000 + +.globl _start +_start: + /* In the future we might need to assign a stack and zero BSS here. */ + + /* Map the debug page 1:1. */ + lis r3, OUTPUT_VADDR@h + ori r3, r3, OUTPUT_VADDR@l + lis r4, OUTPUT_PADDR@h + ori r4, r4, OUTPUT_PADDR@l + bl map + + /* Call main() and pass return code to exit(). */ + bl main + bl exit + + b . diff --git a/user/test/powerpc/exit.c b/user/test/powerpc/exit.c new file mode 100644 --- /dev/null +++ b/user/test/powerpc/exit.c @@ -0,0 +1,23 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Hollis Blanchard + */ + +int main(void) +{ + return 1; +} ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/