hrev56178 adds 1 changeset to branch 'master'
old head: 3c5b619e97bebc8e75a477f23fe385ed7e4d5374
new head: 30763b1e79a0f31aadf100b38e6c4782dda92b0f
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=30763b1e79a0+%5E3c5b619e97be
----------------------------------------------------------------------------
30763b1e79a0: freebsd_network: Rewrite bus/vm headers to use Haiku phys_addr
types directly.
Instead of redeclaring them, which it did so incorrectly on systems
with PAE in some cases. May fix problems on some 32-bit systems.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev56178
Commit: 30763b1e79a0f31aadf100b38e6c4782dda92b0f
URL: https://git.haiku-os.org/haiku/commit/?id=30763b1e79a0
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Fri Jun 10 17:38:08 2022 UTC
----------------------------------------------------------------------------
3 files changed, 13 insertions(+), 36 deletions(-)
.../compat/freebsd_network/compat/machine/_bus.h | 22 +++----------------
.../freebsd_network/compat/machine/x86/bus.h | 4 ++++
src/libs/compat/freebsd_network/compat/vm/vm.h | 23 +++++---------------
----------------------------------------------------------------------------
diff --git a/src/libs/compat/freebsd_network/compat/machine/_bus.h
b/src/libs/compat/freebsd_network/compat/machine/_bus.h
index aa577d760b..cac4ad62a9 100644
--- a/src/libs/compat/freebsd_network/compat/machine/_bus.h
+++ b/src/libs/compat/freebsd_network/compat/machine/_bus.h
@@ -1,6 +1,5 @@
/*
- * Copyright 2009, Colin Günther. All Rights Reserved.
- * Copyright 2007, Hugo Santos. All Rights Reserved.
+ * Copyright 2022, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FBSD_COMPAT_MACHINE__BUS_H_
@@ -11,6 +10,8 @@
typedef phys_addr_t bus_addr_t;
+typedef phys_size_t bus_size_t;
+typedef addr_t bus_space_handle_t;
typedef int bus_space_tag_t;
@@ -24,21 +25,4 @@ enum {
};
-#ifdef B_HAIKU_64_BIT
-
-typedef uint64_t bus_size_t;
-typedef uint64_t bus_space_handle_t;
-
-#else
-
-typedef uint32_t bus_size_t;
-typedef unsigned int bus_space_handle_t;
-
-#if defined(__HAIKU_ARCH_PHYSICAL_64_BIT) && defined(__i386__)
-#define PAE 1
-#endif
-
-#endif
-
-
#endif /* _FBSD_COMPAT_MACHINE__BUS_H_ */
diff --git a/src/libs/compat/freebsd_network/compat/machine/x86/bus.h
b/src/libs/compat/freebsd_network/compat/machine/x86/bus.h
index 099c142be9..cecde55767 100644
--- a/src/libs/compat/freebsd_network/compat/machine/x86/bus.h
+++ b/src/libs/compat/freebsd_network/compat/machine/x86/bus.h
@@ -117,6 +117,10 @@
#define BUS_SPACE_MAXSIZE 0xFFFFFFFF
#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF
#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF
+
+#if defined(__HAIKU_ARCH_PHYSICAL_64_BIT) && defined(__i386__)
+#define PAE 1
+#endif
#if defined(__amd64__) || defined(PAE)
#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFULL
#else
diff --git a/src/libs/compat/freebsd_network/compat/vm/vm.h
b/src/libs/compat/freebsd_network/compat/vm/vm.h
index 56eef91da4..90ab6dffe9 100644
--- a/src/libs/compat/freebsd_network/compat/vm/vm.h
+++ b/src/libs/compat/freebsd_network/compat/vm/vm.h
@@ -1,36 +1,25 @@
/*
- * Copyright 2007, Hugo Santos. All Rights Reserved.
+ * Copyright 2022, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FBSD_COMPAT_VM_VM_H_
#define _FBSD_COMPAT_VM_VM_H_
-#include <stdint.h>
#include <KernelExport.h>
-#ifdef B_HAIKU_64_BIT
+typedef phys_addr_t vm_paddr_t;
+typedef addr_t vm_offset_t;
-typedef uint64_t vm_offset_t;
-typedef uint64_t vm_paddr_t;
+typedef void* pmap_t;
-#else
-
-typedef uint32_t vm_offset_t;
-typedef uint32_t vm_paddr_t;
-
-#endif
-
-typedef void *pmap_t;
+vm_paddr_t pmap_kextract(vm_offset_t virtualAddress);
+#define vtophys(virtualAddress) pmap_kextract((vm_offset_t)(virtualAddress))
#define vmspace_pmap(...) NULL
#define pmap_extract(...) NULL
-vm_paddr_t pmap_kextract(vm_offset_t virtualAddress);
-
-#define vtophys(virtualAddress) pmap_kextract((vm_offset_t)(virtualAddress))
-
#endif /* _FBSD_COMPAT_VM_VM_H_ */