* Add the kernel debugger extensions only for the haiku target.
* Acknowledge non-enabled interrupts in UHCI as done in EHCI as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30063 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -66,7 +66,7 @@ PhysicalMemoryAllocator::PhysicalMemoryAllocator(const char *name,
|
|||||||
fManagedMemory = fBlockSize[0] * fArrayLength[0];
|
fManagedMemory = fBlockSize[0] * fArrayLength[0];
|
||||||
|
|
||||||
size_t roundedSize = biggestSize * minCountPerBlock;
|
size_t roundedSize = biggestSize * minCountPerBlock;
|
||||||
#if KDEBUG
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
fDebugBase = roundedSize;
|
fDebugBase = roundedSize;
|
||||||
fDebugChunkSize = 64;
|
fDebugChunkSize = 64;
|
||||||
fDebugUseMap = 0;
|
fDebugUseMap = 0;
|
||||||
@@ -128,7 +128,7 @@ status_t
|
|||||||
PhysicalMemoryAllocator::Allocate(size_t size, void **logicalAddress,
|
PhysicalMemoryAllocator::Allocate(size_t size, void **logicalAddress,
|
||||||
void **physicalAddress)
|
void **physicalAddress)
|
||||||
{
|
{
|
||||||
#if KDEBUG
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
if (debug_debugger_running()) {
|
if (debug_debugger_running()) {
|
||||||
for (int32 i = 0; i < 64; i++) {
|
for (int32 i = 0; i < 64; i++) {
|
||||||
uint64 mask = 1LL << i;
|
uint64 mask = 1LL << i;
|
||||||
@@ -222,7 +222,7 @@ status_t
|
|||||||
PhysicalMemoryAllocator::Deallocate(size_t size, void *logicalAddress,
|
PhysicalMemoryAllocator::Deallocate(size_t size, void *logicalAddress,
|
||||||
void *physicalAddress)
|
void *physicalAddress)
|
||||||
{
|
{
|
||||||
#if KDEBUG
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
if (debug_debugger_running()) {
|
if (debug_debugger_running()) {
|
||||||
uint32 index = ((uint8 *)logicalAddress - (uint8 *)fLogicalBase
|
uint32 index = ((uint8 *)logicalAddress - (uint8 *)fLogicalBase
|
||||||
- fDebugBase) / fDebugChunkSize;
|
- fDebugBase) / fDebugChunkSize;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ private:
|
|||||||
size_t *fArrayOffset;
|
size_t *fArrayOffset;
|
||||||
uint8 **fArray;
|
uint8 **fArray;
|
||||||
|
|
||||||
#if KDEBUG
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
uint32 fDebugBase;
|
uint32 fDebugBase;
|
||||||
uint32 fDebugChunkSize;
|
uint32 fDebugChunkSize;
|
||||||
uint64 fDebugUseMap;
|
uint64 fDebugUseMap;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
Stack *gUSBStack = NULL;
|
Stack *gUSBStack = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
static int
|
static int
|
||||||
debug_get_pipe_for_id(int argc, char **argv)
|
debug_get_pipe_for_id(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,7 @@ debug_get_pipe_for_id(int argc, char **argv)
|
|||||||
set_debug_variable("_usbPipe", (uint64)object);
|
set_debug_variable("_usbPipe", (uint64)object);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
@@ -44,7 +46,7 @@ bus_std_ops(int32 op, ...)
|
|||||||
if (gUSBStack)
|
if (gUSBStack)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
// This code is to handle plain R5 (non-BONE) where the same module
|
// This code is to handle plain R5 (non-BONE) where the same module
|
||||||
// gets loaded multiple times (once for each exported module
|
// gets loaded multiple times (once for each exported module
|
||||||
// interface, the USB v2 and v3 API in our case). We don't want to
|
// interface, the USB v2 and v3 API in our case). We don't want to
|
||||||
@@ -62,7 +64,7 @@ bus_std_ops(int32 op, ...)
|
|||||||
|
|
||||||
#ifdef TRACE_USB
|
#ifdef TRACE_USB
|
||||||
set_dprintf_enabled(true);
|
set_dprintf_enabled(true);
|
||||||
#ifndef __HAIKU__
|
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
load_driver_symbols("usb");
|
load_driver_symbols("usb");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -77,10 +79,12 @@ bus_std_ops(int32 op, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gUSBStack = stack;
|
gUSBStack = stack;
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
add_debugger_command("get_usb_pipe_for_id",
|
add_debugger_command("get_usb_pipe_for_id",
|
||||||
&debug_get_pipe_for_id,
|
&debug_get_pipe_for_id,
|
||||||
"Gets the config for a USB pipe");
|
"Gets the config for a USB pipe");
|
||||||
#ifndef __HAIKU__
|
#elif HAIKU_TARGET_PLATFORM_BEOS
|
||||||
// Plain R5 workaround, see comment above.
|
// Plain R5 workaround, see comment above.
|
||||||
shared = create_area("shared usb stack", &address,
|
shared = create_area("shared usb stack", &address,
|
||||||
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_NO_LOCK,
|
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_NO_LOCK,
|
||||||
@@ -95,8 +99,11 @@ bus_std_ops(int32 op, ...)
|
|||||||
TRACE_MODULE("uninit\n");
|
TRACE_MODULE("uninit\n");
|
||||||
delete gUSBStack;
|
delete gUSBStack;
|
||||||
gUSBStack = NULL;
|
gUSBStack = NULL;
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
remove_debugger_command("get_usb_pipe_for_id",
|
remove_debugger_command("get_usb_pipe_for_id",
|
||||||
&debug_get_pipe_for_id);
|
&debug_get_pipe_for_id);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ EHCI::AddTo(Stack *stack)
|
|||||||
{
|
{
|
||||||
#ifdef TRACE_USB
|
#ifdef TRACE_USB
|
||||||
set_dprintf_enabled(true);
|
set_dprintf_enabled(true);
|
||||||
#ifndef __HAIKU__
|
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
load_driver_symbols("ehci");
|
load_driver_symbols("ehci");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ OHCI::AddTo(Stack *stack)
|
|||||||
{
|
{
|
||||||
#ifdef TRACE_USB
|
#ifdef TRACE_USB
|
||||||
set_dprintf_enabled(true);
|
set_dprintf_enabled(true);
|
||||||
#ifndef __HAIKU__
|
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
load_driver_symbols("ohci");
|
load_driver_symbols("ohci");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ pci_module_info *UHCI::sPCIModule = NULL;
|
|||||||
static int32 sDebuggerCommandAdded = 0;
|
static int32 sDebuggerCommandAdded = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
static int
|
static int
|
||||||
debug_process_transfer(int argc, char **argv)
|
debug_process_transfer(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -45,6 +46,7 @@ debug_process_transfer(int argc, char **argv)
|
|||||||
transfer.SetData(data, length);
|
transfer.SetData(data, length);
|
||||||
return ((UHCI *)pipe->GetBusManager())->ProcessDebugTransfer(&transfer);
|
return ((UHCI *)pipe->GetBusManager())->ProcessDebugTransfer(&transfer);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
@@ -494,11 +496,13 @@ UHCI::UHCI(pci_info *info, Stack *stack)
|
|||||||
WriteReg16(UHCI_USBINTR, UHCI_USBINTR_CRC | UHCI_USBINTR_IOC
|
WriteReg16(UHCI_USBINTR, UHCI_USBINTR_CRC | UHCI_USBINTR_IOC
|
||||||
| UHCI_USBINTR_SHORT);
|
| UHCI_USBINTR_SHORT);
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
if (atomic_add(&sDebuggerCommandAdded, 1) == 0) {
|
if (atomic_add(&sDebuggerCommandAdded, 1) == 0) {
|
||||||
add_debugger_command("uhci_process_transfer",
|
add_debugger_command("uhci_process_transfer",
|
||||||
&debug_process_transfer,
|
&debug_process_transfer,
|
||||||
"Processes a USB transfer with the given variables");
|
"Processes a USB transfer with the given variables");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TRACE("UHCI host controller driver constructed\n");
|
TRACE("UHCI host controller driver constructed\n");
|
||||||
fInitOK = true;
|
fInitOK = true;
|
||||||
@@ -507,10 +511,12 @@ UHCI::UHCI(pci_info *info, Stack *stack)
|
|||||||
|
|
||||||
UHCI::~UHCI()
|
UHCI::~UHCI()
|
||||||
{
|
{
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
if (atomic_add(&sDebuggerCommandAdded, -1) == 1) {
|
if (atomic_add(&sDebuggerCommandAdded, -1) == 1) {
|
||||||
remove_debugger_command("uhci_process_transfer",
|
remove_debugger_command("uhci_process_transfer",
|
||||||
&debug_process_transfer);
|
&debug_process_transfer);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int32 result = 0;
|
int32 result = 0;
|
||||||
fStopFinishThread = true;
|
fStopFinishThread = true;
|
||||||
@@ -1674,6 +1680,11 @@ UHCI::Interrupt()
|
|||||||
// Check if we really had an interrupt
|
// Check if we really had an interrupt
|
||||||
uint16 status = ReadReg16(UHCI_USBSTS);
|
uint16 status = ReadReg16(UHCI_USBSTS);
|
||||||
if ((status & fEnabledInterrupts) == 0) {
|
if ((status & fEnabledInterrupts) == 0) {
|
||||||
|
if (status != 0) {
|
||||||
|
TRACE("discarding not enabled interrupts 0x%08lx\n", status);
|
||||||
|
WriteReg16(UHCI_USBSTS, status);
|
||||||
|
}
|
||||||
|
|
||||||
release_spinlock(&lock);
|
release_spinlock(&lock);
|
||||||
return B_UNHANDLED_INTERRUPT;
|
return B_UNHANDLED_INTERRUPT;
|
||||||
}
|
}
|
||||||
@@ -1737,7 +1748,7 @@ UHCI::AddTo(Stack *stack)
|
|||||||
{
|
{
|
||||||
#ifdef TRACE_USB
|
#ifdef TRACE_USB
|
||||||
set_dprintf_enabled(true);
|
set_dprintf_enabled(true);
|
||||||
#ifndef __HAIKU__
|
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
load_driver_symbols("uhci");
|
load_driver_symbols("uhci");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user