C++ified remaining C users of arch_cpu.h.
This commit is contained in:
parent
6ba74ba51c
commit
5774b5afa4
@ -3,7 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel bus_managers isa ;
|
||||
UsePrivateKernelHeaders ;
|
||||
|
||||
KernelAddon isa :
|
||||
isa.c
|
||||
isa.cpp
|
||||
: isa_arch_bus_manager.a
|
||||
;
|
||||
|
||||
|
@ -6,7 +6,7 @@ UsePrivateHeaders kernel [ FDirName kernel arch x86 ] ;
|
||||
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
|
||||
|
||||
KernelStaticLibrary isa_arch_bus_manager :
|
||||
isa_dma.c
|
||||
isa_controller.c
|
||||
isa_dma.cpp
|
||||
isa_controller.cpp
|
||||
;
|
||||
|
||||
|
@ -7,9 +7,9 @@ UsePrivateHeaders kernel [ FDirName kernel arch x86 ] [ FDirName kernel util ] ;
|
||||
KernelStaticLibrary pci_arch_bus_manager :
|
||||
pci_arch_info.cpp
|
||||
pci_arch_module.cpp
|
||||
pci_bios.c
|
||||
pci_controller.c
|
||||
pci_io.c
|
||||
pci_irq.c
|
||||
pci_bios.cpp
|
||||
pci_controller.cpp
|
||||
pci_io.cpp
|
||||
pci_irq.cpp
|
||||
pci_msi.cpp
|
||||
;
|
||||
|
@ -181,29 +181,29 @@ pci_ram_address(const void *physical_address_in_system_memory)
|
||||
|
||||
pci_controller pci_controller_x86_mech1 =
|
||||
{
|
||||
.read_pci_config = pci_mech1_read_config,
|
||||
.write_pci_config = pci_mech1_write_config,
|
||||
.get_max_bus_devices = pci_mech1_get_max_bus_devices,
|
||||
.read_pci_irq = pci_x86_irq_read,
|
||||
.write_pci_irq = pci_x86_irq_write,
|
||||
pci_mech1_read_config,
|
||||
pci_mech1_write_config,
|
||||
pci_mech1_get_max_bus_devices,
|
||||
pci_x86_irq_read,
|
||||
pci_x86_irq_write,
|
||||
};
|
||||
|
||||
pci_controller pci_controller_x86_mech2 =
|
||||
{
|
||||
.read_pci_config = pci_mech2_read_config,
|
||||
.write_pci_config = pci_mech2_write_config,
|
||||
.get_max_bus_devices = pci_mech2_get_max_bus_devices,
|
||||
.read_pci_irq = pci_x86_irq_read,
|
||||
.write_pci_irq = pci_x86_irq_write,
|
||||
pci_mech2_read_config,
|
||||
pci_mech2_write_config,
|
||||
pci_mech2_get_max_bus_devices,
|
||||
pci_x86_irq_read,
|
||||
pci_x86_irq_write,
|
||||
};
|
||||
|
||||
pci_controller pci_controller_x86_bios =
|
||||
{
|
||||
.read_pci_config = pci_bios_read_config,
|
||||
.write_pci_config = pci_bios_write_config,
|
||||
.get_max_bus_devices = pci_bios_get_max_bus_devices,
|
||||
.read_pci_irq = pci_x86_irq_read,
|
||||
.write_pci_irq = pci_x86_irq_write,
|
||||
pci_bios_read_config,
|
||||
pci_bios_write_config,
|
||||
pci_bios_get_max_bus_devices,
|
||||
pci_x86_irq_read,
|
||||
pci_x86_irq_write,
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ Includes [ FGristFiles kernel_c++_structs.h ]
|
||||
SubDirCcFlags [ FDefines _KERNEL=1 ] ;
|
||||
|
||||
KernelStaticLibrary libfreebsd_network.a :
|
||||
bus.c
|
||||
bus.cpp
|
||||
callout.cpp
|
||||
clock.c
|
||||
compat.c
|
||||
|
@ -5,12 +5,17 @@
|
||||
*/
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include "device.h"
|
||||
}
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <arch/cpu.h>
|
||||
|
||||
extern "C" {
|
||||
#include <compat/dev/pci/pcireg.h>
|
||||
#include <compat/dev/pci/pcivar.h>
|
||||
#include <compat/machine/resource.h>
|
||||
@ -18,6 +23,7 @@
|
||||
#include <compat/machine/bus.h>
|
||||
#include <compat/sys/rman.h>
|
||||
#include <compat/sys/bus.h>
|
||||
}
|
||||
|
||||
// private kernel header to get B_NO_HANDLED_INFO
|
||||
#include <int.h>
|
||||
@ -149,7 +155,7 @@ bus_alloc_resource(device_t dev, int type, int *rid, unsigned long start,
|
||||
"0x%lx)\n", type, *rid, start, end, count, flags);
|
||||
|
||||
// maybe a local array of resources is enough
|
||||
res = malloc(sizeof(struct resource));
|
||||
res = (struct resource *)malloc(sizeof(struct resource));
|
||||
if (res == NULL)
|
||||
return NULL;
|
||||
|
||||
@ -256,7 +262,7 @@ rman_get_bustag(struct resource *res)
|
||||
static int32
|
||||
intr_wrapper(void *data)
|
||||
{
|
||||
struct internal_intr *intr = data;
|
||||
struct internal_intr *intr = (struct internal_intr *)data;
|
||||
|
||||
//device_printf(intr->dev, "in interrupt handler.\n");
|
||||
|
||||
@ -271,7 +277,7 @@ intr_wrapper(void *data)
|
||||
static int32
|
||||
intr_fast_wrapper(void *data)
|
||||
{
|
||||
struct internal_intr *intr = data;
|
||||
struct internal_intr *intr = (struct internal_intr *)data;
|
||||
|
||||
intr->handler(intr->arg);
|
||||
|
||||
@ -283,7 +289,7 @@ intr_fast_wrapper(void *data)
|
||||
static int32
|
||||
intr_handler(void *data)
|
||||
{
|
||||
struct internal_intr *intr = data;
|
||||
struct internal_intr *intr = (struct internal_intr *)data;
|
||||
status_t status;
|
||||
|
||||
while (1) {
|
||||
@ -398,7 +404,7 @@ bus_setup_intr(device_t dev, struct resource *res, int flags,
|
||||
int
|
||||
bus_teardown_intr(device_t dev, struct resource *res, void *arg)
|
||||
{
|
||||
struct internal_intr *intr = arg;
|
||||
struct internal_intr *intr = (struct internal_intr *)arg;
|
||||
|
||||
if (intr->is_msi && gPCIx86 != NULL) {
|
||||
// disable msi generation
|
||||
@ -892,7 +898,7 @@ pci_set_powerstate(device_t dev, int newPowerState)
|
||||
if (oldPowerState == newPowerState)
|
||||
return EOK;
|
||||
|
||||
switch (max(oldPowerState, newPowerState)) {
|
||||
switch (std::max(oldPowerState, newPowerState)) {
|
||||
case PCI_POWERSTATE_D2:
|
||||
stateTransitionDelayInUs = 200;
|
||||
break;
|
@ -19,7 +19,7 @@ MergeObject os_arch_$(TARGET_ARCH).o :
|
||||
system_info.c
|
||||
system_time_asm.S
|
||||
thread.c
|
||||
time.c
|
||||
time.cpp
|
||||
tls.c
|
||||
|
||||
$(compatibilitySources)
|
||||
|
Loading…
x
Reference in New Issue
Block a user