diff --git a/build/jam/ImageRules b/build/jam/ImageRules index bcaa5d7fdc..e182d87230 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -1618,9 +1618,10 @@ actions BuildCDBootPPCImage1 bind MAPS # Extras (readme files, etc) cp $(>[4]) $(HAIKU_OUTPUT_DIR)/cd/ - xorriso -as mkisofs -v -hfs -part -map $(MAPS) -no-desktop -hfs-volid bootimg \ - -V $(VOLID) -hfs-bless $(HAIKU_OUTPUT_DIR)/cd/boot -prep-boot \ - boot/haikuloader.xcf -r -o $(<) $(HAIKU_OUTPUT_DIR)/cd + xorriso -as mkisofs -v -hfsplus \ + -hfs-bless $(HAIKU_OUTPUT_DIR)/cd/boot \ + -prep-boot-part $(HAIKU_OUTPUT_DIR)/cd/boot/haikuloader.xcf \ + -r -J -o $(<) $(HAIKU_OUTPUT_DIR)/cd $(RM) -r $(HAIKU_OUTPUT_DIR)/cd } diff --git a/build/jam/images/CDBootImage b/build/jam/images/CDBootImage index 6832e7ab49..c956f324af 100644 --- a/build/jam/images/CDBootImage +++ b/build/jam/images/CDBootImage @@ -16,7 +16,7 @@ local extras = README.html ; if $(TARGET_ARCH) = ppc { local elfloader = boot_loader_openfirmware ; - local coffloader = boot_loader_openfirmware_coff ; + local coffloader = haiku_loader.openfirmware ; # OpenFirmware / Mac boot support files: # CHRP script diff --git a/build/jam/repositories/HaikuPorts/ppc b/build/jam/repositories/HaikuPorts/ppc index 720c8fa5dd..3411cfca78 100644 --- a/build/jam/repositories/HaikuPorts/ppc +++ b/build/jam/repositories/HaikuPorts/ppc @@ -3,16 +3,16 @@ RemotePackageRepository HaikuPorts : https://eu.hpkg.haiku-os.org/haikuports/master/build-packages : # architecture "any" packages - be_book-2008_10_26-2 - ca_root_certificates-2018_01_17-2 - gnu_efi_kernel-3.0.8-1 + be_book-2008_10_26-3 + ca_root_certificates-2019_01_23-1 + gnu_efi_kernel-3.0.10-1 timgmsoundfont-fixed-5 noto-20170920-3 wqy_microhei-0.2.0~beta-4 : # repository architecture packages # primary architecture (ppc) - bash-4.4.012-1 + bash-4.4.023-1 coreutils-8.22-1 curl-7.40.0-1 curl_devel-7.40.0-1 @@ -23,8 +23,8 @@ RemotePackageRepository HaikuPorts mawk-1.3.4-1 ncurses6-6.0-1 ncurses6_devel-6.0-1 - gcc_syslibs-5.4.0_2016_06_04-1 - gcc_syslibs_devel-5.4.0_2016_06_04-1 + gcc_syslibs_devel-8.3.0_2019_05_24-1 + gcc_syslibs-8.3.0_2019_05_24-1 icu-57.1-2 icu_devel-57.1-2 libsolv-0.3.0_haiku_2014_12_22-1 @@ -32,78 +32,25 @@ RemotePackageRepository HaikuPorts zlib-1.2.11-1 zlib_devel-1.2.11-1 : - # source packages - autoconf - automake + # source package bash -# bepdf binutils bison - bzip2 - cdrtools - cmake coreutils - ctags curl - cvs - doxygen expat -# ffmpeg flex freetype gcc - gettext - git - glu - gperf grep - groff - haikuwebkit - htmldoc icu - jam - jpeg - keymapswitcher - libedit - libiconv -# libogg - libpcre - libpng libsolv -# libtheora - libtool -# libvorbis -# libvpx - libxml2 m4 make - man - mercurial - mesa - mkdepend - nano ncurses6 - neon - openssh - openssl - p7zip - pe - perl - pkgconfig python - readline - scons sed -# speex - sqlite - subversion - tar - texi2html texinfo - vision - wpa_supplicant - yasm - xz_utils zlib : # debuginfo packages diff --git a/build/jam/repositories/HaikuPortsCross/ppc b/build/jam/repositories/HaikuPortsCross/ppc index 7fc8fd011a..f783632f86 100644 --- a/build/jam/repositories/HaikuPortsCross/ppc +++ b/build/jam/repositories/HaikuPortsCross/ppc @@ -3,6 +3,7 @@ BootstrapPackageRepository HaikuPortsCross : # architecture "any" packages haikuporter-0-1 + noto-20170202-7 : # repository architecture packages (stage 0) gcc_bootstrap-8.3.0_2019_05_24-1 @@ -10,9 +11,9 @@ BootstrapPackageRepository HaikuPortsCross gcc_bootstrap_syslibs_devel-8.3.0_2019_05_24-1 : # repository architecture packages (stage 1) - bash_bootstrap-4.4.012-1 - binutils_bootstrap-2.26.1_2016_02_29-1 - bison_bootstrap-3.0.4-5 + bash_bootstrap-4.4.023-1 + binutils_bootstrap-2.28.1_2017_08_05-1 + bison_bootstrap-3.0.5-1 coreutils_bootstrap-8.22-1 curl_bootstrap-7.40.0-1 curl_bootstrap_devel-7.40.0-1 diff --git a/headers/private/system/arch/ppc/asm_defs.h b/headers/private/system/arch/ppc/asm_defs.h index 798fa02793..299622c653 100644 --- a/headers/private/system/arch/ppc/asm_defs.h +++ b/headers/private/system/arch/ppc/asm_defs.h @@ -2,8 +2,8 @@ * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. * Distributed under the terms of the MIT License. */ -#ifndef SYSTEM_ARCH_X86_ASM_DEFS_H -#define SYSTEM_ARCH_X86_ASM_DEFS_H +#ifndef SYSTEM_ARCH_PPC_ASM_DEFS_H +#define SYSTEM_ARCH_PPC_ASM_DEFS_H #define SYMBOL(name) .global name; name @@ -13,5 +13,5 @@ #define FUNCTION_END(name) 1: .size name, 1b - name -#endif /* SYSTEM_ARCH_X86_ASM_DEFS_H */ +#endif /* SYSTEM_ARCH_PPC_ASM_DEFS_H */ diff --git a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp index aae1330532..f85a682a99 100644 --- a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp +++ b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp @@ -30,7 +30,7 @@ status_t ppc_openfirmware_pci_controller_init(void) { char path[256]; - int cookie = 0; + intptr_t cookie = 0; while (of_get_next_device(&cookie, 0, "pci", path, sizeof(path)) == B_OK) { dprintf("ppc_openfirmware_pci_controller_init(): pci device node: %s\n", path); diff --git a/src/libs/compat/freebsd_network/compat/sys/param.h b/src/libs/compat/freebsd_network/compat/sys/param.h index bf7770beff..b9e05aa4d5 100644 --- a/src/libs/compat/freebsd_network/compat/sys/param.h +++ b/src/libs/compat/freebsd_network/compat/sys/param.h @@ -65,6 +65,8 @@ || defined(__sparc__) || defined(__riscv64__) \ || defined(__aarch64__) || defined(__arm64__) #define CACHE_LINE_SIZE 64 +#elif defined(__powerpc__) +#define CACHE_LINE_SIZE 128 #else #error Need definition of CACHE_LINE_SIZE for this arch! #endif diff --git a/src/system/boot/arch/ppc/Jamfile b/src/system/boot/arch/ppc/Jamfile index ea1c5a600a..b83c57a6e5 100644 --- a/src/system/boot/arch/ppc/Jamfile +++ b/src/system/boot/arch/ppc/Jamfile @@ -1,33 +1,30 @@ SubDir HAIKU_TOP src system boot arch ppc ; -{ - local defines = _BOOT_MODE ; - - defines = [ FDefines $(defines) ] ; - SubDirCcFlags $(defines) ; - SubDirC++Flags $(defines) -fno-rtti ; -} - - local kernelLibArchObjects = byteorder.o memcpy.o memset.o ; -BootMergeObject boot_arch_$(TARGET_KERNEL_ARCH).o : - debug_uart_8250.cpp - arch_uart_8250.cpp - arch_elf.cpp - : # additional flags - : - $(kernelArchObjects) - $(kernelLibArchObjects) -; +local platform ; +for platform in [ MultiBootSubDirSetup openfirmware ] { + on $(platform) { + DEFINES += _BOOT_MODE ; -SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ] - = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ; + BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] : + debug_uart_8250.cpp + #arch_uart_8250.cpp + arch_elf.cpp + : # additional flags + : + $(kernelArchObjects) + $(kernelLibArchObjects) + ; -SEARCH on [ FGristFiles debug_uart_8250.cpp ] - = [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ; + SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ] + = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ; + SEARCH on [ FGristFiles debug_uart_8250.cpp ] + = [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ; + } +} diff --git a/src/system/boot/loader/Jamfile b/src/system/boot/loader/Jamfile index eab74569a0..7863619639 100644 --- a/src/system/boot/loader/Jamfile +++ b/src/system/boot/loader/Jamfile @@ -36,6 +36,7 @@ for platform in [ MultiBootSubDirSetup ] { case "ppc" : { DEFINES += + BOOT_SUPPORT_ELF32 #How to deal with PPC970 ? BOOT_SUPPORT_PARTITION_AMIGA BOOT_SUPPORT_PARTITION_APPLE diff --git a/src/system/boot/platform/openfirmware/arch/ppc/Jamfile b/src/system/boot/platform/openfirmware/arch/ppc/Jamfile index 14a364fb08..d0df294dce 100644 --- a/src/system/boot/platform/openfirmware/arch/ppc/Jamfile +++ b/src/system/boot/platform/openfirmware/arch/ppc/Jamfile @@ -1,6 +1,6 @@ SubDir HAIKU_TOP src system boot platform openfirmware arch ppc ; -SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ; +SubDirHdrs $(HAIKU_TOP) src system boot platform openfirmware ; UsePrivateSystemHeaders ; UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] [ FDirName kernel boot platform $(HAIKU_KERNEL_PLATFORM) ] diff --git a/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp b/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp index a2a4b2a883..bd67134fa4 100644 --- a/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp +++ b/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp @@ -45,7 +45,7 @@ boot_arch_cpu_init(void) } char cpuPath[256]; - int cookie = 0; + intptr_t cookie = 0; int cpuCount = 0; while (of_get_next_device(&cookie, cpus, "cpu", cpuPath, sizeof(cpuPath)) == B_OK) { @@ -88,9 +88,9 @@ boot_arch_cpu_init(void) gKernelArgs.arch_args.bus_frequency = busFrequency; gKernelArgs.arch_args.time_base_frequency = timeBaseFrequency; - TRACE((" CPU clock frequency: %ld\n", clockFrequency)); - TRACE((" bus clock frequency: %ld\n", busFrequency)); - TRACE((" time base frequency: %ld\n", timeBaseFrequency)); + TRACE((" CPU clock frequency: %" B_PRId32 "\n", clockFrequency)); + TRACE((" bus clock frequency: %" B_PRId32 "\n", busFrequency)); + TRACE((" time base frequency: %" B_PRId32 "\n", timeBaseFrequency)); } cpuCount++; diff --git a/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp b/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp index 4a0fe83f1a..8c82265b1c 100644 --- a/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp +++ b/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp @@ -574,7 +574,7 @@ map_callback(struct of_arguments *args) void *virtualAddress = (void *)args->Argument(1); int length = args->Argument(2); int mode = args->Argument(3); - int &error = args->ReturnValue(0); + intptr_t &error = args->ReturnValue(0); // insert range in physical allocated if needed @@ -618,9 +618,9 @@ static int translate_callback(struct of_arguments *args) { addr_t virtualAddress = (addr_t)args->Argument(0); - int &error = args->ReturnValue(0); - int &physicalAddress = args->ReturnValue(1); - int &mode = args->ReturnValue(2); + intptr_t &error = args->ReturnValue(0); + intptr_t &physicalAddress = args->ReturnValue(1); + intptr_t &mode = args->ReturnValue(2); // Find page table entry for this address diff --git a/src/system/boot/platform/openfirmware/arch/ppc/start.cpp b/src/system/boot/platform/openfirmware/arch/ppc/start.cpp index 604e726c51..693a2f0aad 100644 --- a/src/system/boot/platform/openfirmware/arch/ppc/start.cpp +++ b/src/system/boot/platform/openfirmware/arch/ppc/start.cpp @@ -5,11 +5,13 @@ * Distributed under the terms of the MIT License. */ - #include "start.h" -#include "machine.h" +#include +#include +#include +#include "machine.h" extern "C" void _start(uint32 _unused1, uint32 _unused2, void *openFirmwareEntry); diff --git a/src/system/kernel/arch/ppc/arch_platform.cpp b/src/system/kernel/arch/ppc/arch_platform.cpp index 1abf7b4fb1..f7b621ab59 100644 --- a/src/system/kernel/arch/ppc/arch_platform.cpp +++ b/src/system/kernel/arch/ppc/arch_platform.cpp @@ -114,7 +114,7 @@ status_t PPCOpenFirmware::Init(struct kernel_args *kernelArgs) { return of_init( - (int(*)(void*))kernelArgs->platform_args.openfirmware_entry); + (intptr_t(*)(void*))kernelArgs->platform_args.openfirmware_entry); } // InitSerialDebug diff --git a/src/system/libroot/os/arch/ppc/byteorder.S b/src/system/libroot/os/arch/ppc/byteorder.S index c8a6d8824d..fb49bf56ba 100644 --- a/src/system/libroot/os/arch/ppc/byteorder.S +++ b/src/system/libroot/os/arch/ppc/byteorder.S @@ -3,10 +3,45 @@ ** Distributed under the terms of the OpenBeOS License. */ -#define FUNCTION(x) .global x; .type x,@function; x +#include .text +/* uint16 __swap_int16(uint16 value) + * r3 + */ +FUNCTION(__swap_int16): + rlwinm %r4, %r3, 8, 16, 23 // byte 4 -> byte 3 (clear other bits) + rlwimi %r4, %r3, 24, 24, 31 // byte 3 -> byte 4 (copy into) + mr %r3, %r4 // copy to result register + blr + + +/* uint32 __swap_int32(uint32 value) + * r3 + */ +FUNCTION(__swap_int32): + lwbrx %r4, 0, %r3 // Load and inverse r3 into r4 + mr %r3, %r4 + blr + + +/* uint64 __swap_int64(uint64 value) + * r3/r4 + */ +FUNCTION(__swap_int64): + lwbrx %r5, 0, %r3 + mr %r3, %r5 + lwbrx %r5, 0, %r4 + mr %r4, %r5 // copy lower 32 bits + blr + + +/* TODO: The following functions can surely be optimized. A simple optimization + * would be to define macros with the contents of the __swap_int{32,64} + * functions and use those instead of calling the functions. + */ + /* float __swap_float(float value) * f1 */