diff --git a/stand/ofw/common/Makefile.inc b/stand/ofw/common/Makefile.inc deleted file mode 100644 index 5d20372631e6..000000000000 --- a/stand/ofw/common/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -SRCS+= main.c diff --git a/stand/ofw/libofw/Makefile b/stand/ofw/libofw/Makefile index 80ca993d3785..5ab94e0bee43 100644 --- a/stand/ofw/libofw/Makefile +++ b/stand/ofw/libofw/Makefile @@ -4,7 +4,7 @@ LIB= ofw -SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ +SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c .PATH: ${ZFSSRC} @@ -13,10 +13,6 @@ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.if ${MACHINE_CPUARCH} == "powerpc" -SRCS+= ppc64_elf_freebsd.c -.endif - .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG diff --git a/stand/ofw/libofw/libofw.h b/stand/ofw/libofw/libofw.h index 24a5d08fd77a..6e2cc8186be2 100644 --- a/stand/ofw/libofw/libofw.h +++ b/stand/ofw/libofw/libofw.h @@ -62,18 +62,10 @@ void ofw_memmap(int); struct preloaded_file; struct file_format; -int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **); -int ofw_elf_exec(struct preloaded_file *); - /* MD code implementing MI interfaces */ vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); -extern struct file_format ofw_elf; -#ifdef __powerpc__ -extern struct file_format ofw_elf64; -#endif - extern void reboot(void); struct ofw_reg diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index b1f413526000..de5d5e01037a 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c vers.c start.c +SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" @@ -38,10 +38,6 @@ CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -# Pull in common loader code -.PATH: ${BOOTSRC}/ofw/common -.include "${BOOTSRC}/ofw/common/Makefile.inc" - # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw diff --git a/stand/powerpc/ofw/conf.c b/stand/powerpc/ofw/conf.c index 7cad372cef04..ac815bf325cd 100644 --- a/stand/powerpc/ofw/conf.c +++ b/stand/powerpc/ofw/conf.c @@ -97,6 +97,9 @@ struct netif_driver *netif_drivers[] = { * rather than reading the file go first. */ +struct file_format ofw_elf; +struct file_format ofw_elf64; + struct file_format *file_formats[] = { &ofw_elf, &ofw_elf64, diff --git a/stand/ofw/libofw/elf_freebsd.c b/stand/powerpc/ofw/elf_freebsd.c similarity index 98% rename from stand/ofw/libofw/elf_freebsd.c rename to stand/powerpc/ofw/elf_freebsd.c index 456b0cd58920..78bebf4ebed9 100644 --- a/stand/ofw/libofw/elf_freebsd.c +++ b/stand/powerpc/ofw/elf_freebsd.c @@ -89,8 +89,8 @@ __elfN(ofw_exec)(struct preloaded_file *fp) dev_cleanup(); if (dtbp != 0) { OF_quiesce(); - ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, - (void *)mdp, sizeof(mdp)); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, (void *)mdp, 0xfb5d104d); } else { OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, (void *)mdp, 0xfb5d104d); diff --git a/stand/ofw/common/main.c b/stand/powerpc/ofw/main.c similarity index 100% rename from stand/ofw/common/main.c rename to stand/powerpc/ofw/main.c diff --git a/stand/ofw/libofw/ppc64_elf_freebsd.c b/stand/powerpc/ofw/ppc64_elf_freebsd.c similarity index 100% rename from stand/ofw/libofw/ppc64_elf_freebsd.c rename to stand/powerpc/ofw/ppc64_elf_freebsd.c