[haiku-commits] BRANCH xyzzy-github.x86_64 - src/system/boot/loader src/system/boot/platform/bios_ia32 src/system/libroot/posix/malloc src/system/libroot/posix/crypt headers/private/kernel/arch/x86

  • From: xyzzy-github.x86_64 <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 17 Aug 2012 16:49:14 +0200 (CEST)

added 3 changesets to branch 'refs/remotes/xyzzy-github/x86_64'
old head: 3bf3aa2e2c4bc87076138e320877475397655853
new head: 173342c0ab918a72a12540ee1de8213720a2d3f5

----------------------------------------------------------------------------

e993391: Fixed crypt() for 64-bit systems.

9f629ef: Rename KERNEL_LOAD_BASE_64BIT to KERNEL_LOAD_BASE_64_BIT for 
consistency.

173342c: Change the heap reservation for 64-bit platforms.
  
  Hoard reserves a chunk of the address space to grow the heap into.
  As there is a much larger address space available on 64-bit systems,
  we may as well reserve a larger chunk of address space (64GB for now,
  though could probably reserve a lot more than that and still leave
  plenty of room for other areas).

                                      [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

6 files changed, 22 insertions(+), 8 deletions(-)
headers/private/kernel/arch/x86/arch_kernel.h     |    2 +-
src/system/boot/loader/elf.cpp                    |    6 +++---
src/system/boot/platform/bios_ia32/long.cpp       |    6 +++---
src/system/libroot/posix/crypt/crypt_util.c       |    2 ++
src/system/libroot/posix/crypt/ufc-crypt.h        |    9 ++++++++-
src/system/libroot/posix/malloc/arch-specific.cpp |    5 +++++

############################################################################

Commit:      e993391e9c40a536550d8b3740d7ad2b743876e5

Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Fri Aug 17 12:37:05 2012 UTC

Fixed crypt() for 64-bit systems.

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/crypt/crypt_util.c 
b/src/system/libroot/posix/crypt/crypt_util.c
index 0dedf54..c72a55f 100644
--- a/src/system/libroot/posix/crypt/crypt_util.c
+++ b/src/system/libroot/posix/crypt/crypt_util.c
@@ -23,6 +23,8 @@
  *
  */
 
+#include <string.h>
+
 #ifdef DEBUG
 #include <stdio.h>
 #endif
diff --git a/src/system/libroot/posix/crypt/ufc-crypt.h 
b/src/system/libroot/posix/crypt/ufc-crypt.h
index 13da8b4..aa77ae7 100644
--- a/src/system/libroot/posix/crypt/ufc-crypt.h
+++ b/src/system/libroot/posix/crypt/ufc-crypt.h
@@ -23,6 +23,8 @@
  * 
  */
 
+#include <SupportDefs.h>
+
 /* 
  * Requirements for datatypes:
  * 
@@ -99,10 +101,15 @@ typedef long long     long64;
 
 #ifndef _UFC_64_
 #ifndef _UFC_32_
+#if B_HAIKU_64_BIT
+#define _UFC_64_
+typedef unsigned long long64;
+#else
 #define _UFC_32_
-typedef unsigned long ufc_long;
 typedef unsigned long long32;
 #endif
+typedef unsigned long ufc_long;
+#endif
 #endif
 
 

############################################################################

Commit:      9f629ef38e6655e1509dca6db587a2035243ccdb

Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Fri Aug 17 14:16:25 2012 UTC

Rename KERNEL_LOAD_BASE_64BIT to KERNEL_LOAD_BASE_64_BIT for consistency.

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/arch/x86/arch_kernel.h 
b/headers/private/kernel/arch/x86/arch_kernel.h
index 3668525..e6cf5db 100644
--- a/headers/private/kernel/arch/x86/arch_kernel.h
+++ b/headers/private/kernel/arch/x86/arch_kernel.h
@@ -19,7 +19,7 @@
 
 // 32-bit and 64-bit kernel load addresses.
 #define KERNEL_LOAD_BASE               0x80000000
-#define KERNEL_LOAD_BASE_64BIT 0xffffffff80000000ll
+#define KERNEL_LOAD_BASE_64_BIT        0xffffffff80000000ll
 
 
 #elif defined(__x86_64__)
diff --git a/src/system/boot/loader/elf.cpp b/src/system/boot/loader/elf.cpp
index a08a297..d12e3b1 100644
--- a/src/system/boot/loader/elf.cpp
+++ b/src/system/boot/loader/elf.cpp
@@ -116,7 +116,7 @@ struct ELF64Class {
        AllocateRegion(AddrType* _address, AddrType size, uint8 protection,
                void **_mappedAddress)
        {
-               // Assume the real 64-bit base address is 
KERNEL_LOAD_BASE_64BIT and
+               // Assume the real 64-bit base address is 
KERNEL_LOAD_BASE_64_BIT and
                // the mappings in the loader address space are at 
KERNEL_LOAD_BASE.
 
                void* address = (void*)(addr_t)(*_address & 0xffffffff);
@@ -127,7 +127,7 @@ struct ELF64Class {
                        return status;
 
                *_mappedAddress = address;
-               *_address = (AddrType)(addr_t)address + KERNEL_LOAD_BASE_64BIT
+               *_address = (AddrType)(addr_t)address + KERNEL_LOAD_BASE_64_BIT
                        - KERNEL_LOAD_BASE;
                return B_OK;
        }
@@ -135,7 +135,7 @@ struct ELF64Class {
        static inline void*
        Map(AddrType address)
        {
-               return (void*)(addr_t)(address - KERNEL_LOAD_BASE_64BIT
+               return (void*)(addr_t)(address - KERNEL_LOAD_BASE_64_BIT
                        + KERNEL_LOAD_BASE);
        }
 };
diff --git a/src/system/boot/platform/bios_ia32/long.cpp 
b/src/system/boot/platform/bios_ia32/long.cpp
index 37e7b37..e672846 100644
--- a/src/system/boot/platform/bios_ia32/long.cpp
+++ b/src/system/boot/platform/bios_ia32/long.cpp
@@ -44,7 +44,7 @@ extern uint64 gLongKernelEntry;
 static inline uint64
 fix_address(uint64 address)
 {
-       return address - KERNEL_LOAD_BASE + KERNEL_LOAD_BASE_64BIT;
+       return address - KERNEL_LOAD_BASE + KERNEL_LOAD_BASE_64_BIT;
 }
 
 
@@ -119,10 +119,10 @@ long_mmu_init()
        gKernelArgs.arch_args.vir_pgdir = fix_address((uint64)(addr_t)pml4);
 
        // Store the virtual memory usage information.
-       gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE_64BIT;
+       gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE_64_BIT;
        gKernelArgs.virtual_allocated_range[0].size = mmu_get_virtual_usage();
        gKernelArgs.num_virtual_allocated_ranges = 1;
-       gKernelArgs.arch_args.virtual_end = ROUNDUP(KERNEL_LOAD_BASE_64BIT
+       gKernelArgs.arch_args.virtual_end = ROUNDUP(KERNEL_LOAD_BASE_64_BIT
                + gKernelArgs.virtual_allocated_range[0].size, 0x200000);
 
        // Find the highest physical memory address. We map all physical memory

############################################################################

Commit:      173342c0ab918a72a12540ee1de8213720a2d3f5

Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Fri Aug 17 14:34:11 2012 UTC

Change the heap reservation for 64-bit platforms.

Hoard reserves a chunk of the address space to grow the heap into.
As there is a much larger address space available on 64-bit systems,
we may as well reserve a larger chunk of address space (64GB for now,
though could probably reserve a lot more than that and still leave
plenty of room for other areas).

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/malloc/arch-specific.cpp 
b/src/system/libroot/posix/malloc/arch-specific.cpp
index c9e311c..0bcaac8 100644
--- a/src/system/libroot/posix/malloc/arch-specific.cpp
+++ b/src/system/libroot/posix/malloc/arch-specific.cpp
@@ -58,8 +58,13 @@ static const size_t kInitialHeapSize = 64 * B_PAGE_SIZE;
 static const size_t kHeapIncrement = 16 * B_PAGE_SIZE;
        // the steps in which to increase the heap size (must be a power of 2)
 
+#if B_HAIKU_64_BIT
+static const addr_t kHeapReservationBase = 0x1000000000;
+static const addr_t kHeapReservationSize = 0x1000000000;
+#else
 static const addr_t kHeapReservationBase = 0x18000000;
 static const addr_t kHeapReservationSize = 0x48000000;
+#endif
 
 static area_id sHeapArea;
 static hoardLockType sHeapLock;


Other related posts:

  • » [haiku-commits] BRANCH xyzzy-github.x86_64 - src/system/boot/loader src/system/boot/platform/bios_ia32 src/system/libroot/posix/malloc src/system/libroot/posix/crypt headers/private/kernel/arch/x86 - xyzzy-github . x86_64