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.
This commit is contained in:
@@ -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_ */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
#else
|
||||
|
||||
typedef uint32_t vm_offset_t;
|
||||
typedef uint32_t vm_paddr_t;
|
||||
|
||||
#endif
|
||||
|
||||
typedef void *pmap_t;
|
||||
|
||||
|
||||
#define vmspace_pmap(...) NULL
|
||||
#define pmap_extract(...) NULL
|
||||
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
|
||||
|
||||
|
||||
#endif /* _FBSD_COMPAT_VM_VM_H_ */
|
||||
|
||||
Reference in New Issue
Block a user