Skip to contentSkip to conversation

Enhance PowerPC unit tests

PATCH New Hollis Blanchard 2 participants 8 messages Jan 15, 2008 – Jan 16, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enhance PowerPC unit tests

These patches create libcflat for PowerPC and allow testcases to communicate with kvmctl via MMIO. They culminate in a C testcase that returns an error code through kvmctl to the shell.

The x86 Makefiles looked hairy enough that I didn't want to mess with them, but it should be fairly easy to convert x86 to use the new test/lib/ files.

16 files changed, 436 insertions(+), 130 deletions(-)
user/Makefile                     |   15 +++-----
user/config-powerpc.mak           |   65 +++++++++++++++++++++++++------------
user/config-x86-common.mak        |    6 ++-
user/iotable.c                    |   53 ++++++++++++++++++++++++++++++
user/iotable.h                    |   40 ++++++++++++++++++++++
user/main-ppc.c                   |   65 +++++++++++++++++++++++++++++++++----
user/main.c                       |   52 +----------------------------
user/test/lib/libcflat.h          |   37 +++++++++++++++++++++
user/test/lib/panic.c             |   13 +++++++
user/test/lib/powerpc/44x/map.c   |   51 +++++++++++++++++++++++++++++
user/test/lib/powerpc/44x/tlbwe.S |   50 ++++++++++++++--------------
user/test/lib/powerpc/io.c        |   35 +++++++++++++++++++
user/test/lib/printf.c            |   21 +----------
user/test/lib/string.c            |    2 -
user/test/powerpc/cstart.S        |   38 +++++++++++++++++++++
user/test/powerpc/exit.c          |   23 +++++++++++++

-------------------------------------------------------------------------
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/

#1 lore raw

PATCH 1/1 Move IO handling code to a separate file

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID c6e8bf3f9f7c9705a0ad29f44fa148fe80a365ff
# Parent f22e390c06b78ffbcec4738112309f66267e3582
This will allow other architectures to share it, since main.c is x86-only.

---

5 files changed, 97 insertions(+), 52 deletions(-)
user/config-powerpc.mak    |    2 -
user/config-x86-common.mak |    2 -
user/iotable.c             |   53 ++++++++++++++++++++++++++++++++++++++++++++
user/iotable.h             |   40 +++++++++++++++++++++++++++++++++
user/main.c                |   52 +------------------------------------------
user/config-powerpc.mak +1 -1
@@ -20,7 +20,7 @@ tests := $(addprefix test/powerpc/, $(te
 
 all: kvmctl $(tests)
 
-kvmctl_objs = main-ppc.o ../libkvm/libkvm.a
+kvmctl_objs = main-ppc.o iotable.o ../libkvm/libkvm.a
 
 arch_clean:
 	rm -f $(tests)
user/config-x86-common.mak +1 -1
@@ -2,7 +2,7 @@
 
 all: kvmctl test_cases
 
-kvmctl_objs= main.o ../libkvm/libkvm.a
+kvmctl_objs= main.o iotable.o ../libkvm/libkvm.a
 
 balloon_ctl: balloon_ctl.o
 
user/iotable.c new file +53 -0

53 lines not on this page · raw message

user/iotable.h new file +40 -0
new file mode 100644
@@ -0,0 +1,40 @@
+/*
+ * Kernel-based Virtual Machine test driver
+ *
+ * This test driver provides a simple way of testing kvm, without a full
+ * device model.
+ *
+ * Copyright (C) 2006 Qumranet
+ *
+ * Authors:
+ *
+ *  Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
+ *  Yaniv Kamay <yaniv-atKUWr5tajBWk0Htik3J/[email protected]>
+ *
+ * This work is licensed under the GNU LGPL license, version 2.
+ */
+
+#include <stdint.h>
+
+#define MAX_IO_TABLE	50
+
+typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *);
+
+struct io_table_entry
+{
+	uint64_t start;
+	uint64_t end;
+	io_table_handler_t *handler;
+	void *opaque;
+};
+
+struct io_table
+{
+	int nr_entries;
+	struct io_table_entry entries[MAX_IO_TABLE];
+};
+
+struct io_table_entry *io_table_lookup(struct io_table *io_table,
+                                       uint64_t addr);
+int io_table_register(struct io_table *io_table, uint64_t start, uint64_t size,
+                      io_table_handler_t *handler, void *opaque);
user/main.c +2 -50

70 lines not on this page · raw message

-------------------------------------------------------------------------
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/

#3 lore raw

PATCH 1/1 Register a debug MMIO handler, and implement putc() and exit() with it

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID f058f7e0e9e2f47beb19114a4ee3c7c44ac03aa0
# Parent c6e8bf3f9f7c9705a0ad29f44fa148fe80a365ff
The return code from exit() will propagate all the way out to shell, which will enable some automated testing.

---

1 file changed, 58 insertions(+), 7 deletions(-)

user/main-ppc.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++------

user/main-ppc.c +58 -7
@@ -37,6 +37,8 @@
 #include <stdbool.h>
 #include <inttypes.h>
 
+#include "iotable.h"
+
 static int gettid(void)
 {
 	return syscall(__NR_gettid);
@@ -45,6 +47,8 @@ kvm_context_t kvm;
 kvm_context_t kvm;
 
 #define IPI_SIGNAL (SIGRTMIN + 4)
+
+struct io_table mmio_table;
 
 static int ncpus = 1;
 static sem_t init_sem;
@@ -92,18 +96,63 @@ static int test_pre_kvm_run(void *opaque
 	return 0;
 }
 
+static int mmio_handler(void *opaque, int len, int is_write, uint64_t offset,
+                        uint64_t *data)
+{
+	int r = 0;
+
+	switch (offset) {
+	case 0: /* putc */
+		putc(*(char *)data, stdout);
+		fflush(stdout);
+		break;
+	case 1: /* exit */
+		r = *(char *)data;
+		break;
+	default:
+		printf("%s: offset %"PRIx64" len %d data %"PRIx64"\n",
+		       __func__, offset, len, *(uint64_t *)data);
+		r = -EINVAL;
+	}
+
+	return r;
+}
+
 static int test_mem_read(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
+	struct io_table_entry *iodev;
+
+#if 0
 	printf("%s: addr %"PRIx64" len %d\n", __func__, addr, len);
-	memset(data, 0, len);
-	return 0;
+#endif
+
+	iodev = io_table_lookup(&mmio_table, addr);
+	if (!iodev) {
+		printf("couldn't find device\n");
+		return -ENODEV;
+	}
+
+	return iodev->handler(iodev->opaque, len, 0, addr - iodev->start,
+	                      (uint64_t *)data);
 }
 
 static int test_mem_write(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
+	struct io_table_entry *iodev;
+
+#if 0
 	printf("%s: addr %"PRIx64" len %d data %"PRIx64"\n",
 	       __func__, addr, len, *(uint64_t *)data);
-	return 0;
+#endif
+
+	iodev = io_table_lookup(&mmio_table, addr);
+	if (!iodev) {
+		printf("couldn't find device\n");
+		return -ENODEV;
+	}
+
+	return iodev->handler(iodev->opaque, len, 1, addr - iodev->start,
+	                      (uint64_t *)data);
 }
 
 static int test_dcr_read(uint32_t dcrn, uint32_t *data)
@@ -173,11 +222,13 @@ void sync_caches(void *mem, unsigned lon
 
 static void init_vcpu(int n, unsigned long entry)
 {
+	/* XXX must set initial TLB state and stack
 	struct kvm_regs regs = {
 		.pc = entry,
 	};
 
 	kvm_set_regs(kvm, 0, &regs);
+	*/
 
 	sigemptyset(&ipi_sigmask);
 	sigaddset(&ipi_sigmask, IPI_SIGNAL);
@@ -324,7 +375,7 @@ int main(int argc, char **argv)
 	for (i = 0; i < ncpus; ++i)
 		sem_wait(&init_sem);
 
-	kvm_run(kvm, 0);
-
-	return 0;
-}
+	io_table_register(&mmio_table, 0xf0000000, 64, mmio_handler, NULL);
+
+	return kvm_run(kvm, 0);
+}

-------------------------------------------------------------------------
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/

#4 lore raw

PATCH 1/1 Move FLATLIBS to config-x86-common.mak

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID 05365f8559d584fb1e935a9a64b5fa4f7e894d1f
# Parent f058f7e0e9e2f47beb19114a4ee3c7c44ac03aa0
This allows other architectures to build test executables in other ways.

---

2 files changed, 6 insertions(+), 7 deletions(-)
user/Makefile              |    9 ++-------
user/config-x86-common.mak |    4 ++++
user/Makefile +2 -7
@@ -7,6 +7,8 @@ DESTDIR :=
 
 #make sure env CFLAGS variable is not used
 CFLAGS =
+
+libgcc := $(shell gcc --print-libgcc-file-name)
 
 #include architecure specific make rules
 include config-$(ARCH).mak
@@ -29,17 +31,10 @@ CXXFLAGS = $(autodepend-flags)
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
-libgcc := $(shell gcc --print-libgcc-file-name)
-
-FLATLIBS = $(TEST_DIR)/libcflat.a $(libgcc)
-
 kvmctl: LDFLAGS += -pthread -lrt
 
 kvmctl: $(kvmctl_objs)
 	$(CC) $(LDFLAGS) $^ -o $@
-
-%.flat: %.o $(FLATLIBS)
-	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
 
 %.o: %.S
 	$(CC) $(CFLAGS) -c -nostdlib -o $@ $^
user/config-x86-common.mak +4 -0
@@ -5,6 +5,10 @@ kvmctl_objs= main.o iotable.o ../libkvm/
 kvmctl_objs= main.o iotable.o ../libkvm/libkvm.a
 
 balloon_ctl: balloon_ctl.o
+
+FLATLIBS = $(TEST_DIR)/libcflat.a $(libgcc)
+%.flat: %.o $(FLATLIBS)
+	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
 
 tests-common = $(TEST_DIR)/bootstrap \
 			$(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \

-------------------------------------------------------------------------
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/

#5 lore raw

PATCH 1/1 Use "$(CC)" instead of "gcc" to find libgcc

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID 59aa1c2e71c23b6fe1fb072c81163807da817d5b
# Parent 05365f8559d584fb1e935a9a64b5fa4f7e894d1f
This allows for cross-compiling.

---

1 file changed, 1 insertion(+), 1 deletion(-)

user/Makefile | 2 +-

user/Makefile +1 -1
@@ -8,7 +8,7 @@ DESTDIR :=
 #make sure env CFLAGS variable is not used
 CFLAGS =
 
-libgcc := $(shell gcc --print-libgcc-file-name)
+libgcc := $(shell $(CC) --print-libgcc-file-name)
 
 #include architecure specific make rules
 include config-$(ARCH).mak

-------------------------------------------------------------------------
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/

#6 lore raw

PATCH 1/1 Create libcflat for PowerPC

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID d4c0de7599e4a4ae107044aa4f4c95dc50f9ce6a
# Parent 59aa1c2e71c23b6fe1fb072c81163807da817d5b
This duplicates some test/x86/lib/ files into test/lib/ until someone ports x86 to use the common source. Architectures must provide their own exit() and puts() implementations under test/lib/<arch>/.

---

9 files changed, 182 insertions(+), 45 deletions(-)
user/Makefile                     |    4 ++
user/config-powerpc.mak           |   14 +++++++++-
user/test/lib/libcflat.h          |   37 ++++++++++++++++++++++++++
user/test/lib/panic.c             |   13 +++++++++
user/test/lib/powerpc/44x/map.c   |   51 +++++++++++++++++++++++++++++++++++++
user/test/lib/powerpc/44x/tlbwe.S |   50 ++++++++++++++++++------------------
user/test/lib/powerpc/io.c        |   35 +++++++++++++++++++++++++
user/test/lib/printf.c            |   21 +--------------
user/test/lib/string.c            |    2 -
user/Makefile +4 -0
@@ -9,6 +9,10 @@ CFLAGS =
 CFLAGS =
 
 libgcc := $(shell $(CC) --print-libgcc-file-name)
+cflatobjs := \
+	test/lib/panic.o \
+	test/lib/printf.o \
+	test/lib/string.o
 
 #include architecure specific make rules
 include config-$(ARCH).mak
user/config-powerpc.mak +13 -1
@@ -1,3 +1,10 @@ CFLAGS += -m32
+libcflat := test/lib/libcflat.a
+
+cflatobjs += \
+	test/lib/powerpc/io.o \
+	test/lib/powerpc/44x/map.o \
+	test/lib/powerpc/44x/tlbwe.o
+
 CFLAGS += -m32
 CFLAGS += -D__powerpc__
 CFLAGS += -I $(KERNELDIR)/include
@@ -20,7 +27,12 @@ tests := $(addprefix test/powerpc/, $(te
 
 all: kvmctl $(tests)
 
+$(libcflat): LDFLAGS += -nostdlib
+$(libcflat): CFLAGS += -ffreestanding -I test/lib -I test/lib/powerpc/44x
+$(libcflat): $(cflatobjs)
+	ar rcs $@ $^
+
 kvmctl_objs = main-ppc.o iotable.o ../libkvm/libkvm.a
 
 arch_clean:
-	rm -f $(tests)
+	rm -f $(tests) $(cflatobjs)
user/test/lib/libcflat.h new file +37 -0
new file mode 100644
@@ -0,0 +1,37 @@
+/*
+ * 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 <hollisb-r/[email protected]>
+ */
+
+#ifndef __LIBCFLAT_H
+#define __LIBCFLAT_H
+
+#include <stdarg.h>
+
+extern int main(void);
+extern void exit(int code);
+extern void panic(char *fmt, ...);
+
+extern unsigned long strlen(const char *buf);
+extern char *strcat(char *dest, const char *src);
+
+extern int printf(const char *fmt, ...);
+extern int vsnprintf(char *buf, int size, const char *fmt, va_list va);
+
+extern void puts(const char *s);
+
+#endif
user/test/lib/panic.c new file +13 -0
new file mode 100644
@@ -0,0 +1,13 @@
+#include "libcflat.h"
+
+void panic(char *fmt, ...)
+{
+	va_list va;
+	char buf[2000];
+
+	va_start(va, fmt);
+	vsnprintf(buf, sizeof(buf), fmt, va);
+	va_end(va);
+	puts(buf);
+	exit(-1);
+}
user/test/lib/powerpc/44x/map.c new file +51 -0

51 lines not on this page · raw message

user/test/lib/powerpc/44x/tlbwe.S +26 -24

53 lines not on this page · raw message

user/test/lib/powerpc/io.c new file +35 -0
new file mode 100644
@@ -0,0 +1,35 @@
+/*
+ * 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 <hollisb-r/[email protected]>
+ */
+
+#include "libcflat.h"
+
+#define BASE 0xf0000000
+#define _putc ((volatile char *)(BASE))
+#define _exit ((volatile char *)(BASE+1))
+
+void puts(const char *s)
+{
+	while (*s != '\0')
+		*_putc = *s++;
+}
+
+void exit(int code)
+{
+	*_exit = code;
+}
user/test/lib/printf.c +2 -19
copy from user/test/x86/lib/printf.c
copy to user/test/lib/printf.c
@@ -1,11 +1,4 @@
-#include "printf.h"
-#include "smp.h"
-#include <stdarg.h>
-#include "string.h"
-
-static struct spinlock lock;
-
-void print(const char *s);
+#include "libcflat.h"
 
 typedef struct pstream {
     char *buffer;
@@ -92,7 +85,6 @@ void print_unsigned(pstream_t *ps, unsig
 
 int vsnprintf(char *buf, int size, const char *fmt, va_list va)
 {
-    int n;
     pstream_t s;
 
     s.buffer = buf;
@@ -173,13 +165,6 @@ int snprintf(char *buf, int size, const 
     return r;
 }
 
-void print_serial(const char *buf)
-{
-    unsigned long len = strlen(buf);
-
-    asm volatile ("rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
-}
-
 int printf(const char *fmt, ...)
 {
     va_list va;
@@ -189,8 +174,6 @@ int printf(const char *fmt, ...)
     va_start(va, fmt);
     r = vsnprintf(buf, sizeof buf, fmt, va);
     va_end(va);
-    spin_lock(&lock);
-    print_serial(buf);
-    spin_unlock(&lock);
+    puts(buf);
     return r;
 }
user/test/lib/string.c +1 -1
copy from user/test/x86/lib/string.c
copy to user/test/lib/string.c
@@ -1,4 +1,4 @@
-#include "string.h"
+#include "libcflat.h"
 
 unsigned long strlen(const char *buf)
 {

-------------------------------------------------------------------------
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/

#7 lore raw

PATCH 1/1 Reorganize PowerPC makefiles and add an "exit" test that uses libcflat

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200437012 21600
# Node ID 75481de4f07eab17035fb24f14417be2ee62ac10
# Parent d4c0de7599e4a4ae107044aa4f4c95dc50f9ce6a

---

3 files changed, 92 insertions(+), 18 deletions(-)
user/config-powerpc.mak    |   49 +++++++++++++++++++++++++++-----------------
user/test/powerpc/cstart.S |   38 ++++++++++++++++++++++++++++++++++
user/test/powerpc/exit.c   |   23 ++++++++++++++++++++
user/config-powerpc.mak +31 -18
@@ -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))
user/test/powerpc/cstart.S new file +38 -0
new file mode 100644
@@ -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 <hollisb-r/[email protected]>
+ */
+
+#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	.
user/test/powerpc/exit.c new file +23 -0
new file mode 100644
@@ -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 <hollisb-r/[email protected]>
+ */
+
+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/

#2 lore raw

Re: [PATCH 1 of 6] Move IO handling code to a separate file

In reply to Hollis Blanchard
Quoted 8 lines · Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <hollisb-r/[email protected]> # Date 1200436754 21600
# Node ID c6e8bf3f9f7c9705a0ad29f44fa148fe80a365ff
# Parent f22e390c06b78ffbcec4738112309f66267e3582
This will allow other architectures to share it, since main.c is x86-only.

Applied patches 1-4. Can we not avoid the duplication in 5?

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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/