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